Thursday 30 June 2011 4:18:17 pm
By : Steven E. Bailey
Here's a little script I use when I have get the info from a class or classes:
<?php require 'autoload.php'; $cli = eZCLI::instance(); $script = eZScript::instance( array( 'description' => ( "Displays Class attributes of either [CLASS] or all classes" ), 'use-session' => false, 'use-modules' => true, 'use-extensions' => true ) ); $script->startup(); $options = $script->getOptions( "", "[class]", array() ); $script->initialize(); eZDebug::writeDebug( $options, "options" ); if ( count( $options['arguments'] ) >= 1 ) { foreach ( $options['arguments'] as $identifier ) { if ( is_numeric( $identifier ) ) { $ContentObjectClass = eZContentClass::fetch( $identifier ); if (is_object($ContentObjectClass)) { $identifier = $ContentObjectClass->attribute('identifier'); } else { echo "Error: Invalid class identifier: ".$identifier."\n"; $script->shutdown(); exit(); } } $classList[] = eZContentClass::fetchByIdentifier($identifier,true); } } else { $classList = eZContentClass::fetchAllClasses(); } foreach($classList as $class) { if (is_object($class)) { echo $class->attribute('id')." <--> ".$class->attribute('name')." <--> ".$class->attribute('identifier')."\n"; $classAttributes = eZContentClass::fetchAttributes($class->attribute( 'id'),true); foreach ($classAttributes as $attribute) { echo $attribute->attribute( "id" )."|"; echo $attribute->attribute( "name" )."|"; echo $attribute->attribute( "identifier" )."|"; echo $attribute->attribute( "data_type_string" ); if ($attribute->attribute( 'is_required' ) ){ echo "|required"; } if ($attribute->attribute( 'is_searchable' ) ){ echo "|searchable"; } if ($attribute->attribute( 'is_information_collector' ) ){ echo "|collector"; } echo "\n"; } } else { echo $class." invalid identifier, skipping."; } } $script->shutdown(); ?>
Timing: | Jan 29 2025 13:46:41 |
Script start | |
Timing: | Jan 29 2025 13:46:41 |
Module start 'layout' | |
Timing: | Jan 29 2025 13:46:41 |
Module start 'content' | |
Timing: | Jan 29 2025 13:46:41 |
Module end 'content' | |
Timing: | Jan 29 2025 13:46:41 |
Script end |
Total runtime | 0.0140 sec |
Peak memory usage | 2,048.0000 KB |
Database Queries | 3 |
Checkpoint | Start (sec) | Duration (sec) | Memory at start (KB) | Memory used (KB) |
---|---|---|---|---|
Script start | 0.0000 | 0.0060 | 589.2422 | 151.1953 |
Module start 'layout' | 0.0060 | 0.0020 | 740.4375 | 36.6250 |
Module start 'content' | 0.0080 | 0.0046 | 777.0625 | 94.5781 |
Module end 'content' | 0.0126 | 0.0013 | 871.6406 | 29.9766 |
Script end | 0.0139 | 901.6172 |
Accumulator | Duration (sec) | Duration (%) | Count | Average (sec) |
---|---|---|---|---|
Ini load | ||||
Load cache | 0.0023 | 16.5123 | 14 | 0.0002 |
Check MTime | 0.0010 | 7.3777 | 14 | 0.0001 |
Mysql Total | ||||
Database connection | 0.0009 | 6.7522 | 1 | 0.0009 |
Mysqli_queries | 0.0019 | 13.9061 | 3 | 0.0006 |
Looping result | 0.0000 | 0.0718 | 1 | 0.0000 |
Template Total | 0.0009 | 6.5 | 1 | 0.0009 |
Template load | 0.0006 | 4.5152 | 1 | 0.0006 |
Template processing | 0.0003 | 1.9858 | 1 | 0.0003 |
Override | ||||
Cache load | 0.0004 | 3.1189 | 1 | 0.0004 |
General | ||||
dbfile | 0.0006 | 4.4109 | 8 | 0.0001 |
String conversion | 0.0000 | 0.0496 | 4 | 0.0000 |
Note: percentages do not add up to 100% because some accumulators overlap |
Usage | Requested template | Template | Template loaded | Edit | Override |
---|---|---|---|---|---|
1 | print_pagelayout.tpl | <No override> | extension/community/design/community/templates/print_pagelayout.tpl | ||
Number of times templates used: 1 Number of unique templates used: 1 |
Time used to render debug report: 0.0001 secs