creating classes pragramatically

Author Message

Igor Kromin

Monday 30 June 2003 9:54:36 pm

(i've just started with ez publish and still exploring it, so there may be a glaring obvious answer to this).

i'm trying to create various classes that i will be using in my web appliaction using a php script. this script will be run as a first stage to deploy the application onto the production web server.

i am following the tutorial on how to create and save a new class, but i get the following error:

Warning: Failed opening 'lib/ezdb/classes/ezdb.php' for inclusion (include_path='.:/usr/lib/php') in /Users/ikromin/kc_site/lib/ezutils/classes/ezsession.php on line 75

the script that i am running is shown below:

<?php

include_once( "kernel/classes/ezcontentclass.php" );

// create new empty class
$user =& eZUser::currentUser();
$class = eZContentClass::create( $user->attribute( "id" ) );

// set the name and identifier
$class->setAttribute( "name", "new class1" );
$class->setAttribute( "identifier", "new_class1" );

$class->store();

?>

i am saving the script in the root directory of the web server.

thanks for your help in advance

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

Main resources:

Total runtime0.6706 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 587.9219152.6250
Module start 'layout' 0.00490.0024 740.546939.4453
Module start 'content' 0.00720.6622 779.9922407.3359
Module end 'content' 0.66940.0011 1,187.32818.1563
Script end 0.6706  1,195.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4414160.0002
Check MTime0.00140.2076160.0001
Mysql Total
Database connection0.00080.119710.0008
Mysqli_queries0.634494.6125460.0138
Looping result0.00040.0558440.0000
Template Total0.643095.920.3215
Template load0.00220.328920.0011
Template processing0.640795.549420.3204
Template load and register function0.00010.017410.0001
states
state_id_array0.00170.250710.0017
state_identifier_array0.00080.120820.0004
Override
Cache load0.00170.2568200.0001
Sytem overhead
Fetch class attribute can translate value0.00050.071910.0005
Fetch class attribute name0.00050.067610.0005
XML
Image XML parsing0.00010.017210.0001
class_abstraction
Instantiating content class attribute0.00000.000610.0000
General
dbfile0.00050.0754100.0001
String conversion0.00000.000940.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
1content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs