I would like to know how to use path
in a procedural system, the correct way to define the paths, and to access the files, and what else is important to know about it. Researching found more examples in OOP, and found nothing here on this subject.
I'm using ../
, and sometimes ../../../../
rsrs so I think it's time to fix it.
I know I can use define
, but I was not sure where to include it, and I did not quite understand the operation of DIRECTORY_SEPARATOR
, and options. In this question in SO , you have several paths defined, not just the root , and I want to know, using the procedural system, how do I use it. I create a file with all these rules for each directory? How do I access these directories later?
I'll post an example of using path
to generate an error log (which was used in this answer ) and if anyone is willing to explain the details, I think it would be interesting to illustrate how it works.
ini_set('error_log', BASE_DIR . DIRECTORY_SEPARATOR . 'logs' . DS . 'php' . DIRECTORY_SEPARATOR . 'PHP_errors-' . date('Ym') . '.log');