Posted By

tomcottrill on 12/05/11


Tagged

php include paths


Versions (?)

Defining Extra Include Paths


 / Published in: PHP
 

This snippet shows a dynamic way to enable extra default include paths.

  1. <?php
  2.  
  3. define('APPLICATION_PATH', realpath("../"));
  4. $paths = array(
  5. APPLICATION_PATH,
  6. APPLICATION_PATH . "/classes",
  7. APPLICATION_PATH . "/functions",
  8. );
  9.  
  10. set_include_path(implode(PATH_SEPARATOR, $paths));
  11.  
  12. require_once ('functions.php');
  13.  
  14.  
  15. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: tomcottrill on December 5, 2011

My first snipplr submission.

You need to login to post a comment.