Wednesday 29 June 2011 2:47:59 pm
By : Steven E. Bailey
I had to find objects that had multiple locations for a client. This is what I came up with:
<?php require 'autoload.php'; $cli = eZCLI::instance(); $script = eZScript::instance( array( 'description' => ( "finds double-published objects" ), 'use-session' => true, 'use-modules' => true, 'use-extensions' => true ) ); $script->startup(); $options = $script->getOptions( "", "[topNodeID]", array() ); $script->initialize(); $params['MainNodeOnly'] = true; $params['IgnoreVisibility'] = true; $topNodeID = ctype_digit($options["arguments"][0]) ? $options["arguments"][0] : 2; $objects = eZContentObjectTreeNode::subTreeByNodeID( $params, $topNodeID ); foreach($objects as $object) { $parents=eZContentObjectTreeNode::getParentNodeIdListByContentObjectID( $object->ContentObject->ID ); if (count($parents) != 1 ) { echo $object->attribute( 'path_identification_string')."\n"; } } $script->shutdown(); ?>
Timing: | Jan 17 2025 23:43:11 |
Script start | |
Timing: | Jan 17 2025 23:43:11 |
Module start 'layout' | |
Timing: | Jan 17 2025 23:43:11 |
Module start 'content' | |
Timing: | Jan 17 2025 23:43:11 |
Module end 'content' | |
Timing: | Jan 17 2025 23:43:11 |
Script end |
Total runtime | 0.0696 sec |
Peak memory usage | 6,144.0000 KB |
Database Queries | 42 |
Checkpoint | Start (sec) | Duration (sec) | Memory at start (KB) | Memory used (KB) |
---|---|---|---|---|
Script start | 0.0000 | 0.0051 | 587.9375 | 152.6250 |
Module start 'layout' | 0.0051 | 0.0024 | 740.5625 | 39.4531 |
Module start 'content' | 0.0075 | 0.0607 | 780.0156 | 351.6328 |
Module end 'content' | 0.0681 | 0.0014 | 1,131.6484 | 15.7031 |
Script end | 0.0695 | 1,147.3516 |
Accumulator | Duration (sec) | Duration (%) | Count | Average (sec) |
---|---|---|---|---|
Ini load | ||||
Load cache | 0.0028 | 4.0482 | 15 | 0.0002 |
Check MTime | 0.0012 | 1.6815 | 15 | 0.0001 |
Mysql Total | ||||
Database connection | 0.0005 | 0.7801 | 1 | 0.0005 |
Mysqli_queries | 0.0315 | 45.2239 | 42 | 0.0007 |
Looping result | 0.0002 | 0.3351 | 40 | 0.0000 |
Template Total | 0.0434 | 62.3 | 2 | 0.0217 |
Template load | 0.0020 | 2.8494 | 2 | 0.0010 |
Template processing | 0.0414 | 59.4825 | 2 | 0.0207 |
Template load and register function | 0.0002 | 0.2991 | 1 | 0.0002 |
states | ||||
state_id_array | 0.0010 | 1.4211 | 1 | 0.0010 |
state_identifier_array | 0.0008 | 1.0837 | 2 | 0.0004 |
Override | ||||
Cache load | 0.0016 | 2.2574 | 7 | 0.0002 |
Sytem overhead | ||||
Fetch class attribute name | 0.0017 | 2.4702 | 3 | 0.0006 |
class_abstraction | ||||
Instantiating content class attribute | 0.0000 | 0.0099 | 3 | 0.0000 |
General | ||||
dbfile | 0.0006 | 0.9024 | 10 | 0.0001 |
String conversion | 0.0000 | 0.0120 | 4 | 0.0000 |
Note: percentages do not add up to 100% because some accumulators overlap |
Usage | Requested template | Template | Template loaded | Edit | Override |
---|---|---|---|---|---|
1 | node/view/full.tpl | blog_entry/full.tpl | extension/community_design/design/suncana/override/templates/blog_entry/full.tpl | ||
2 | content/datatype/view/ezxmltext.tpl | <No override> | extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tpl | ||
1 | content/datatype/view/ezxmltags/literal.tpl | <No override> | extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tpl | ||
1 | content/datatype/view/ezxmltags/paragraph.tpl | <No override> | extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tpl | ||
1 | content/datatype/view/ezkeyword.tpl | <No override> | extension/community_design/design/suncana/templates/content/datatype/view/ezkeyword.tpl | ||
1 | print_pagelayout.tpl | <No override> | extension/community/design/community/templates/print_pagelayout.tpl | ||
Number of times templates used: 7 Number of unique templates used: 6 |
Time used to render debug report: 0.0001 secs