Description
It is a bit of a pain to get the list of options from an ezp php scripts that declares the need for a session, if the db declared in the main siteaccess is not available: ezp will try to start the session before echoing the help text and echo the help text before switching siteaccess -> php dies with an exception.
The culprit is ezscript.php, around here:
if ( $options['help'] ) { if ( !$this->IsInitialized ) $this->initialize(); $this->showHelp(); $this->shutdown( 0 ); } if ( isset( $options['siteaccess'] ) and $options['siteaccess'] ) $this->setUseSiteAccess( $options['siteaccess'] ); if ( isset( $options['login'] ) and $options['login'] ) $this->setUser( $options['login'], isset( $options['password'] ) ? $options['password'] : false );
The solution: echo the help text after calling setUseSiteAccess and setUser
if ( isset( $options['siteaccess'] ) and $options['siteaccess'] ) $this->setUseSiteAccess( $options['siteaccess'] ); if ( isset( $options['login'] ) and $options['login'] ) $this->setUser( $options['login'], isset( $options['password'] ) ? $options['password'] : false ); if ( $options['help'] ) { if ( !$this->IsInitialized ) $this->initialize(); $this->showHelp(); $this->shutdown( 0 ); }
The offending script: updatesearchindexdata in ezfind...