本文整理汇总了PHP中Updater::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Updater::run方法的具体用法?PHP Updater::run怎么用?PHP Updater::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Updater
的用法示例。
在下文中一共展示了Updater::run方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
require_once dirname(__FILE__) . '/classes/Config.class.php';
require_once dirname(__FILE__) . '/_config.php';
require_once dirname(__FILE__) . '/classes/Mysql.class.php';
require_once dirname(__FILE__) . '/classes/Updater.class.php';
// First setup global DB connection
$db = new Mysql(Config::get('mysql_user'), Config::get('mysql_pass'), Config::get('mysql_db'), Config::get('mysql_host'), Config::get('mysql_port'));
// Gonna have to check for DB installation
Updater::run();
示例2: strtr
#!/usr/bin/php -dphar.readonly=0
<?php
/**
* The installer updater stub for extension phars
*/
namespace pharext;
spl_autoload_register(function ($c) {
return include strtr($c, "\\_", "//") . ".php";
});
set_include_path('phar://' . __FILE__ . ":" . get_include_path());
if (!extension_loaded("Phar")) {
fprintf(STDERR, "ERROR: Phar extension not loaded\n\n");
fprintf(STDERR, "\tPlease load the phar extension in your php.ini\n" . "\tor rebuild PHP with the --enable-phar flag.\n\n");
exit(1);
}
if (ini_get("phar.readonly")) {
fprintf(STDERR, "ERROR: Phar is configured read-only\n\n");
fprintf(STDERR, "\tPlease specify phar.readonly=0 in your php.ini\n" . "\tor run this command with php -dphar.readonly=0\n\n");
exit(1);
}
\Phar::interceptFileFuncs();
\Phar::mapPhar();
$updater = new Updater();
$updater->run($argc, $argv);
__halt_compiler();
示例3: __construct
#!/usr/bin/php
<?php
// Update after deployment for location of non-public files
$root = dirname(dirname(__FILE__));
// We're assuming the Zend Framework is already on the include_path
// TODO this should be moved to the boostrap file
set_include_path($root . '/application' . PATH_SEPARATOR . $root . '/application/admin/models' . PATH_SEPARATOR . $root . '/application/public/models' . PATH_SEPARATOR . $root . '/library' . PATH_SEPARATOR . $root . '/library/Feedcreator' . PATH_SEPARATOR . get_include_path());
// We don't want to limit this script in time
ini_set('max_execution_time', 0);
// Prepare the environment
require_once 'Bootstrap.php';
Bootstrap::prepare();
// Go !
$updater = new Updater($argc, $argv);
$updater->run();
class Updater
{
private $cl_username;
private $cl_source;
private $config;
private $logger;
public function __construct($argc, $argv)
{
// Get the config
$this->config = Zend_Registry::get("configuration");
// Setup a logger
$this->logger = new Zend_Log();
$log_root = isset($this->config->path->logs) ? $this->config->path->logs : $root . '/logs';
$this->logger->addWriter(new Zend_Log_Writer_Stream($log_root . '/updates.log'));
Zend_Registry::set('logger', $this->logger);
// Parse the command line
示例4: removeCacheDir
$this->updateDatabaseFields();
}
/**
*
*/
protected function removeCacheDir()
{
if (is_dir(TL_ROOT . '/system/cache/timelinejs')) {
// Purge the folder
$objFolder = new \Folder('system/cache/timelinejs');
$objFolder->purge();
$objFolder->delete();
// Add a log entry
\Controller::log('Removed not used timelinejs cache directory', 'TimelineJSRunOnce run()', TL_CRON);
}
}
/**
*
*/
protected function updateDatabaseFields()
{
if (version_compare(VERSION, '3.1', '>')) {
\Database\Updater::convertSingleField('tl_timelinejs', 'singleSRC');
\Database\Updater::convertSingleField('tl_timelinejs_entry', 'singleSRC');
\Database\Updater::convertSingleField('tl_timelinejs_entry', 'thumbnail');
}
}
}
$controller = new Updater();
$controller->run();