當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Updater::run方法代碼示例

本文整理匯總了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();
開發者ID:robrepp,項目名稱:Statusarchy,代碼行數:10,代碼來源:init.inc.php

示例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();
開發者ID:m6w6,項目名稱:pharext,代碼行數:26,代碼來源:pharext_updater.php

示例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
開發者ID:kreativmind,項目名稱:storytlr,代碼行數:31,代碼來源:update.php

示例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();
開發者ID:netzmacht,項目名稱:contao-timelinejs,代碼行數:30,代碼來源:runonce.php


注:本文中的Updater::run方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。