eZPublish
4.5
|
Classes | |
class | CommandLineArguments |
Class used to store some of the command line arguments. More... | |
Functions | |
changeDBCharset ($charset, $collation) | |
changeDBCharsetMYSQL ($charset, $collation) | |
changeDBCharsetORACLE ($charset, $collation) | |
NOTE: What if other data is also in the db? Either we do not convert it and have it most likely corrupted, or we convert it - and leave to the client for the other apps to set up NLS_LANG correctly to keep working. More... | |
changeDBCharsetPOSTGRESQL ($charset, $collation) | |
checkDBCharset ($iconvCharacterSet) | |
checkDBDriver () | |
checkDBExtraConditions () | |
checkDBExtraConditionsORACLE () | |
convertArray ($array, $inCharset, $outCharset) | |
convertCustomXMLData ($tableInfoList) | |
convertSerializedData ($serializedDataInfo) | |
convertXMLCustomDataProgress ($row) | |
convertXMLData ($tableInfo, $xmlDataSelectSQLFunction, $xmlDataUpdateSQLFunction, $convertXMLProgressFunction) | |
convertXMLDatatypeProgress ($row) | |
convertXMLDatatypes ($tableInfoList) | |
createBLOBColumnMYSQL ($tableInfo) | |
createBLOBColumnORACLE ($tableInfo) | |
createBLOBColumnPOSTGRESQL ($tableInfo) | |
createContentClassAttributeTempTable () | |
dropBLOBColumn ($tableInfo) | |
dropBLOBColumns ($serializedDataInfo) | |
dropContentClassAttributeTempTable () | |
eZExecuteShellCommand ($command, $errMessage= '', $retry=true, $ignore=false) | |
eZGetUserInput ($prompt) | |
parseCustomSerializedDataOption ($serializedCustomDataOption) | |
parseCustomXMLDataOption ($xmlCustomDataOption) | |
parseXMLAttributesOption ($xmlAttributesOption) | |
removeIllegalUTF8Characters ($text) | |
For some reason, some utf8 encoded text stored in the db might contain illegal utf8 characters. More... | |
restoreSerializedData ($serializedDataInfo) | |
serializeContentClassAttributeNames () | |
serializeContentClassNames () | |
serializeNames ($selectSQL, $storeToTable) | |
showError ($message, $addEOL=true, $bailOut=true) | |
showMessage ($message, $addEOL=true) | |
showMessage2 ($message, $addEOL=true) | |
showMessage3 ($message, $addEOL=true) | |
showNotice ($message, $addEOL=true) | |
showWarning ($message, $addEOL=true) | |
storeSerializedName ($serializedName, $id, $version, $table) | |
unserializeContentClassAttributeNames () | |
xmlCustomDataSelectSQL ($dataTableInfo) | |
xmlCustomDataUpdateSQL ($dataTableInfo, $row) | |
xmlDatatypeSelectSQL ($dataTableInfo) | |
xmlDatatypeUpdateSQL ($dataTableInfo, $row) | |
Variables | |
$cli = eZCLI::instance() | |
$collation = $options['collation'] ? $options['collation'] : 'utf8_general_ci' | |
$db = eZDB::instance() | |
$eZDir = getcwd() | |
if(CommandLineArguments::logFilename()!==false) | $iconvCharacterSet = $options["iconv-character-set"] ? $options["iconv-character-set"] : false |
if(!$db->isConnected()) if(!checkDBDriver()) | $logFilename = $options['log-filename'] ? $options['log-filename'] : false |
$options | |
$script | |
$serializedCustomDataOption = $options['extra-serialized-data'] ? $options['extra-serialized-data'] : '' | |
$serializedDataInfo = parseCustomSerializedDataOption( $serializedCustomDataOption ) | |
$skipClassTranslations = $options["skip-class-translations"] | |
$xmlAttributesInfo = parseXMLAttributesOption( $xmlAttributesOption ) | |
$xmlAttributesOption = $options['extra-xml-attributes'] ? $options['extra-xml-attributes'] : '' | |
$xmlCustomDataInfo = parseCustomXMLDataOption( $xmlCustomDataOption ) | |
if($xmlAttributesInfo &&count($xmlAttributesInfo)==0) | $xmlCustomDataOption = $options['extra-xml-data'] ? $options['extra-xml-data'] : '' |
const | EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME 'ezcontentclass_attribute_tmp' |
const | EZ_CREATE_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL_MYSQL " CREATE TEMPORARY TABLE " . EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME . " ( id int(11) NOT NULL default '0', version int(11) NOT NULL default '0', is_always_available int(11) NOT NULL default '0', language_locale varchar(20) NOT NULL default '', name varchar(255) NOT NULL default '', PRIMARY KEY (id,version,language_locale) )" |
const | EZ_CREATE_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL_ORACLE " CREATE GLOBAL TEMPORARY TABLE " . EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME . " ( id number(11) DEFAULT 0 NOT NULL, version number(11) DEFAULT 0 NOT NULL, is_always_available number(11) DEFAULT 0 NOT NULL, language_locale varchar2(20) NOT NULL, name varchar2(255) NOT NULL ) ON COMMIT PRESERVE ROWS;" |
const | EZ_CREATE_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL_POSTGRESQL " CREATE TABLE " . EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME . " ( id integer DEFAULT 0 NOT NULL, version integer DEFAULT 0 NOT NULL, is_always_available integer DEFAULT 0 NOT NULL, language_locale character varying(20) DEFAULT ''::character varying NOT NULL, name character varying(255) DEFAULT ''::character varying NOT NULL )" |
const | EZ_DROP_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL "DROP TABLE " . EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME |
for ($i=0;$i > 0;$i--) | |
$db | InputTextCodec = null |
$db | OutputTextCodec = null |
changeDBCharset | ( | $charset, | |
$collation | |||
) |
changeDBCharsetMYSQL | ( | $charset, | |
$collation | |||
) |
changeDBCharsetORACLE | ( | $charset, | |
$collation | |||
) |
NOTE: What if other data is also in the db? Either we do not convert it and have it most likely corrupted, or we convert it - and leave to the client for the other apps to set up NLS_LANG correctly to keep working.
We could use the csalter script iff we where sure that db version was > 9... Oracle 9 exp exports data using the DB charset
From http://www.experts-exchange.com/Database/Oracle/Q_22836430.html
May be the best procedure is the following one: On PROD Database:
Unfortunately even if we do that, Oracle will nto let us convert a db from latin1 to utf8 charsets. The only way is to drop the db and creater it from scratch. Since we have no clue about db storage, we will let the admin take care of that part, and only do the export/import parts.
changeDBCharsetPOSTGRESQL | ( | $charset, | |
$collation | |||
) |
checkDBCharset | ( | $iconvCharacterSet | ) |
Check db charset
checkDBDriver | ( | ) |
Check db driver
checkDBExtraConditions | ( | ) |
DB specific checks. A string is returned for error conditions (script halts after printing it)
checkDBExtraConditionsORACLE | ( | ) |
We should really check for exp_full, imp_full, (sysdba) privileges rather than DBA role...
add check for RAC - do not try anything in such a case
convertArray | ( | $array, | |
$inCharset, | |||
$outCharset | |||
) |
Referenced by convertSerializedData().
convertCustomXMLData | ( | $tableInfoList | ) |
convertSerializedData | ( | $serializedDataInfo | ) |
Logic:
convertXMLCustomDataProgress | ( | $row | ) |
convertXMLData | ( | $tableInfo, | |
$xmlDataSelectSQLFunction, | |||
$xmlDataUpdateSQLFunction, | |||
$convertXMLProgressFunction | |||
) |
Convert xml text to db's charset. However for optimization the xml processing instruction 'encoding' will be set to utf-8.
convertXMLDatatypeProgress | ( | $row | ) |
convertXMLDatatypes | ( | $tableInfoList | ) |
createBLOBColumnMYSQL | ( | $tableInfo | ) |
createBLOBColumnORACLE | ( | $tableInfo | ) |
createBLOBColumnPOSTGRESQL | ( | $tableInfo | ) |
createContentClassAttributeTempTable | ( | ) |
dropBLOBColumn | ( | $tableInfo | ) |
dropBLOBColumns | ( | $serializedDataInfo | ) |
dropContentClassAttributeTempTable | ( | ) |
eZExecuteShellCommand | ( | $command, | |
$errMessage = '' , |
|||
$retry = true , |
|||
$ignore = false |
|||
) |
Referenced by changeDBCharsetORACLE().
eZGetUserInput | ( | $prompt | ) |
prompt user to choose what to do next
Referenced by changeDBCharsetORACLE(), and checkDBExtraConditionsORACLE().
parseCustomSerializedDataOption | ( | $serializedCustomDataOption | ) |
process custom xml data info
false
or an array of table infos. parseCustomXMLDataOption | ( | $xmlCustomDataOption | ) |
process custom xml data info false
of an array of table infos.
parseXMLAttributesOption | ( | $xmlAttributesOption | ) |
process xml attributes info
false
or an array of table infos. removeIllegalUTF8Characters | ( | $text | ) |
For some reason, some utf8 encoded text stored in the db might contain illegal utf8 characters.
This function will strip/replace such known characters
Referenced by convertXMLData().
restoreSerializedData | ( | $serializedDataInfo | ) |
Restore data from binary column
serializeContentClassAttributeNames | ( | ) |
serializeContentClassNames | ( | ) |
serializeNames | ( | $selectSQL, | |
$storeToTable | |||
) |
showError | ( | $message, | |
$addEOL = true , |
|||
$bailOut = true |
|||
) |
showMessage | ( | $message, | |
$addEOL = true |
|||
) |
Referenced by downloadPackages(), and showPackageActions().
showMessage2 | ( | $message, | |
$addEOL = true |
|||
) |
Referenced by downloadPackages(), installPackages(), updateINI_1_1_0(), updateINI_1_2_0(), and updateINI_1_4_0().
showMessage3 | ( | $message, | |
$addEOL = true |
|||
) |
showNotice | ( | $message, | |
$addEOL = true |
|||
) |
showWarning | ( | $message, | |
$addEOL = true |
|||
) |
Referenced by changeDBCharsetORACLE(), checkDBExtraConditionsORACLE(), convertXMLData(), and handlePackageError().
storeSerializedName | ( | $serializedName, | |
$id, | |||
$version, | |||
$table | |||
) |
unserializeContentClassAttributeNames | ( | ) |
xmlCustomDataSelectSQL | ( | $dataTableInfo | ) |
xmlCustomDataUpdateSQL | ( | $dataTableInfo, | |
$row | |||
) |
xmlDatatypeSelectSQL | ( | $dataTableInfo | ) |
xmlDatatypeUpdateSQL | ( | $dataTableInfo, | |
$row | |||
) |
$cli = eZCLI::instance() |
$collation = $options['collation'] ? $options['collation'] : 'utf8_general_ci' |
Referenced by changeDBCharset().
$db = eZDB::instance() |
$eZDir = getcwd() |
Referenced by changeDBCharsetORACLE(), and showError().
if (CommandLineArguments::logFilename()!==false) $iconvCharacterSet = $options["iconv-character-set"] ? $options["iconv-character-set"] : false |
Referenced by checkDBCharset().
if (!$db->isConnected()) if (!checkDBDriver()) $logFilename = $options['log-filename'] ? $options['log-filename'] : false |
$options |
$script |
$serializedCustomDataOption = $options['extra-serialized-data'] ? $options['extra-serialized-data'] : '' |
Referenced by parseCustomSerializedDataOption().
$serializedDataInfo = parseCustomSerializedDataOption( $serializedCustomDataOption ) |
Referenced by convertSerializedData(), parseCustomSerializedDataOption(), and restoreSerializedData().
$skipClassTranslations = $options["skip-class-translations"] |
$xmlAttributesInfo = parseXMLAttributesOption( $xmlAttributesOption ) |
Referenced by parseXMLAttributesOption().
$xmlAttributesOption = $options['extra-xml-attributes'] ? $options['extra-xml-attributes'] : '' |
Referenced by parseXMLAttributesOption().
$xmlCustomDataInfo = parseCustomXMLDataOption( $xmlCustomDataOption ) |
Referenced by parseCustomXMLDataOption().
if ($xmlAttributesInfo &&count($xmlAttributesInfo)==0) $xmlCustomDataOption = $options['extra-xml-data'] ? $options['extra-xml-data'] : '' |
Referenced by parseCustomXMLDataOption().
const EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME 'ezcontentclass_attribute_tmp' |
const EZ_CREATE_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL_MYSQL " CREATE TEMPORARY TABLE " . EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME . " ( id int(11) NOT NULL default '0', version int(11) NOT NULL default '0', is_always_available int(11) NOT NULL default '0', language_locale varchar(20) NOT NULL default '', name varchar(255) NOT NULL default '', PRIMARY KEY (id,version,language_locale) )" |
const EZ_CREATE_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL_ORACLE " CREATE GLOBAL TEMPORARY TABLE " . EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME . " ( id number(11) DEFAULT 0 NOT NULL, version number(11) DEFAULT 0 NOT NULL, is_always_available number(11) DEFAULT 0 NOT NULL, language_locale varchar2(20) NOT NULL, name varchar2(255) NOT NULL ) ON COMMIT PRESERVE ROWS;" |
const EZ_CREATE_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL_POSTGRESQL " CREATE TABLE " . EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME . " ( id integer DEFAULT 0 NOT NULL, version integer DEFAULT 0 NOT NULL, is_always_available integer DEFAULT 0 NOT NULL, language_locale character varying(20) DEFAULT ''::character varying NOT NULL, name character varying(255) DEFAULT ''::character varying NOT NULL )" |
const EZ_DROP_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL "DROP TABLE " . EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME |
for($i=0;$i > 0;$i--) |
$db InputTextCodec = null |
$db OutputTextCodec = null |