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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 03:07:02
Script start
Timing: Jan 18 2025 03:07:02
Module start 'layout'
Timing: Jan 18 2025 03:07:02
Module start 'content'
Timing: Jan 18 2025 03:07:02
Module end 'content'
Timing: Jan 18 2025 03:07:02
Script end

Main resources:

Total runtime0.7874 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 589.0234152.6250
Module start 'layout' 0.00670.0043 741.648439.4375
Module start 'content' 0.01100.7752 781.0859457.7188
Module end 'content' 0.78620.0012 1,238.804711.7188
Script end 0.7874  1,250.5234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.5122160.0003
Check MTime0.00140.1806160.0001
Mysql Total
Database connection0.00100.127710.0010
Mysqli_queries0.741094.0978520.0142
Looping result0.00060.0699500.0000
Template Total0.751195.420.3755
Template load0.00280.356120.0014
Template processing0.748395.028220.3741
Template load and register function0.00010.017910.0001
states
state_id_array0.00110.136310.0011
state_identifier_array0.00210.266220.0010
Override
Cache load0.00230.2943190.0001
Sytem overhead
Fetch class attribute can translate value0.00090.110410.0009
Fetch class attribute name0.00120.149720.0006
XML
Image XML parsing0.00010.016110.0001
class_abstraction
Instantiating content class attribute0.00000.000620.0000
General
dbfile0.00070.0929100.0001
String conversion0.00000.002340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 7
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs