Forums / Developer / Execute bin script outside Exponential root dir? / Comment51531
Gaetano Giunta
Wednesday 29 July 2009 5:23:40 am
Try this as first lines of your script:
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) { // this script is not meant to be accessed via the web! // note: ezscript class later does the same check, but after intializing a lot of stuff die(); } // try to move to Exponential root dir if called in different dirs if ( !file_exists( getcwd() . '/autoload.php' ) ) { $dir = dirname( __FILE__ ); chdir( $dir . '/ezpublish_root' ); }
Principal Consultant International Business Member of the Community Project Board