PHP class to create ISO image
Asked Answered
N

1

10

I wanted to know if this is possible?

I would like to create a cross platform Flash projector and files and than create an ISO from it for the user to download.

Google did not help me much so far...

Newman answered 22/2, 2011 at 11:5 Comment(5)
Interesting question. I'd be concerned about the speed of it if you're expecting PHP to package up 600mb of data on the fly when the user requests it. You might be better off having it run as a background process (which would mean it could be in any language).Samba
To let you know, PHP is an HTML preprocessor, not coffee-machine, nor MIDI-tracker, nor ISO-toolkit. Go figure.Loath
You are looking for a simple system("mkisofs -R -J -v -T path/"); wrapper. Albeit writing a class for generating ISO filesystems directly via PHP seems tempting..Pascoe
I realize this can not be done on the fly. I am looking just for something to start the process with a notification email. Animoto.com do this for rendering their videos, after the notification you can download the ISO. This does not have to be in PHP. Any other suggestions welcome.Newman
PHP can be used on the command line just fine, so it isn't restricted to HTML pre-processing. see: php.net/manual/en/features.commandline.phpExpurgatory
M
9

Of course it is possible to do directly from PHP.

However, as one of the comments to your question states, it's probably going to be easier to call an external binary to do the work for you (Although not all hosts may have mkisofs installed).

If you really must do this from PHP, here's some useful references for you.

ISO 9660 specification (ECMA-119) - This is the file format for "ISO" image files.

PHP pack() and unpack() - These will help you manipulate binary data in PHP.

Once you're familiar with the file structure, you may be able to create some pre-compiled segments, and just patch them at various offsets as well as inserting the payload.

Good luck!

Mitsukomitt answered 22/2, 2011 at 11:20 Comment(2)
Thank you. Any suggestions about the other external binaries? The server is Apache, but that's all I know right now. CheersNewman
You could try echo system('which mkisofs'); to see if this command is available to you (assuming a *nix based host), alternatively your best bet is probably to talk to your hosting provider. Milage may vary.Mitsukomitt

© 2022 - 2024 — McMap. All rights reserved.