A few php Phar questions -


a few questions i'm sure answers useful many getting grips relatively new phar.

  1. is possible delete or edit file inside phar script, within phar script, when it's running?

  2. i've noticed can change name of phar file examplename.phar examplename.php , run in url , still works fine. right? ok do? safe?

  3. is better practice put files in same directory , phar it, or ok keep folders , sub folders , phar - or not matter?

  4. can obfuscate phar file. or ruin it? obfuscating have done before pharing?

hopefully phar expert can answer these. thanks

  1. the usual setting of php treat phar files readonly. in fact, have change setting allow local copy of php create these files. doubt can changed, wouldn't bet on it.

  2. the general structure of phar initial php script part sets things up, , call __halt_compiler() followed zipped bytes (after transferring control script part inside phar), can whatever possible php script without phar, including changing it's name. note bootstrap code of existing phar files might not allow because of hardcoded filenames, not general case.

  3. it not matter.

  4. obfuscation on code level leave php code in runnable condition pure php won't affect phar. expects php contain special extensions fail.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo