|
eZ Publish
[4.0]
|
Go to the source code of this file.
Classes | |
| class | CommandLineArguments |
| Class used to store some of the command line arguments. More... | |
Enumerations | |
| enum | EZ_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_NAME |
| enum | EZ_CREATE_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL_MYSQL |
| enum | EZ_CREATE_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL_ORACLE |
| enum | EZ_CREATE_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL_POSTGRESQL |
| enum | EZ_DROP_CONTENTCLASS_ATTRIBUTE_TMP_TABLE_SQL |
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. | |
| 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. | |
| 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 = "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 = "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'] : '' |
| for ($i=0;$i > 0;$i--) | |
| $db | InputTextCodec = null |
| $db | OutputTextCodec = null |
Definition at line 34 of file ezconvertdbcharset.php.
Definition at line 36 of file ezconvertdbcharset.php.
Definition at line 56 of file ezconvertdbcharset.php.
Definition at line 47 of file ezconvertdbcharset.php.
Definition at line 65 of file ezconvertdbcharset.php.
| changeDBCharset | ( | $ | charset, |
| $ | collation | ||
| ) |
Definition at line 1150 of file ezconvertdbcharset.php.
| changeDBCharsetMYSQL | ( | $ | charset, |
| $ | collation | ||
| ) |
Definition at line 1166 of file ezconvertdbcharset.php.
| 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: 1. export full=y rows=n file=export_db_structure.dmp 2. export full=y file=export_db_date.dmp On TEST Database: 1. create tablespaces with the same name on PROD 2. import full=y file=export_db_structure.dmp ignore=y Now we have users of PROD, on TEST database. SYSTEM user is not imported, because already exists. 3. import fromuser=user1,user2,user3 touser=user1,user2,user3 file=export_db_data.dmp ignore=y now we have user1..3 data on their tables...
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.
Definition at line 1293 of file ezconvertdbcharset.php.
| changeDBCharsetPOSTGRESQL | ( | $ | charset, |
| $ | collation | ||
| ) |
Definition at line 1188 of file ezconvertdbcharset.php.
| checkDBCharset | ( | $ | iconvCharacterSet | ) |
Check db charset
Definition at line 379 of file ezconvertdbcharset.php.
| checkDBDriver | ( | ) |
Check db driver
Definition at line 357 of file ezconvertdbcharset.php.
| checkDBExtraConditions | ( | ) |
DB specific checks. A string is returned for error conditions (script halts after printing it)
Definition at line 409 of file ezconvertdbcharset.php.
| 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
Definition at line 426 of file ezconvertdbcharset.php.
| convertArray | ( | $ | array, |
| $ | inCharset, | ||
| $ | outCharset | ||
| ) |
Definition at line 819 of file ezconvertdbcharset.php.
Referenced by convertSerializedData().
| convertCustomXMLData | ( | $ | tableInfoList | ) |
Definition at line 899 of file ezconvertdbcharset.php.
| convertSerializedData | ( | $ | serializedDataInfo | ) |
Logic:
Definition at line 710 of file ezconvertdbcharset.php.
| convertXMLCustomDataProgress | ( | $ | row | ) |
Definition at line 971 of file ezconvertdbcharset.php.
| 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.
Definition at line 992 of file ezconvertdbcharset.php.
| convertXMLDatatypeProgress | ( | $ | row | ) |
Definition at line 939 of file ezconvertdbcharset.php.
| convertXMLDatatypes | ( | $ | tableInfoList | ) |
Definition at line 889 of file ezconvertdbcharset.php.
| createBLOBColumnMYSQL | ( | $ | tableInfo | ) |
Definition at line 859 of file ezconvertdbcharset.php.
| createBLOBColumnORACLE | ( | $ | tableInfo | ) |
Definition at line 872 of file ezconvertdbcharset.php.
| createBLOBColumnPOSTGRESQL | ( | $ | tableInfo | ) |
Definition at line 866 of file ezconvertdbcharset.php.
| createContentClassAttributeTempTable | ( | ) |
Definition at line 523 of file ezconvertdbcharset.php.
| dropBLOBColumn | ( | $ | tableInfo | ) |
Definition at line 879 of file ezconvertdbcharset.php.
| dropBLOBColumns | ( | $ | serializedDataInfo | ) |
Definition at line 806 of file ezconvertdbcharset.php.
| dropContentClassAttributeTempTable | ( | ) |
Definition at line 531 of file ezconvertdbcharset.php.
| eZExecuteShellCommand | ( | $ | command, |
| $ | errMessage = '', |
||
| $ | retry = true, |
||
| $ | ignore = false |
||
| ) |
Definition at line 160 of file ezconvertdbcharset.php.
Referenced by changeDBCharsetORACLE().
| eZGetUserInput | ( | $ | prompt | ) |
prompt user to choose what to do next
Definition at line 150 of file ezconvertdbcharset.php.
Referenced by changeDBCharsetORACLE(), and checkDBExtraConditionsORACLE().
| parseCustomSerializedDataOption | ( | $ | serializedCustomDataOption | ) |
process custom xml data info
false or an array of table infos. Definition at line 296 of file ezconvertdbcharset.php.
| parseCustomXMLDataOption | ( | $ | xmlCustomDataOption | ) |
process custom xml data info false of an array of table infos.
Definition at line 260 of file ezconvertdbcharset.php.
| parseXMLAttributesOption | ( | $ | xmlAttributesOption | ) |
process xml attributes info
false or an array of table infos. Definition at line 217 of file ezconvertdbcharset.php.
| 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
Definition at line 981 of file ezconvertdbcharset.php.
Referenced by convertXMLData().
| restoreSerializedData | ( | $ | serializedDataInfo | ) |
Restore data from binary column
Definition at line 788 of file ezconvertdbcharset.php.
| serializeContentClassAttributeNames | ( | ) |
Definition at line 589 of file ezconvertdbcharset.php.
| serializeContentClassNames | ( | ) |
Definition at line 575 of file ezconvertdbcharset.php.
| serializeNames | ( | $ | selectSQL, |
| $ | storeToTable | ||
| ) |
Definition at line 598 of file ezconvertdbcharset.php.
| showError | ( | $ | message, |
| $ | addEOL = true, |
||
| $ | bailOut = true |
||
| ) |
Definition at line 103 of file ezconvertdbcharset.php.
Referenced by changeDBCharset(), changeDBCharsetORACLE(), checkDir(), checkSiteaccess(), convertSerializedData(), downloadPackages(), installPackages(), parseCustomSerializedDataOption(), parseCustomXMLDataOption(), and parseXMLAttributesOption().
| showMessage | ( | $ | message, |
| $ | addEOL = true |
||
| ) |
Definition at line 128 of file ezconvertdbcharset.php.
Referenced by downloadPackages(), and showPackageActions().
| showMessage2 | ( | $ | message, |
| $ | addEOL = true |
||
| ) |
Definition at line 134 of file ezconvertdbcharset.php.
Referenced by downloadPackages(), installPackages(), and updateINI_1_2_0().
| showMessage3 | ( | $ | message, |
| $ | addEOL = true |
||
| ) |
Definition at line 140 of file ezconvertdbcharset.php.
Referenced by changeDBCharsetORACLE(), checkDBCharset(), checkDBExtraConditionsORACLE(), convertSerializedData(), and convertXMLDatatypes().
| showNotice | ( | $ | message, |
| $ | addEOL = true |
||
| ) |
Definition at line 122 of file ezconvertdbcharset.php.
| showWarning | ( | $ | message, |
| $ | addEOL = true |
||
| ) |
Definition at line 116 of file ezconvertdbcharset.php.
Referenced by changeDBCharsetORACLE(), checkDBExtraConditionsORACLE(), convertXMLData(), and handlePackageError().
| storeSerializedName | ( | $ | serializedName, |
| $ | id, | ||
| $ | version, | ||
| $ | table | ||
| ) |
Definition at line 681 of file ezconvertdbcharset.php.
| unserializeContentClassAttributeNames | ( | ) |
Definition at line 538 of file ezconvertdbcharset.php.
| xmlCustomDataSelectSQL | ( | $ | dataTableInfo | ) |
Definition at line 944 of file ezconvertdbcharset.php.
| xmlCustomDataUpdateSQL | ( | $ | dataTableInfo, |
| $ | row | ||
| ) |
Definition at line 957 of file ezconvertdbcharset.php.
| xmlDatatypeSelectSQL | ( | $ | dataTableInfo | ) |
Definition at line 909 of file ezconvertdbcharset.php.
| xmlDatatypeUpdateSQL | ( | $ | dataTableInfo, |
| $ | row | ||
| ) |
Definition at line 924 of file ezconvertdbcharset.php.
| $cli = eZCLI::instance() |
Definition at line 1508 of file ezconvertdbcharset.php.
| $collation = $options['collation'] ? $options['collation'] : 'utf8_general_ci' |
Definition at line 1597 of file ezconvertdbcharset.php.
Referenced by changeDBCharset().
| $db = eZDB::instance() |
Definition at line 1543 of file ezconvertdbcharset.php.
| $eZDir = getcwd() |
Definition at line 1506 of file ezconvertdbcharset.php.
Referenced by changeDBCharsetORACLE(), and showError().
| if (CommandLineArguments::logFilename()!==false) $iconvCharacterSet = "iconv-character-set"] : false |
Definition at line 1566 of file ezconvertdbcharset.php.
Referenced by checkDBCharset().
| if (!$db->isConnected()) if (!checkDBDriver()) $logFilename = $options['log-filename'] ? $options['log-filename'] : false |
Definition at line 1557 of file ezconvertdbcharset.php.
| $options |
$script->getOptions( "[extra-xml-attributes:][extra-xml-data:][extra-serialized-data:][collation:][skip-class-translations][iconv-character-set:][log-filename:]", "", array( 'extra-xml-attributes' => "specify custom attributes which store its data in xml.\n" . "usage: <datatype_string>[.<table>.<field>][,<datatype_string>.<table>.<field>...].\n" . "default table is 'ezcontentobject_attribute', default data field is 'data_text'\n" . "note: your custom table must have 'id', 'version' and 'data_type_string' fields.", 'extra-xml-data' => "specify custom xml data.\n" . "usage: <table>.<field>[,<table>.<field>...].\n" . "note: your custom table must have 'id' field.", 'extra-serialized-data' => "specify custom serialized data.\n" . "usage: <table>.<field>;<key_field1>[.<key_field2>....][,<table>.<field>...].\n" . "ex: mytable.data_text;id.version,mytable2.data;id", 'collation' => "specify collation for converted db. default is 'utf8_general_ci'", 'skip-class-translations' => "Content class translations were added in eZ Publish 3.9. Use this options if upgrading from early version.", 'iconv-character-set' => 'This setting is used when characters are converted by iconv(). This settings is typically needed when a character set is not called the same by the database and iconv. An example is "windows-1252" (iconv) and "iso-8859-1" (mysql 5)', 'log-filename' => 'Specify a file where iconv conversions will be logged to' ), false, array( 'user' => true ) )
Definition at line 1517 of file ezconvertdbcharset.php.
eZScript::instance( array( 'description' => ( "Changes your eZ Publish database tables to use UTF8" ), 'use-session' => false, 'use-modules' => false, 'use-extensions' => true ) )
Definition at line 1510 of file ezconvertdbcharset.php.
| $serializedCustomDataOption = $options['extra-serialized-data'] ? $options['extra-serialized-data'] : '' |
Definition at line 1640 of file ezconvertdbcharset.php.
Referenced by parseCustomSerializedDataOption().
| $serializedDataInfo = parseCustomSerializedDataOption( $serializedCustomDataOption ) |
Definition at line 1641 of file ezconvertdbcharset.php.
Referenced by convertSerializedData(), parseCustomSerializedDataOption(), and restoreSerializedData().
| $skipClassTranslations = "skip-class-translations"] |
Definition at line 1596 of file ezconvertdbcharset.php.
| $xmlAttributesInfo = parseXMLAttributesOption( $xmlAttributesOption ) |
Definition at line 1623 of file ezconvertdbcharset.php.
Referenced by parseXMLAttributesOption().
| $xmlAttributesOption = $options['extra-xml-attributes'] ? $options['extra-xml-attributes'] : '' |
Definition at line 1602 of file ezconvertdbcharset.php.
Referenced by parseXMLAttributesOption().
| $xmlCustomDataInfo = parseCustomXMLDataOption( $xmlCustomDataOption ) |
Definition at line 1634 of file ezconvertdbcharset.php.
Referenced by parseCustomXMLDataOption().
| if ($xmlAttributesInfo &&count($xmlAttributesInfo)==0) $xmlCustomDataOption = $options['extra-xml-data'] ? $options['extra-xml-data'] : '' |
Definition at line 1633 of file ezconvertdbcharset.php.
Referenced by parseCustomXMLDataOption().
| for($i=0;$i > 0;$i--) |
Definition at line 1588 of file ezconvertdbcharset.php.
| $db InputTextCodec = null |
Definition at line 1541 of file ezconvertdbcharset.php.
Referenced by eZMySQLiDB\arrayQuery(), eZMySQLDB\arrayQuery(), eZDBInterface\eZDBInterface(), eZMySQLiDB\query(), and eZMySQLDB\query().
| $db OutputTextCodec = null |
Definition at line 1540 of file ezconvertdbcharset.php.
Referenced by eZMySQLiDB\arrayQuery(), eZMySQLDB\arrayQuery(), eZDBInterface\eZDBInterface(), eZMySQLiDB\query(), and eZMySQLDB\query().