eZ Publish  [trunk]
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 157 of file ezsqlinsertschema.php.


Variable Documentation

$cli = eZCLI::instance()

Definition at line 14 of file ezsqlinsertschema.php.

$db
Initial value:

Definition at line 189 of file ezsqlinsertschema.php.

$dbSchema = eZDbSchema::instance( $schemaArray )

Definition at line 270 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 129 of file ezsqlinsertschema.php.

$host = $options['host']

Definition at line 53 of file ezsqlinsertschema.php.

$includeData = false

Definition at line 63 of file ezsqlinsertschema.php.

$includeSchema = true

Definition at line 62 of file ezsqlinsertschema.php.

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

Definition at line 99 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 database",
                                       'user' => "User for login to database",
                                       'password' => "Password to use when connecting to database",
                                       'port' => 'Port to connect to database',
                                       'socket' => 'Socket to connect to match and database (only for MySQL)',
                                       'table-type' => ( "The table storage type to use 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 importing data structures, is only required when importing a schema',
                                       'allow-multi-insert' => ( 'Will create INSERT statements with multiple data entries (applies to data import only)' . "\n" .
                                                                 'Multi-inserts will only be created for databases that support it' ),
                                       'insert-types' => ( "A comma separated list of types to import (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 24 of file ezsqlinsertschema.php.

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

Definition at line 181 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(), 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(), eZPackage\dependencyItems(), eZSimpleShippingType\execute(), eZWaitUntilDateType\execute(), eZApproveType\execute(), eZStaticCache\executeActions(), eZModuleOperationInfo\executeBody(), eZContentCache\exists(), eZPDFTable\extractFunction(), eZTemplateNodeTool\extractNodes(), eZPDFTable\extractParameters(), eZTemplateArrayOperator\extractTrans(), eZAppendWarningItem(), eZCollaborationItemHandler\eZCollaborationItemHandler(), eZDBInterface\eZDBInterface(), eZMySQLDB\eZMySQLDB(), eZMySQLiDB\eZMySQLiDB(), eZNullDB\eZNullDB(), eZPackage\eZPackage(), eZPackageHandler\eZPackageHandler(), eZPostgreSQLDB\eZPostgreSQLDB(), eZSiteInstaller\eZSiteInstaller(), eZSOAPRequest\eZSOAPRequest(), eZTemplateCompiledLoop\eZTemplateCompiledLoop(), eZContentFunctionCollection\fetchContentSearch(), eZPackage\fetchFromFile(), eZCollaborationItemMessageLink\fetchItemCount(), eZCollaborationItemMessageLink\fetchItemList(), eZURLFunctionCollection\fetchList(), eZTrigger\fetchList(), eZURL\fetchList(), eZCollaborationItem\fetchList(), eZContentClassAttribute\fetchList(), eZContentObjectTreeNode\fetchList(), eZURLFunctionCollection\fetchListCount(), eZURL\fetchListCount(), eZCollaborationItem\fetchListCount(), eZCollaborationItem\fetchListTool(), eZUser\fetchLoggedInList(), eZURLObjectLink\fetchObjectVersionList(), eZPackage\fetchPackages(), eZCollaborationItemParticipantLink\fetchParticipantList(), eZCollaborationItemParticipantLink\fetchParticipantMap(), eZSearchFunctionCollection\fetchSearchList(), eZTemplateExecuteOperator\fetchTransform(), eZExtension\findExtensionType(), eZModule\forward(), 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(), eZTemplateTextOperator\indentTransformation(), eZImageObject\initializeAxis(), eZStepCreateSites\initializePackage(), eZURLOperator\iniTrans(), eZFilePackageHandler\install(), eZDBPackageHandler\install(), eZExtensionPackageHandler\install(), eZContentObjectPackageHandler\installFetchAliases(), eZContentObjectPackageHandler\installOverrides(), eZTemplateTypeOperator\isTransform(), eZCollaborationGroup\itemCount(), eZCollaborationGroup\itemList(), eZTemplateLocaleOperator\l10nTransformation(), loadDatabaseSchema(), eZTemplateLogicOperator\logicalComparisonTransformation(), eZContentOperationCollection\loopNodeAssignment(), 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(), eZGIFImageAnalyzer\process(), eZEXIFImageAnalyzer\process(), eZTemplateBlockFunction\process(), eZTemplateSetFunction\process(), eZTemplateDebugFunction\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(), eZTemplateMenuFunction\templateNodeTransformation(), eZTemplateToolbarFunction\templateNodeTransformation(), eZTemplateCacheFunction\templateNodeTransformation(), eZTemplateIncludeFunction\templateNodeTransformation(), eZTemplateWhileFunction\templateNodeTransformation(), eZTemplateDoFunction\templateNodeTransformation(), eZTemplateIfFunction\templateNodeTransformation(), eZTemplateSetFunction\templateNodeTransformation(), eZTemplateForFunction\templateNodeTransformation(), eZTemplateDefFunction\templateNodeTransformation(), eZTemplateForeachFunction\templateNodeTransformation(), eZTemplateSequenceFunction\templateNodeTransformation(), eZTemplateBlockFunction\templateNodeTransformation(), eZTemplateSectionFunction\templateNodeTransformation(), eZTemplateDebugFunction\templateNodeTransformation(), eZTemplateSwitchFunction\templateNodeTransformation(), testPHPIni(), eZPHPCreator\thisVariableText(), eZTemplateLogicOperator\trueFalseTransformation(), updateINI_1_2_0(), eZPersistentObject\updateObjectList(), eZContentUpload\upload(), eZURLOperator\urlTransformation(), eZContentObject\validateInput(), eZObjectRelationListType\validateObjectAttributeHTTPInput(), 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 56 of file ezsqlinsertschema.php.

$port = $options['port']

Definition at line 57 of file ezsqlinsertschema.php.

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

Definition at line 219 of file ezsqlinsertschema.php.

Referenced by eZStepCreateSites\initializePackage().

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 251 of file ezsqlinsertschema.php.

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

Definition at line 269 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 15 of file ezsqlinsertschema.php.

$socket = $options['socket']

Definition at line 55 of file ezsqlinsertschema.php.

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

Definition at line 279 of file ezsqlinsertschema.php.

Referenced by eZISBN10To13Converter\addAllClasses(), eZISBN10To13Converter\addAttribute(), eZISBN10To13Converter\addClass(), eZWorkflowProcess\advance(), eZImageManager\analyzeImage(), ezpRestOauthAuthenticationStyle\authenticate(), eZContentOperationCollection\changeTranslationAvailableStatus(), eZApproveType\checkApproveCollaboration(), eZMySQLiDB\checkCharsetPriv(), eZMySQLDB\checkCharsetPriv(), ezpContentPublishingQueueProcessor\childSignalHandler(), eZContentObjectVersion\cloneVersion(), eZMySQLDB\connect(), eZMySQLiDB\connect(), eZWebDAVFileServer\copy(), copyDir(), eZContentObject\copyVersion(), eZCollaborationItem\create(), eZCurrencyData\create(), eZContentObject\createNewVersion(), eZContentObject\createNewVersionIn(), delDir(), eZWebDAVFileServer\delete(), ezpRestAuthController\doOauthRequired(), eZModuleOperationInfo\executeBody(), eZModuleOperationInfo\executeTrigger(), Cezpdf\ezInsertMode(), Cezpdf\ezPRVTaddPageNumbers(), eZRSSExportItem\fetch(), eZRSSImport\fetch(), eZRSSExport\fetch(), eZShopFunctionCollection\fetchCurrencyList(), eZRSSExportItem\fetchFilteredList(), eZWorkflowProcess\fetchForStatus(), eZContentObjectVersion\fetchForUser(), eZCollaborationFunctionCollection\fetchItemCount(), eZCollaborationFunctionCollection\fetchItemList(), eZRSSExport\fetchItems(), eZRSSImport\fetchList(), eZContentFunctionCollection\fetchObjectCountByUserID(), eZContentObject\fetchObjectCountByUserID(), eZSectionFunctionCollection\fetchObjectList(), eZSectionFunctionCollection\fetchObjectListCount(), eZOrderStatusHistory\fetchOrderStatusName(), ezpContentPublishingProcess\fetchProcesses(), eZISBN13\formatedISBNValue(), eZSubTreeHandler\handle(), eZCollaborationNotificationHandler\handle(), eZWebDAVServer\handle(), eZApproveCollaborationHandler\handleCustomAction(), eZContentUpload\handleLocalFile(), eZContentUpload\handleUpload(), eZStepCreateSites\initializePackage(), 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(), eZFile\rename(), ezpNativeUserAuthFilter\run(), ezpOauthFilter\run(), eZModule\runHooks(), eZModule\setRedirectStatus(), eZCurrencyData\setStatus(), eZOrder\setStatus(), eZContentOperationCollection\setVersionStatus(), eZOrder\statusModificationList(), eZWorkflowType\statusName(), eZWorkflow\statusName(), eZCurrencyData\statusStringToNumeric(), testPHPIni(), eZApproveCollaborationHandler\unreadMessageCount(), eZContentObjectVersion\unserialize(), eZContentObject\validateInput(), eZISBNType\validateISBN13Checksum(), eZISBNType\validateObjectAttributeHTTPInput(), and eZObjectRelationListType\validateObjectAttributeHTTPInput().

$type = $options['type']

Definition at line 52 of file ezsqlinsertschema.php.

$user = $options['user']

Definition at line 54 of file ezsqlinsertschema.php.