eZ Publish  [4.2]
ezsqlinsertschema.php File Reference

Go to the source code of this file.

Functions

if(strlen(trim($type))==0) if(!$onlyCleanupSchema
and(!file_exists($filename)
or!is_file($filename))) if(strlen(trim($user))==0) 
eZTriedDatabaseString ($database, $host, $user, $password, $socket)

Variables

 $cli = eZCLI::instance()
 $db
 $dbSchema = eZDbSchema::instance( $schemaArray )
switch(count($options['arguments'])) $dbschemaParameters
 $host = $options['host']
 $includeData = false
 $includeSchema = true
if($options['insert-types']) $onlyCleanupSchema = $options['clean-existing'] && !$includeSchema && !$includeData
 $options
 $parameters
 $password = $options['password']
 $port = $options['port']
if(!is_object($db)) if(!$db
or!$db->isConnected()) 
$schemaArray = eZDbSchema::read( $filename, true )
if($includeData and!$options['schema-file'])
if($options['schema-file']) if($includeSchema
and(!isset($schemaArray['schema'])
or!$schemaArray['schema'])) if($schemaArray===false) 
$schemaArray ['type'] = $type
if($options['clean-existing']) $schemaArray ['instance'] = & $db
 $script
 $socket = $options['socket']
if($dbSchema===false) $status = ( $includeSchema or $includeData ) ? $dbSchema->insertSchema( $dbschemaParameters ) : true
 $type = $options['type']
 $user = $options['user']

Function Documentation

if (strlen(trim($type))==0) if (!$onlyCleanupSchema and(!file_exists($filename) or!is_file($filename))) if (strlen(trim($user))==0) eZTriedDatabaseString ( database,
host,
user,
password,
socket 
)

Definition at line 175 of file ezsqlinsertschema.php.


Variable Documentation

$cli = eZCLI::instance()

Definition at line 32 of file ezsqlinsertschema.php.

$db
Initial value:

Definition at line 207 of file ezsqlinsertschema.php.

$dbSchema = eZDbSchema::instance( $schemaArray )

Definition at line 288 of file ezsqlinsertschema.php.

switch (count($options['arguments'])) $dbschemaParameters
Initial value:
 array( 'schema' => $includeSchema,
                             'data' => $includeData,
                             'format' => 'local',
                             'table_type' => $options['table-type'],
                             'table_charset' => $options['table-charset'],
                             'allow_multi_insert' => $options['allow-multi-insert'] )

Definition at line 147 of file ezsqlinsertschema.php.

$host = $options['host']

Definition at line 71 of file ezsqlinsertschema.php.

$includeData = false

Definition at line 81 of file ezsqlinsertschema.php.

$includeSchema = true

Definition at line 80 of file ezsqlinsertschema.php.

if ($options['insert-types']) $onlyCleanupSchema = $options['clean-existing'] && !$includeSchema && !$includeData

Definition at line 117 of file ezsqlinsertschema.php.

$options
Initial value:
 $script->getOptions( "[type:][user:][host:][password;][port:][socket:]" .
                                "[table-type:][table-charset:]" .
                                "[insert-types:][allow-multi-insert][schema-file:][clean-existing]",
                                "[filename][database]",
                                array( 'type' => ( "Which database type to use, can be one of:\n" .
                                                   "mysql, postgresql or any other supported by extensions" ),
                                       'host' => "Connect to host source database",
                                       'user' => "User for login to source database",
                                       'password' => "Password to use when connecting to source database",
                                       'port' => 'Port to connect to source database',
                                       'socket' => 'Socket to connect to match and source database (only for MySQL)',
                                       'table-type' => ( "The table storage type to use for SQL output when creating tables.\n" .
                                                         "MySQL: bdb, innodb and myisam\n" .
                                                         "PostgreSQL: \n" .
                                                         "Oracle: " ),
                                       'clean-existing' => 'Clean up existing schema (remove all database objects)',
                                       'table-charset' => 'Defines the charset to use on tables, the names of the charset depends on database type',
                                       'schema-file' => 'The schema file to use when dumping data structures, is only required when dumping from files',
                                       'allow-multi-insert' => ( 'Will create INSERT statements with multiple data entries (applies to data output only)' . "\n" .
                                                                 'Multi-inserts will only be created for databases that support it' ),
                                       'insert-types' => ( "A comma separated list of types to include in dump (default is schema only):\n" .
                                                           "schema - Table schema\n" .
                                                           "data - Table data\n" .
                                                           "all - Both table schema and data\n" .
                                                           "none - Insert nothing (useful if you want to clean up schema only)" )
                                       ) )

Definition at line 42 of file ezsqlinsertschema.php.

$parameters
Initial value:
 array( 'server' => $host,
                     'user' => $user,
                     'password' => $password,
                     'database' => $database )

Definition at line 199 of file ezsqlinsertschema.php.

Referenced by eZInstallScriptPackageHandler\add(), eZDBPackageHandler\add(), eZFilePackageHandler\add(), eZExtensionPackageHandler\add(), eZContentClassPackageHandler\add(), eZContentObjectPackageHandler\add(), eZStaticCache\addAction(), eZPHPCreator\addCodePiece(), eZPHPCreator\addComment(), eZPHPCreator\addDefine(), eZPDFTable\addDocSpecFunction(), eZPHPCreator\addInclude(), eZPHPCreator\addMethodCall(), eZPHPCreator\addVariable(), eZPHPCreator\addVariableUnset(), eZPHPCreator\addVariableUnsetList(), eZImageManager\analyzeImage(), eZPackage\appendDependency(), eZPackage\appendInstall(), eZImageObject\appendLayer(), eZPackage\appendProvides(), eZCodeTemplate\apply(), eZTemplateArrayOperator\arrayTrans(), eZContentObjectTreeNode\availableClassListJsArray(), eZTemplateArithmeticOperator\basicTransformation(), eZTemplateCompiler\boundVariableName(), eZContentBrowse\browse(), eZContentCache\cachePathInfo(), eZImageObject\calculatePosition(), eZTemplateCompiler\calculateVariableNodeStatistics(), eZPDFTable\callFrameLine(), eZTemplateArithmeticOperator\castTransformation(), eZTemplateLogicOperator\chooseTransformation(), eZContentObject\cleanupInternalDrafts(), eZTemplateArrayOperator\compareTrans(), eZTemplateCompiler\compileTemplate(), eZTemplateTextOperator\concatTransformation(), eZTemplateControlOperator\condTransform(), eZImageManager\convert(), eZWorkflowProcess\create(), eZPackage\create(), eZNodeAssignment\create(), eZTemplateNodeTool\createAssignFromOutputVariableNode(), eZTemplateNodeTool\createCodePieceNode(), eZTemplateNodeTool\createErrorNode(), eZImageManager\createImageAlias(), eZOperationMemento\createKey(), eZWorkflowProcess\createKey(), eZTemplateNodeTool\createNamespaceChangeNode(), eZTemplateNodeTool\createNamespaceRestoreNode(), eZTemplateNodeTool\createOperatorElement(), eZTemplateNodeTool\createOutputVariableDecreaseNode(), eZTemplateNodeTool\createOutputVariableIncreaseNode(), eZHTTPTool\createRedirectUrl(), eZTemplateNodeTool\createResourceAcquisitionNode(), eZTemplateNodeTool\createSpacingDecreaseNode(), eZTemplateNodeTool\createSpacingIncreaseNode(), eZTemplateNodeTool\createVariableNode(), eZTemplateNodeTool\createVariableUnsetNode(), eZTemplateNodeTool\createWarningNode(), eZTemplateNodeTool\createWriteToOutputVariableNode(), eZModule\currentAction(), eZModule\currentRedirectionURI(), eZTemplateCompiler\currentTextName(), eZContentObjectAttribute\customHTTPAction(), eZTemplateStringOperator\customMapTransformation(), eZAuthorType\customObjectAttributeHTTPAction(), eZMultiOption2Type\customObjectAttributeHTTPAction(), eZObjectRelationType\customObjectAttributeHTTPAction(), eZObjectRelationListType\customObjectAttributeHTTPAction(), eZTemplateLocaleOperator\dateTimeTransformation(), eZTemplateArithmeticOperator\decIncTransformation(), eZCodeMapper\decodeCommand(), eZTemplateCompiler\decreaseCurrentTextName(), eZPackage\dependencyItems(), eZSimpleShippingType\execute(), eZWaitUntilDateType\execute(), eZApproveType\execute(), eZStaticCache\executeActions(), eZModuleOperationInfo\executeBody(), eZContentCache\exists(), eZPDFTable\extractFunction(), eZTemplateNodeTool\extractNodes(), eZPDFTable\extractParameters(), eZTemplateArrayOperator\extractTrans(), eZCollaborationItemHandler\eZCollaborationItemHandler(), eZDBInterface\eZDBInterface(), eZMySQLDB\eZMySQLDB(), eZMySQLiDB\eZMySQLiDB(), eZNullDB\eZNullDB(), eZPackage\eZPackage(), eZPackageHandler\eZPackageHandler(), eZPostgreSQLDB\eZPostgreSQLDB(), eZSiteInstaller\eZSiteInstaller(), eZSOAPRequest\eZSOAPRequest(), eZTemplateCompiledLoop\eZTemplateCompiledLoop(), eZPackage\fetchFromFile(), eZCollaborationItemMessageLink\fetchItemCount(), eZCollaborationItemMessageLink\fetchItemList(), eZTrigger\fetchList(), eZURL\fetchList(), eZContentClassAttribute\fetchList(), eZCollaborationItem\fetchList(), eZContentObjectTreeNode\fetchList(), eZURL\fetchListCount(), eZCollaborationItem\fetchListCount(), eZCollaborationItem\fetchListTool(), eZUser\fetchLoggedInList(), eZURLObjectLink\fetchObjectVersionList(), eZPackage\fetchPackages(), eZCollaborationItemParticipantLink\fetchParticipantList(), eZCollaborationItemParticipantLink\fetchParticipantMap(), eZTemplateExecuteOperator\fetchTransform(), eZExtension\findExtensionType(), eZModule\forward(), eZTemplateSetFunction\functionTemplateStatistics(), eZTemplateSectionFunction\functionTemplateStatistics(), eZTemplateCompiler\generatePHPCode(), eZTemplateCompiler\generatePHPCodeChildren(), eZTemplateCompiler\generateVariableDataCode(), eZTemplateLocaleOperator\getTimeTransformation(), eZImageObject\getTransparency(), eZImageObject\getTransparencyPercent(), eZCharTransform\groupCommands(), eZSubTreeHandler\handle(), eZCollaborationNotificationHandler\handle(), eZGeneralDigestHandler\handle(), eZCollaborationNotificationHandler\handleCollaborationEvent(), eZCollaborationItemHandler\handleCollaborationEvent(), eZModule\handleError(), eZURL\handleList(), eZSubTreeHandler\handlePublishEvent(), eZTemplateDigestOperator\hashTransformation(), eZMail\headers(), eZMail\headerText(), eZMail\headerTextList(), eZi18nOperator\i18nTrans(), eZTemplateCompiler\increaseCurrentTextName(), eZTemplateTextOperator\indentTransformation(), eZImageObject\initializeAxis(), eZURLOperator\iniTrans(), eZFilePackageHandler\install(), eZDBPackageHandler\install(), eZExtensionPackageHandler\install(), eZContentObjectPackageHandler\installFetchAliases(), eZContentObjectPackageHandler\installOverrides(), eZTemplateTypeOperator\isTransform(), eZCollaborationGroup\itemCount(), eZCollaborationGroup\itemList(), eZTemplateLocaleOperator\l10nTransformation(), loadDatabaseSchema(), eZTemplateLogicOperator\logicalComparisonTransformation(), eZTemplateLocaleOperator\makeDateTimeTransformation(), eZTemplateArrayOperator\mergeTrans(), eZTemplateArithmeticOperator\minMaxTransformation(), eZPDF\modify(), eZTemplateLocaleOperator\modify(), eZTemplateStringOperator\modify(), eZTemplateArithmeticOperator\modTransformation(), eZSearchLog\mostFrequentPhraseArray(), eZTemplateLogicOperator\negateTransformation(), eZTemplateNl2BrOperator\nl2brTransformation(), eZTemplateUnitOperator\operatorTransform(), eZPackage\packageRepositories(), eZPackage\parseDOMTree(), eZTemplateStringOperator\phpMapTransformation(), eZTemplatePHPOperator\phpOperatorTransformation(), eZKernelOperator\preferencesTransformation(), eZImageObject\prependLayer(), eZEXIFImageAnalyzer\process(), eZGIFImageAnalyzer\process(), eZTemplateBlockFunction\process(), eZTemplateDebugFunction\process(), eZTemplateSetFunction\process(), eZTemplateSectionFunction\process(), eZTemplateArithmeticOperator\randTransformation(), eZModule\redirect(), eZHTTPTool\redirect(), eZModule\redirectionURI(), eZModule\redirectionURIForModule(), eZModule\redirectModule(), eZModule\redirectToView(), eZContentCache\restore(), eZTemplateArithmeticOperator\romanTransformation(), eZTemplateArithmeticOperator\roundTransformation(), eZModule\run(), eZModule\runHooks(), eZTrigger\runTrigger(), eZMailNotificationTransport\send(), eZSMTPTransport\sendMail(), eZCollaborationNotificationHandler\sendMessage(), eZSubTreeHandler\sendMessage(), eZContentObjectAttribute\setInputParameters(), eZPackage\setParameters(), eZContentObjectAssignmentHandler\setupAssignments(), eZContentObjectAttribute\setValidationParameters(), eZContentCache\store(), eZCollaborationGroup\subTree(), eZTemplateSequenceFunction\templateNodeSequenceCreate(), eZObjectForwarder\templateNodeTransformation(), eZTemplateCacheFunction\templateNodeTransformation(), eZTemplateMenuFunction\templateNodeTransformation(), eZTemplateToolbarFunction\templateNodeTransformation(), eZTemplateIncludeFunction\templateNodeTransformation(), eZTemplateDoFunction\templateNodeTransformation(), eZTemplateWhileFunction\templateNodeTransformation(), eZTemplateIfFunction\templateNodeTransformation(), eZTemplateForFunction\templateNodeTransformation(), eZTemplateDefFunction\templateNodeTransformation(), eZTemplateForeachFunction\templateNodeTransformation(), eZTemplateSequenceFunction\templateNodeTransformation(), eZTemplateBlockFunction\templateNodeTransformation(), eZTemplateDebugFunction\templateNodeTransformation(), eZTemplateSwitchFunction\templateNodeTransformation(), eZTemplateSetFunction\templateNodeTransformation(), eZTemplateSectionFunction\templateNodeTransformation(), eZPHPCreator\thisVariableText(), eZTemplateLogicOperator\trueFalseTransformation(), updateINI_1_2_0(), eZPersistentObject\updateObjectList(), eZContentUpload\upload(), eZURLOperator\urlTransformation(), eZContentObject\validateInput(), eZObjectRelationListType\validateObjectAttributeHTTPInput(), eZCharTransform\varExportInternal(), eZPHPCreator\variableText(), eZContentObject\versions(), eZTemplateStringOperator\washTransformation(), eZPHPCreator\writeCodePiece(), eZPHPCreator\writeDefine(), eZPHPCreator\writeInclude(), eZPHPCreator\writeMethodCall(), eZPHPCreator\writeVariableUnset(), and eZPHPCreator\writeVariableUnsetList().

$password = $options['password']

Definition at line 74 of file ezsqlinsertschema.php.

$port = $options['port']

Definition at line 75 of file ezsqlinsertschema.php.

if (!is_object($db)) if (!$db or!$db->isConnected()) $schemaArray = eZDbSchema::read( $filename, true )

Definition at line 237 of file ezsqlinsertschema.php.

if ($includeData and!$options['schema-file']) if ($options['schema-file']) if ($includeSchema and(!isset($schemaArray['schema']) or!$schemaArray['schema'])) if ($schemaArray===false) $schemaArray['type'] = $type

Definition at line 269 of file ezsqlinsertschema.php.

if ($options['clean-existing']) $schemaArray['instance'] = & $db

Definition at line 287 of file ezsqlinsertschema.php.

Initial value:
 eZScript::instance( array( 'description' => ( "eZ Publish SQL Schema insert\n\n" .
                                                        "Insert database schema and data to specified database\n".
                                                        "ezsqlinsertschema.php --type=mysql --user=root share/db_schema.dba ezp35stable" ),
                                     'use-session' => false,
                                     'use-modules' => true,
                                     'use-extensions' => true ) )

Definition at line 33 of file ezsqlinsertschema.php.

$socket = $options['socket']

Definition at line 73 of file ezsqlinsertschema.php.

if ($dbSchema===false) $status = ( $includeSchema or $includeData ) ? $dbSchema->insertSchema( $dbschemaParameters ) : true

Definition at line 297 of file ezsqlinsertschema.php.

Referenced by eZISBN10To13Converter\addAllClasses(), eZISBN10To13Converter\addAttribute(), eZISBN10To13Converter\addClass(), eZWorkflowProcess\advance(), eZImageManager\analyzeImage(), eZApproveType\checkApproveCollaboration(), eZMySQLiDB\checkCharsetPriv(), eZMySQLDB\checkCharsetPriv(), eZContentObjectVersion\cloneVersion(), eZMySQLDB\connect(), eZMySQLiDB\connect(), eZWebDAVFileServer\copy(), copyDir(), eZContentObject\copyVersion(), eZCollaborationItem\create(), eZContentObject\createNewVersion(), eZContentObject\createNewVersionIn(), delDir(), eZWebDAVFileServer\delete(), eZModuleOperationInfo\executeBody(), eZModuleOperationInfo\executeTrigger(), Cezpdf\ezInsertMode(), Cezpdf\ezPRVTaddPageNumbers(), eZRSSExportItem\fetch(), eZRSSImport\fetch(), eZRSSExport\fetch(), eZRSSExportItem\fetchFilteredList(), eZWorkflowProcess\fetchForStatus(), eZContentObjectVersion\fetchForUser(), eZRSSExport\fetchItems(), eZRSSImport\fetchList(), eZOrderStatusHistory\fetchOrderStatusName(), eZISBN13\formatedISBNValue(), eZSubTreeHandler\handle(), eZCollaborationNotificationHandler\handle(), eZWebDAVServer\handle(), eZApproveCollaborationHandler\handleCustomAction(), eZContentUpload\handleLocalFile(), eZContentUpload\handleUpload(), eZImageType\insertHTTPFile(), eZImageType\insertRegularFile(), eZDBSchemaInterface\insertSchema(), eZScript\iterate(), eZLintSchema\lintCheckSchema(), eZTSTranslator\loadTranslationFile(), eZWebDAVFileServer\mkcol(), eZWebDAVFileServer\move(), eZWebDAVServer\outputSendDataToClient(), eZWebDAVContentBackend\performDelete(), eZWebDAVServer\processClientRequest(), eZWebDAVFileServer\put(), eZHTTPTool\redirect(), eZModule\runHooks(), eZModule\setRedirectStatus(), eZOrder\setStatus(), eZOrder\statusModificationList(), eZWorkflowType\statusName(), eZWorkflow\statusName(), eZApproveCollaborationHandler\unreadMessageCount(), eZContentObjectVersion\unserialize(), eZContentObject\validateInput(), eZISBNType\validateISBN13Checksum(), eZISBNType\validateObjectAttributeHTTPInput(), and eZObjectRelationListType\validateObjectAttributeHTTPInput().

$type = $options['type']

Definition at line 70 of file ezsqlinsertschema.php.

$user = $options['user']

Definition at line 72 of file ezsqlinsertschema.php.