Catching errors in a php script

Author Message

Nicolas R

Wednesday 11 March 2009 2:28:35 am

Hello,

I have a php script in an extension that queries and updates data in eZPublish.
I am currently working on it and I noticed that if the script fails, I have an eZPublish fatal error and the script ends abruptly.
How can I catch this error in order to properly end my script ?

Thank you.

Jean-Yves Zinsou

Monday 23 March 2009 6:01:04 am

Hi there,
i am not an php guru but have you try the try/catch features in php5 ?

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

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 15:07:09
Script start
Timing: Jan 18 2025 15:07:09
Module start 'layout'
Timing: Jan 18 2025 15:07:09
Module start 'content'
Timing: Jan 18 2025 15:07:10
Module end 'content'
Timing: Jan 18 2025 15:07:10
Script end

Main resources:

Total runtime0.8386 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 589.0469152.6250
Module start 'layout' 0.00500.0024 741.671939.4453
Module start 'content' 0.00740.8300 781.1172519.5391
Module end 'content' 0.83740.0011 1,300.65638.1641
Script end 0.8385  1,308.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3592160.0002
Check MTime0.00130.1548160.0001
Mysql Total
Database connection0.00070.085810.0007
Mysqli_queries0.799695.3597540.0148
Looping result0.00050.0552520.0000
Template Total0.814997.220.4075
Template load0.00190.221320.0009
Template processing0.813096.957920.4065
Template load and register function0.00010.017310.0001
states
state_id_array0.00070.083510.0007
state_identifier_array0.00080.099920.0004
Override
Cache load0.00150.1790120.0001
Sytem overhead
Fetch class attribute can translate value0.00090.108520.0005
Fetch class attribute name0.00100.116130.0003
XML
Image XML parsing0.00200.233520.0010
class_abstraction
Instantiating content class attribute0.00000.001130.0000
General
dbfile0.00200.2361160.0001
String conversion0.00000.000540.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
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs