Friday 15 April 2005 12:56:14 am
Hello, I have an import script that uses some classes of ez (ezdb, ezuser, eZContentClass...). This script scans my old database and imports old web pages in ez publish.
For the moment, I run it as a module of eZ publish. I would like to have it working <b>in command line</b>, for better performances. I think it's not possible to keep this script as a module : php ~/ez/index.php/admin/mymodule/myview
...dont work. So I have tried to call this script directly, including some files : include_once( EZ_DIR."lib/ezi18n/classes/eztextcodec.php" );
include_once( EZ_DIR."lib/ezutils/classes/ezdebug.php" );
include_once( EZ_DIR. "lib/ezutils/classes/ezmodule.php" );
include_once( EZ_DIR.'lib/ezutils/classes/ezexecution.php' );
include_once( EZ_DIR.'kernel/classes/ezcontentobjecttreenode.php' );
include_once( EZ_DIR.'kernel/classes/ezcontentobject.php' );
include_once( EZ_DIR."lib/ezxml/classes/ezxml.php" );
include_once( EZ_DIR.'lib/ezlocale/classes/ezdatetime.php' );
I have no errors, but <i>ezdb</i> dont seems to work ; following lines give me an error : <b>Invalid argument supplied for foreach()</b>. $db =& eZDB::instance();
$rows =& $db->arrayQuery( "select * from mytable" );
foreach ( $rows as $row ) echo $row['myfield'];
eZDebug::printReport(); returns nothing. I must maybe initialize some classes before using it ? how ? Thanks.
|