ALL
40+ Techniques to enhance your php code
1. Do not use relative paths , instead define a ROOT pathIts quite common to see such lines :1require_once('../../lib/some_class.php');This approach has many drawbacks :It first searches for directories specified in the include paths of php , then looks from the current directory.So many directories are checked.When a script is included by another script in a different directory , its base directory changes to that of the including script.Another issue , is that when a script is being run from cron , it may not have its parent directory as the working directory.So its a good idea to have absol...
4,287 0 PHP EFFICIENCY QUIRK TRICK TECHNIQUES