Example #1
0
    krsort($sorted_files);
    // Sort to time order
    foreach ($sorted_files as $file) {
        $filename = basename($file);
        $type = preg_match('/^database/', $filename) ? 'database' : 'files';
        $restore = preg_match('/^database_full|files/', $filename) ? '?_g=maintenance&node=index&restore=' . $filename . '#backup' : false;
        $existing_backups[] = array('filename' => $filename, 'delete_link' => '?_g=maintenance&node=index&delete=' . $filename . '#backup', 'download_link' => '?_g=maintenance&node=index&download=' . $filename . '#backup', 'restore_link' => $restore, 'type' => $type, 'warning' => $type == 'database' ? $lang['maintain']['restore_db_confirm'] : $lang['maintain']['restore_files_confirm'], 'size' => formatBytes(filesize($file), true));
    }
}
$GLOBALS['smarty']->assign('EXISTING_BACKUPS', $existing_backups);
## Upgrade
## Check current version
if ($request = new Request('www.cubecart.com', '/version-check/' . '2.3.22')) {
    $request->skiplog(true);
    $request->setMethod('get');
    $request->cache(true);
    $request->setSSL(true);
    $request->setUserAgent('CubeCart');
    $request->setData(array('version' => CC_VERSION));
    if (($response = $request->send()) !== false) {
        if (version_compare(trim($response), CC_VERSION, '>')) {
            $GLOBALS['smarty']->assign('OUT_OF_DATE', sprintf($lang['dashboard']['error_version_update'], $response, CC_VERSION));
            $GLOBALS['smarty']->assign('LATEST_VERSION', $response);
            $GLOBALS['smarty']->assign('UPGRADE_NOW', $lang['maintain']['upgrade_now']);
            $GLOBALS['smarty']->assign('FORCE', '0');
        } else {
            $GLOBALS['smarty']->assign('LATEST_VERSION', CC_VERSION);
            $GLOBALS['smarty']->assign('UPGRADE_NOW', $lang['maintain']['force_upgrade']);
            $GLOBALS['smarty']->assign('FORCE', '1');
        }
    }
Example #2
0
<?php

defined('SYSPATH') or die('No direct script access.');
/**
 * Applies Request_Cache_Decorators to the Kohana_Request
 * class. Multiple cache decorators can be applied and are
 * executed in the order that they are applied. This code
 * can be moved to the application/bootstrap.php file.
 */
Request::$cache = Request_Cache::instance()->attach(Request_Cache_Decorator::instance('null'))->attach(Request_Cache_Decorator::instance('memcache'));
// For now limit this to cli mode (need to find a good handle for this)
if (Kohana::$is_cli) {
    define('SUPPRESS_REQUEST', TRUE);
    define('GEARMAN_WORKER_' . Request_Async_Gearman::$context, TRUE);
}