/* here is a example of how to write a script for ezpublish by pengbihao. */ require 'autoload.php'; $isQuiet = false; $cli = eZCLI::instance(); $script = eZScript::instance( array( 'description' => ( "eZ Publish EzOE Update Custom Tags/n" . "Update data in ezxmltext datatype in database/n" . "/n" . "./bin/php/updateezoecustomtag.php" ), 'use-session' => false, 'use-modules' => false, 'use-extensions' => true ) ); $script->startup(); $script->initialize(); // actually code here $db = eZDB::instance(); $sql_id ='SELECT `contentobject_id` , max( `version` ) as mvson FROM `ezcontentobject_attribute` WHERE `data_text` LIKE /'%<custom name="cadreBlancOmbrePorte">%/' AND `data_type_string` LIKE "ezxmltext" GROUP BY `contentobject_id` '; $o_ids = $db->arrayQuery($sql_id); //ezdb api you can also use $db->query($sql_id); //$str=preg_replace("/>[ ]+</si","><",$dara); // actually code end if ( !$isQuiet ) $cli->notice( "Custom tag problem fixed." ); $script->shutdown();