Forums / Developer / Problem with ezscripts

Problem with ezscripts

Author Message

Romain Bremaud

Wednesday 06 July 2011 5:00:53 am

Hi there,

We upgraded EZPublish from 4.1.3 to 4.4, and a nasty problem appeared while using the ezscripts class.

My code is at the bottom of the post.There is probably a bug in the line:  $options = $script->getOptions("[debut:][fin:][langue:][periode: ] " ) ; If I comment it out, the scripts completes properly, otherwise it bugs (the rest of the script does not execute), WITHOUT displaying any error message, nor log. There was no issue with version 4.1.3 

$cli = eZCLI::instance();

$cli->output('je passe');

$script = eZScript::instance( array( 'description' => ( "Mon script\n" .

                                                        "depuis \n" .

                                                        "" ),

                                     'use-session' => true,

                                     'use-modules' => true,

                                     'use-extensions' => true ) );

$script->startup();

$cli->output('je passeV4');

try

{

            $cli->output('je passeV6'); 

            $options = $script->getOptions(    "[debut:][fin:][langue:][periode:]",

                                            "",

                                            array(    'debut'           => 'Date de debut au format AAAAMMJJ',

                                                             'fin'                 => 'Date de fin au format AAAAMMJJ',

                                                             'langue'          => 'EN ou FR',

                                                           'periode'        => 'Nombre de jours avant la date de fin pour calculer la date de debut.'),

                                            false);

            $cli->output('je passeV7');                      

}

catch(Exception $e)

{

            $cli->output('erreur');

            $cli->error('Erreur critique: '.$e->getMessage());

}  

Romain Bremaud
Les clefs du net

Romain Bremaud

Wednesday 06 July 2011 7:40:30 am

Hum,

If I run the script with the debug parameter :

php ./bin/php/solucom/an_importNews.php -d --periode=60 --langue=EN

the script past 

but if i run the script with the quiet parameter the script crash 

php ./bin/php/solucom/an_importNews.php -q --periode=60 --langue=EN

oO

If I comment it out the 968 in ezscript.php ($this->setIsQuiet( true ); )    the command works. 

Any Idea ? 

Thanks in advance.

Romain

Romain Bremaud
Les clefs du net