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

eZ debug

Timing: Jan 29 2025 13:47:16
Script start
Timing: Jan 29 2025 13:47:16
Module start 'content'
Timing: Jan 29 2025 13:47:16
Module end 'content'
Timing: Jan 29 2025 13:47:16
Script end

Main resources:

Total runtime0.1328 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.9063180.8516
Module start 'content' 0.00610.0050 768.757893.7734
Module end 'content' 0.01110.1216 862.5313524.3906
Script end 0.1327  1,386.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00322.3752200.0002
Check MTime0.00130.9876200.0001
Mysql Total
Database connection0.00070.518010.0007
Mysqli_queries0.090868.36671410.0006
Looping result0.00130.94811390.0000
Template Total0.121391.410.1213
Template load0.00070.505310.0007
Template processing0.120690.861710.1206
Override
Cache load0.00050.358410.0005
Sytem overhead
Fetch class attribute can translate value0.00060.451210.0006
XML
Image XML parsing0.00030.210810.0003
General
dbfile0.00513.8548200.0003
String conversion0.00000.006130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs