本文整理汇总了PHP中eZScript类的典型用法代码示例。如果您正苦于以下问题:PHP eZScript类的具体用法?PHP eZScript怎么用?PHP eZScript使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了eZScript类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->cli = new \QuestionInteractiveCli();
$this->script = \eZScript::instance( array(
'description' => "Debug (auto)login",
'use-modules' => true,
'use-extensions' => true,
'debug-output' => false,
) );
$this->script->startup();
$this->script->initialize();
$this->options = $this->script->getOptions( "[type:][nlt:][frq:]", array(
'type' => 'Type of action (login|autologin)',
'nlt' => 'Newsletter type [news|education]',
'frq' => 'Frequency [daily|ẁeekly|monthly]'
) );
$clusterDomains = \eZINI::instance( 'merck.ini' )->variable( 'DomainMappingSettings', 'ClusterDomains' );
$this->domains = array_flip( $clusterDomains );
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:21,代码来源:debugLogin.php
示例2: array
#!/usr/bin/env php
<?php
/**
* Trash purge script
*
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://ez.no/Resources/Software/Licenses/eZ-Business-Use-License-Agreement-eZ-BUL-Version-2.1 eZ Business Use License Agreement eZ BUL Version 2.1
* @version 4.7.0
* @package kernel
*/
require 'autoload.php';
$script = eZScript::instance(array('description' => "Empty eZ Publish trash.\n" . "Permanently deletes all objects in the trash.\n" . "\n" . "./bin/php/trashpurge.php", 'use-session' => false, 'use-modules' => false, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[iteration-sleep:][iteration-limit:][memory-monitoring]", "", array('iteration-sleep' => 'Amount of seconds to sleep between each iteration when performing a purge operation, can be a float. Default is one second.', 'iteration-limit' => 'Amount of items to remove in each iteration when performing a purge operation. Default is 100.', 'memory-monitoring' => 'If set, memory usage will be logged in var/log/trashpurge.log.'));
$script->initialize();
$script->setIterationData('.', '~');
$purgeHandler = new eZScriptTrashPurge(eZCLI::instance(), false, (bool) $options['memory-monitoring'], $script);
if ($purgeHandler->run($options['iteration-limit'] ? (int) $options['iteration-limit'] : null, $options['iteration-sleep'] ? (int) $options['iteration-sleep'] : null)) {
$script->shutdown();
} else {
$script->shutdown(1);
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:22,代码来源:trashpurge.php
示例3: array
#!/usr/bin/env php
<?php
/**
* File containing the checkdbfiles.php script.
*
* @deprecated and unmaintained since 5.0
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
* @version 2014.11.1
* @package kernel
*/
require_once 'autoload.php';
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "eZ Publish DB file verifier\n\n" . "Checks the database update files and gives a report on them.\n" . "It will show which files are missing and which should not be present.\n" . "\n" . "For each file with problems it will output a status and the filepath\n" . "The status will be one of these:\n" . " '?' file is not defined in upgrade path\n" . " '!' file defined in upgrade path but missing on filesystem\n" . " 'A' file is present in working copy but not in the original stable branch\n" . " 'C' file data conflicts with the original stable branch\n" . "\n" . "Example output:\n" . " checkdbfiles.php\n" . " ? update/database/mysql/3.5/dbupdate-3.5.0-to-3.5.1.sql", 'use-session' => false, 'use-modules' => false, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[no-verify-branches][export-path:]", "", array('no-verify-branches' => "Do not verify the content of the files with previous branches (To avoid SVN usage)", 'export-path' => "Directory to use for doing SVN exports."));
$script->initialize();
$dbTypes = array();
$dbTypes[] = 'mysql';
$dbTypes[] = 'postgresql';
$branches = array();
$branches[] = '4.1';
$branches[] = '4.2';
$branches[] = '4.3';
$branches[] = '4.4';
// Controls the lowest version which will be exported and verified against current data
$lowestExportVersion = '4.3';
/********************************************************
*** NOTE: The following arrays do not follow the
*** coding standard, the reason for this is
*** to make it easy to merge any changes between
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:31,代码来源:checkdbfiles.php
示例4: array
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
* @version //autogentag//
* @package
*/
/**
* This script starts parallel publishing processes in order to trigger lock wait timeouts
* Launch it using $./bin/php/ezexec.phhp contentwaittimeout.php
*
* To customize the class, parent node or concurrency level, modify the 3 variables below.
* @package tests
*/
require_once 'autoload.php';
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "eZ Publish Parallel publishing benchmark", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[b:|batches-count:][c:|content-class:][l:|concurrency-level:][p:|parent-node:][g|generate-content]", "", array('content-class' => "Identifier of the content class used for testing [default: article]", 'concurrency-level' => "Parallel processes to use [default: 20]", 'generate-content' => "Wether content should be generated or not (not fully supported yet) [default: off]", 'parent-node' => "Container content should be created in [default: 2]", 'batches-count' => "How many times a concurrent batch should be started [default: 1]"));
$sys = eZSys::instance();
$script->initialize();
$optParentNode = 2;
$optContentClass = 'article';
$optConcurrencyLevel = 20;
$optGenerateContent = false;
$optQuiet = false;
$optBatchesCount = 1;
if ($options['content-class']) {
$optContentClass = $options['content-class'];
}
if ($options['batches-count']) {
$optBatchesCount = $options['batches-count'];
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:ezpublishingbenchmark.php
示例5: foreach
{
global $cli, $fileHandler;
$cli->output("Exporting files from database:");
$filePathList = $fileHandler->getFileList($excludeScopes, true);
foreach ($filePathList as $filePath) {
$cli->output("- " . $filePath);
eZDir::mkdir(dirname($filePath), false, true);
$fileHandler->fileFetch($filePath);
if ($remove) {
$fileHandler->fileDelete($filePath);
}
}
$cli->output();
}
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "eZ Publish (un)clusterize\n" . "Script for moving var_dir files from " . "filesystem to database and vice versa\n" . "\n" . "./bin/php/clusterize.php", 'use-session' => false, 'use-modules' => false, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[u][skip-binary-files][skip-media-files][skip-images][r][n]", "", array('u' => 'Unclusterize', 'skip-binary-files' => 'Skip copying binary files', 'skip-media-files' => 'Skip copying media files', 'skip-images' => 'Skip copying images', 'r' => 'Remove files after copying', 'n' => 'Do not wait'));
$script->initialize();
$clusterize = !isset($options['u']);
$remove = isset($options['r']);
$copyFiles = !isset($options['skip-binary-files']);
$copyMedia = !isset($options['skip-media-files']);
$copyImages = !isset($options['skip-images']);
$wait = !isset($options['n']);
if ($wait) {
$warningMsg = sprintf("This script will now %s your files and/or images %s database.", $remove ? "move" : "copy", $clusterize ? 'to' : 'from');
$cli->warning($warningMsg);
$cli->warning("You have 10 seconds to break the script (press Ctrl-C).");
sleep(10);
}
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:31,代码来源:clusterize.php
示例6: array
#!/usr/bin/env php
<?php
/**
* File containing the ezsqldumpschema.php script.
*
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version 2012.8
* @package kernel
*/
require 'autoload.php';
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "eZ Publish SQL Schema dump\n\n" . "Dump sql schema to specified file or standard output\n" . "ezsqldumpschema.php --type=mysql --user=root stable33 schema.sql", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[type:][user:][host:][password;][port:][socket:][output-array][output-serialized][output-sql]" . "[diff-friendly][meta-data][table-type:][table-charset:][compatible-sql][no-sort]" . "[format:]" . "[output-types:][allow-multi-insert][schema-file:]", "[database][filename]", array('type' => "Which database type to use for source, can be one of:\n" . "mysql, postgresql, oracle", '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)', 'output-array' => 'Create file with array structures (Human readable)', 'output-serialized' => 'Create file with serialized data (Saves space)', 'output-sql' => 'Create file with SQL data (DB friendly)', 'compatible-sql' => 'Will turn SQL to be more compatible to existing dumps', 'no-sort' => 'Do not sort table columns in the dumped data structure', 'table-type' => "The table storage type to use for SQL output when creating tables.\n" . "MySQL: bdb, innodb and myisam\n" . "PostgreSQL: \n" . "Oracle: ", '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', 'format' => "The output format (default is generic)\n" . "generic - Format which suits all databases\n" . "local - Format which suits only the database it was dumped from.", 'meta-data' => 'Will include extra meta-data information specific to the database.', 'diff-friendly' => 'Will make the output friendlier towards the diff command (applies to SQL output only)', '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', 'output-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"));
$script->initialize();
$type = $options['type'];
$host = $options['host'];
$user = $options['user'];
$port = $options['port'];
$socket = $options['socket'];
$password = $options['password'];
if (!is_string($password)) {
$password = '';
}
switch (count($options['arguments'])) {
case 0:
$cli->error("Missing match database and/or filename");
$script->shutdown(1);
break;
case 1:
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:31,代码来源:ezsqldumpschema.php
示例7: set_time_limit
#!/usr/bin/env php
<?php
/**
* File containing the upgrade script to fix older occurrences of link items
* not being present in the ezurl_object_table for all versions/translations.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
*/
require 'autoload.php';
set_time_limit(0);
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "Fix older occurrences of link items in XML-blocks, where they might not be\n" . "linked correctly for all versions/translations. This script will update\n" . "these references for existing entries. Note that URLs which have been lost\n" . "already will not be restored in this process, these need to be re-entered.\n" . "\n" . "fixezurlobjectlink.php", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true));
$config = "[fix][fetch-limit:]";
$argConfig = "";
$optionHelp = array("fix" => "Fix missing ezurl-object-link references. This will make sure that URLs\n" . "created with older versions, will not be lost, when older\nversions/translations are removed.", "fetch-limit" => "The number of attributes to fetch in one chunk. Default value is 200,\nthe limit must be higher than 1.");
$arguments = false;
$useStandardOptions = true;
$script->startup();
$options = $script->getOptions($config, $argConfig, $optionHelp, $arguments, $useStandardOptions);
$script->initialize();
$script->setIterationData('.', '+');
$linkUpdate = new ezpUrlObjectLinkUpdate($cli, $script, $options);
$cli->output($cli->stylize('red', "Found ") . $cli->stylize('green', $linkUpdate->xmlTextContentObjectAttributeCount()) . $cli->stylize('red', " occurrences of 'ezxmltext'."));
$cli->output();
$cli->output("Starting to process content object attributes.");
$cli->output("Fetch limit: " . $cli->stylize('green', $linkUpdate->fetchLimit));
$cli->output();
$linkUpdate->processData();
$cli->output();
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:fixezurlobjectlinks.php
示例8: __destruct
public function __destruct()
{
if (self::$script instanceof eZScript) {
self::$script->shutdown(0);
}
}
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:6,代码来源:ezptestsuite.php
示例9: array
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of version 2.0 of the GNU General
// Public License along with this program; if not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301, USA.
//
//
// ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
//
/*! \file
*/
require 'autoload.php';
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "eZ Publish CSV export script\n" . "\n" . "ezcsvexport.php --storage-dir=export 2", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true, 'user' => true));
$script->startup();
$options = $script->getOptions("[storage-dir:]", "[node]", array('storage-dir' => 'directory to place exported files in'), false, array('user' => true));
$script->initialize();
if (count($options['arguments']) < 1) {
$cli->error('Specify a node to export');
$script->shutdown(1);
}
$nodeID = $options['arguments'][0];
if (!is_numeric($nodeID)) {
$cli->error('Specify a numeric node ID');
$script->shutdown(2);
}
if ($options['storage-dir']) {
$storageDir = $options['storage-dir'];
} else {
开发者ID:runelangseid,项目名称:ezpublish,代码行数:31,代码来源:ezcsvexport.php
示例10: array
* @license http://ez.no/Resources/Software/Licenses/eZ-Business-Use-License-Agreement-eZ-BUL-Version-2.1 eZ Business Use License Agreement eZ BUL Version 2.1
* @version 4.7.0
* @package kernel
*/
/**
* This script updates the different ranges used by the ISBN standard to
* calculate the length of Registration group, Registrant and Publication element
*
* It gets the values from xml file normally provided by International ISBN Agency
* http://www.isbn-international.org/agency?rmxml=1
*/
require 'autoload.php';
$url = '';
// http://www.isbn-international.org/agency?rmxml=1 url with the xml.
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "eZ Publish ISBN-13 update\n\n" . "Update the database with new updated ISBN data to the database.", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[url:][db-host:][db-user:][db-password:][db-database:][db-driver:]", "", array('url' => "URL containing the xml file for the different ranges", 'db-host' => "Database host.", 'db-user' => "Database user.", 'db-password' => "Database password.", 'db-database' => "Database name.", 'db-driver' => "Database driver."));
$script->initialize();
if (isset($options['url'])) {
$url = $options['url'];
} else {
$cli->error('Error: you need to specify a url to the xml file containing the ranges');
$script->shutdown(1);
}
$db = eZDB::instance();
if (!$db->IsConnected) {
// default settings are not valid
// try user-defined settings
$dbUser = $options['db-user'] ? $options['db-user'] : false;
$dbPassword = $options['db-password'] ? $options['db-password'] : false;
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:updateisbn13.php
示例11: array
#!/usr/bin/env php
<?php
/**
* File containing the script to cleanup files in a DFS setup
*
* @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
* @package
*/
require_once 'autoload.php';
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "Script for checking database and DFS file consistency", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[S][B][D][path:][iteration-limit:]", "", array("D" => "Delete nonexistent files", "S" => "Check files on DFS share against files in the database", "B" => "Checks files in database against files on DFS share", "path" => "Path to limit checks to (e.g.: var/storage/content - Default: var/)", "iteration-limit" => "Amount of items to remove in each iteration when performing a purge operation. Default is all in one iteration."));
$script->initialize();
$fileHandler = eZClusterFileHandler::instance();
if (!$fileHandler instanceof eZDFSFileHandler) {
$cli->error("Your installation does not use DFS clustering.");
$script->shutdown(2);
}
$delete = isset($options['D']);
$checkBase = isset($options['S']);
$checkDFS = isset($options['B']);
if (isset($options['path'])) {
$checkPath = trim($options['path']);
} else {
$checkPath = eZINI::instance()->variable('FileSettings', 'VarDir');
}
$optIterationLimit = isset($options['iteration-limit']) ? (int) $options['iteration-limit'] : false;
$pause = 1000;
开发者ID:nfrp,项目名称:ezpublish,代码行数:31,代码来源:dfscleanup.php
示例12: array
#!/usr/bin/env php
<?php
/**
* File containing the section identifier upgrade script.
*
* @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version 2013.11
* @package update
*/
require 'autoload.php';
$script = eZScript::instance(array('description' => 'eZ Publish section identifier update script. ' . 'This script will update existing sections with missing identifiers.', 'use-session' => false, 'use-modules' => false, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions('', '', array('-q' => 'Quiet mode'));
$script->initialize();
$cli = eZCLI::instance();
$trans = eZCharTransform::instance();
// Fetch 50 items per iteration
$limit = 50;
$offset = 0;
do {
// Fetch items with empty identifier
$rows = eZSection::fetchFilteredList(null, $offset, $limit);
if (!$rows) {
break;
}
foreach ($rows as $row) {
if ($row->attribute('identifier') == '') {
// Create a new section identifier with NAME_ID pattern
$name = $row->attribute('name');
$identifier = $trans->transformByGroup($name, 'identifier') . '_' . $row->attribute('id');
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:31,代码来源:updatesectionidentifier.php
示例13: childHandler
/**
* Signal handler
* @param int $signo Signal number
*/
function childHandler($signo)
{
switch ($signo) {
case SIGALRM:
eZScript::instance()->shutdown(1);
break;
case SIGUSR1:
eZScript::instance()->shutdown(0);
break;
case SIGCHLD:
eZScript::instance()->shutdown(1);
break;
}
}
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:18,代码来源:ezasynchronouspublisher.php
示例14: array
#!/usr/bin/env php
<?php
/**
* File containing the ezsqldiff.php script.
*
* @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version 2013.11
* @package kernel
*/
require_once 'autoload.php';
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "eZ Publish SQL diff\n\n" . "Displays differences between two database schemas,\n" . "and sets exit code based whether there is a difference or not\n" . "\n" . "ezsqldiff.php --type mysql --user=root stable32 stable33", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[source-type:][source-host:][source-user:][source-password;][source-socket:]" . "[match-type:][match-host:][match-user:][match-password;][match-socket:]" . "[t:|type:][host:][u:|user:][p:|password;][socket:]" . "[lint-check]" . "[reverse][check-only]", "[source][match]", array('source-type' => "Which database type to use for source, can be one of:\n" . "mysql, postgresql", 'source-host' => "Connect to host source database", 'source-user' => "User for login to source database", 'source-password' => "Password to use when connecting to source database", 'source-socket' => 'Socket to connect to source database (only for MySQL)', 'match-type' => "Which database type to use for match, can be one of:\n" . "mysql, postgresql", 'match-host' => "Connect to host match database", 'match-user' => "User for login to match database", 'match-password' => "Password to use when connecting to match database", 'match-socket' => 'Socket to connect to match database (only for MySQL)', 'type' => "Which database type to use for match and source, can be one of:\n" . "mysql, postgresql", 'host' => "Connect to host match and source database", 'user' => "User for login to match and source database", 'password' => "Password to use when connecting to match and source database", 'socket' => 'Socket to connect to match and source database (only for MySQL)', 'lint-check' => 'Instead of comparing 2 datase schemas, verify source database schema for standards compliance', 'reverse' => "Reverse the differences", 'check-only' => "Don't show SQLs for the differences, just set exit code and return"));
$script->initialize();
if (count($options['arguments']) < 1) {
$cli->error("Missing source database");
$script->shutdown(1);
}
if (count($options['arguments']) < 2 and !$options['lint-check']) {
$cli->error("Missing match database");
$script->shutdown(1);
}
$sourceType = $options['source-type'] ? $options['source-type'] : $options['type'];
$sourceDBHost = $options['source-host'] ? $options['source-host'] : $options['host'];
$sourceDBUser = $options['source-user'] ? $options['source-user'] : $options['user'];
$sourceDBPassword = $options['source-password'] ? $options['source-password'] : $options['password'];
$sourceDBSocket = $options['source-socket'] ? $options['source-socket'] : $options['socket'];
$sourceDB = $options['arguments'][0];
if (!is_string($sourceDBPassword)) {
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:31,代码来源:ezsqldiff.php
示例15: set_time_limit
* @version 4.7.0
* @package kernel
*/
require 'autoload.php';
set_time_limit( 0 );
$cli = eZCLI::instance();
$endl = $cli->endlineString();
$script = eZScript::instance( array( 'description' => ( "eZ Publish database cleanup.\n\n" .
"Will cleanup various data from the currently used database in eZ Publish\n" .
"\n" .
"Possible values for NAME is:\n" .
"session, expired_session, preferences, browse, tipafriend, shop, forgotpassword, workflow,\n" .
"collaboration, collectedinformation, notification, searchstats or all (for all items)\n" .
"cleanup.php -s admin session"),
'use-session' => false,
'use-modules' => true,
'use-extensions' => true ) );
$script->startup();
$options = $script->getOptions( "[db-host:][db-user:][db-password:][db-database:][db-type:|db-driver:][sql]",
"[name]",
array( 'db-host' => "Database host",
'db-user' => "Database user",
'db-password' => "Database password",
'db-database' => "Database name",
'db-driver' => "Database driver",
'db-type' => "Database driver, alias for --db-driver",
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:32,代码来源:cleanup.php
示例16: array
<?php
/**
* File containing the ${NAME} class.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
* @version 2014.11.1
*/
require_once 'autoload.php';
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "Re-creates missing references to image files in ezimagefile. See issue EZP-21324\n", 'use-session' => true, 'use-modules' => false, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[dry-run]", "", array('n' => 'Dry run'));
$optDryRun = (bool) $options['dry-run'];
$script->initialize();
$imageAttributes = eZPersistentObject::fetchObjectList(eZContentObjectAttribute::definition(), array('id', 'contentobject_id', 'version', 'data_text'), array('data_type_string' => 'ezimage'), null, null, false);
$cli->output("Re-creating missing ezcontentobject_attribute / ezimagefile references");
if ($optDryRun) {
$cli->warning("dry-run mode");
}
foreach ($imageAttributes as $imageAttribute) {
if (($doc = simplexml_load_string($imageAttribute["data_text"])) === false) {
continue;
}
// Creates ezimagefile entries
foreach ($doc->xpath("//*/@url") as $url) {
$url = (string) $url;
echo "Processing {$imageAttribute['contentobject_id']}#{$imageAttribute['version']} ({$url})\n";
if ($url === "") {
continue;
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:31,代码来源:recreateimagesreferences.php
示例17: array
<?php
/**
* Cluster files purge script
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
* @version 2014.11.1
* @package kernel
*/
require_once 'autoload.php';
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "eZ Publish cluster files purge\n" . "Physically purges files\n" . "\n" . "./bin/php/clusterpurge.php --scopes=scope1,scope2", 'use-session' => false, 'use-modules' => false, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[dry-run][iteration-sleep:][iteration-limit:][memory-monitoring][scopes:][expiry:]", "", array('dry-run' => 'Test mode, output the list of affected files without removing them', 'iteration-sleep' => 'Amount of seconds to sleep between each iteration when performing a purge operation, can be a float. Default is one second.', 'iteration-limit' => 'Amount of items to remove in each iteration when performing a purge operation. Default is 100.', 'memory-monitoring' => 'Generates memory monitoring output. If set, memory usage will be logged in var/log/clusterpurge.log.', 'scopes' => 'Comma separated list of file types to purge. Possible values are: classattridentifiers, classidentifiers, content, expirycache, statelimitations, user-info-cache, viewcache, wildcard-cache-index, image, binaryfile, media.', 'expiry' => 'Number of days since the file was expired. Only files older than this will be purged. Default is 30, minimum is 1.'));
$sys = eZSys::instance();
$script->initialize();
if (!eZScriptClusterPurge::isRequired()) {
$cli->error("Your current cluster handler does not require files purge");
$script->shutdown(1);
}
$purgeHandler = new eZScriptClusterPurge();
if ($options['dry-run']) {
$purgeHandler->optDryRun = true;
}
if ($options['iteration-sleep']) {
$purgeHandler->optIterationSleep = (int) ($options['iteration-sleep'] * 1000000);
}
if ($options['iteration-limit']) {
$purgeHandler->optIterationLimit = (int) $options['iteration-limit'];
}
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:31,代码来源:clusterpurge.php
示例18: getmypid
*
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version 2012.8
* @package kernel
* @subpackage content
*/
/**
* This script, given a queued contentobject_id + version, will resume the publishing operation on it
* @package kernel
* @subpackage content
*/
require 'autoload.php';
$pid = getmypid();
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => 'Asynchronous publishing handler, not meant to be used directly', 'use-session' => false, 'use-modules' => true, 'use-extensions' => true));
$script->startup();
$argumentConfig = '[OBJECT_ID] [VERSION_ID]';
$optionsConfig = '';
$options = $script->getOptions($optionsConfig, $argumentConfig);
$script->initialize();
if (count($options['arguments']) != 2) {
eZLog::write("Wrong arguments count", 'publishqueue.log');
$script->shutdown(1, 'wrong argument count');
}
$objectId = $options['arguments'][0];
$version = $options['arguments'][1];
eZLog::write("[{$pid}] Publishing #{$objectId}/{$version}", 'async.log');
$operationResult = eZOperationHandler::execute('content', 'publish', array('object_id' => $objectId, 'version' => $version));
if (isset($operationResult['status']) && $operationResult['status'] == eZModuleOperationInfo::STATUS_CONTINUE) {
eZLog::write("[{$pid}] Published #{$objectId}/{$version}", 'async.log');
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:31,代码来源:publish_content.php
示例19: array
/*!
\class Writesurveyschema writesurveyschema.php
\brief The class Writesurveyschema does
*/
//include_once( 'lib/ezdbschema/classes/ezdbschema.php' );
//include_once( 'lib/ezdb/classes/ezdb.php' );
//include_once( 'lib/ezutils/classes/ezcli.php' );
//include_once( 'kernel/classes/ezscript.php' );
require 'autoload.php';
$fileNameDba = 'db_data.dba';
$fileNameSql = 'cleandata.sql';
$stdOutSQL = null;
$stdOutDBA = null;
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "eZ Publish SQL Survey data dump\n\n" . "Dump sql data to file or standard output from the tables:\n" . " ezsurvey_group\n" . " ezsurvey_group_range\n" . " ezsurvey_registrant_range\n\n" . "Default is file, wich will be written to:\n" . " kernel/classes/datatypes/ezsurvey/sql/<database>/cleandata.sql\n" . " kernel/classes/datatypes/ezsurvey/share/db_data.dba\n\n" . "Script can be runned as:\n" . "php bin/php/ezsqldumpsurveydata.php --stdout-sql\n" . " --stdout-dba\n" . " --filename-sql=customname.sql\n" . " --filename-dba=customname.dba", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions("[stdout-sql][stdout-dba][filename-sql:][filename-dba:]", "", array('stdout-sql' => "Result of sql output will be printed to standard output instead of to file.", 'stdout-dba' => "Result of dba output will be printed to standard output instead of to file.", 'filename-sql' => "Custom name for the sql file. Will be stored in the directory: \n" . "kernel/classes/datatypes/ezsurvey/sql/<database>/", 'filename-dba' => "Custom name for the dba file. Will be stored in the directory: \n" . "kernel/classes/datatypes/ezsurvey/share/"));
$script->initialize();
$db = eZDB::instance();
$dbSchema = eZDbSchema::instance($db);
if (isset($options['filename-sql'])) {
$fileNameSql = $options['filename-sql'];
}
if (isset($options['filename-dba'])) {
$fileNameDba = $options['filename-dba'];
}
if (isset($options['stdout-sql']) !== null) {
$stdOutSQL = $options['stdout-sql'];
}
if (isset($options['stdout-dba']) !== null) {
开发者ID:heliopsis,项目名称:ezsurvey,代码行数:31,代码来源:ezsqldumpsurveydata.php
示例20: set_time_limit
#!/usr/bin/env php
<?php
/**
* @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
* @package kernel
*/
require_once 'autoload.php';
set_time_limit(0);
$cli = eZCLI::instance();
$script = eZScript::instance(array('debug-message' => '', 'use-session' => true, 'use-modules' => true, 'use-extensions' => true));
$script->startup();
$webOutput = $cli->isWebOutput();
function help()
{
$argv = $_SERVER['argv'];
$cli = eZCLI::instance();
$cli->output("Usage: " . $argv[0] . " [OPTION]...\n" . "eZ Publish content object name update.\n" . "Goes trough all objects and updates all content object names\n" . "\n" . "General options:\n" . " -h,--help display this help and exit \n" . " -q,--quiet do not give any output except when errors occur\n" . " -s,--siteaccess selected siteaccess for operations, if not specified default siteaccess is used\n" . " -d,--debug display debug output at end of execution\n" . " --db-host=HOST Use database host HOST\n" . " --db-user=USER Use database user USER\n" . " --db-password=PWD Use database password PWD\n" . " --db-database=DB Use database named DB\n" . " --db-driver=DRIVER Use database driver DRIVER\n" . " -c,--colors display output using ANSI colors\n" . " --sql display sql queries\n" . " --logfiles create log files\n" . " --no-logfiles do not create log files (default)\n" . " --no-colors do not use ANSI coloring (default)\n");
}
function changeSiteAccessSetting(&$siteaccess, $optionData)
{
$cli = eZCLI::instance();
if (in_array($optionData, eZINI::instance()->variable('SiteAccessSettings', 'AvailableSiteAccessList'))) {
$siteaccess = $optionData;
$cli->output("Using siteaccess {$siteaccess} for content object name update");
} else {
$cli->notice("Siteaccess {$optionData} does not exist, using default siteaccess");
}
}
$siteaccess = false;
开发者ID:nfrp,项目名称:ezpublish,代码行数:31,代码来源:updatecontentobjectname.php
注:本文中的eZScript类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编 |
请发表评论