Beispiel #1
0
<?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();
Beispiel #2
0
#!/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();
Beispiel #3
0
#!/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
        $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();