Share » Forums » Developer » Execute bin script outside eZ Publish...

Execute bin script outside eZ Publish root dir?

Execute bin script outside eZ Publish root dir?

Wednesday 29 July 2009 5:05:50 am - 2 replies

Author Message

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 eZ Publish 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

Bartek Modzelewski

Wednesday 29 July 2009 5:37:51 am

Thanks !

In fact I was thinking about it but ... "it's to simple, I will not work". So I haven't tried .. stupid me ;)

Baobaz
http://www.baobaz.com

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu