Forums / Developer / creating classes pragramatically

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