SAFE MODE and file ops

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

SAFE MODE and file ops

Post by alex.barylski »

So as I discovered the hard way, SAFE MODE doesn't like some file operations...

As I was reading in the PHP comments section, someone recommends using FTP access instead of direct file access if SAFE MODE is a problem...

Which got me thinking...

I could probalby use shell command to carry out tasks like:
- copy
- move
- remove
- chdir
- mkdir
- etc...

As these functions are for a file manager, I would also need listings ability, which I believe is the -ls command on *nix, but what about Windows platforms?

dir?

It would likely be easier to use FTP to avoid cross platform issues???

Slow as hell, but flexible enough to emulate most of a file manager...

Only problem with FTP I can foresee is the globbing function I use (custom) which requires information on file details (size, etc...) but also specifics like checking actual file headers for magic byte codes - in which case every listing I did would return require me to download the file to TEMP directory, check it's bytes and continue...

That could really slow things down :P

Anyways, opinions???

Cheers :)
Post Reply