Esempio n. 1
0
         * reason we fail, we'll reset it in init.inc (but that's ok).
         */
        $gallery->setConfig('data.gallery.cache', $gallery->getConfig('data.gallery.base') . 'cache/');
        $path = GalleryDataCache::getCachePath(array('type' => 'fast-download', 'itemId' => $itemId));
        /* We don't have a platform yet so we have to use the raw file_exists */
        /* Disable fast-download in maintenance mode.. admins still get via core.DownloadItem */
        if (file_exists($path) && !$gallery->getConfig('mode.maintenance')) {
            include $path;
            if (GalleryFastDownload()) {
                return;
            }
        }
    }
    /* Otherwise, proceed with our regular process */
    require_once dirname(__FILE__) . '/init.inc';
    $ret = GalleryInitFirstPass();
    if ($ret) {
        _GalleryMain_errorHandler($ret->wrap(__FILE__, __LINE__), null, false);
        return;
    }
    /* Process the request */
    GalleryMain();
}
function GalleryMain($embedded = false)
{
    global $gallery;
    /* Process the request */
    list($ret, $g2Data) = _GalleryMain($embedded);
    if (!$ret) {
        $gallery->performShutdownActions();
        /* Write out our session data */
Esempio n. 2
0
$stepOrder[] = 'UpgradeCoreModule';
$stepOrder[] = 'UpgradeOtherModules';
$stepOrder[] = 'CleanCache';
$stepOrder[] = 'Finished';
foreach ($stepOrder as $stepName) {
    $className = $stepName . 'Step';
    require "steps/{$className}.class";
}
GallerySetupUtilities::startSession();
require_once dirname(__FILE__) . '/../init.inc';
/* Check if config.php is ok */
$storageConfig = @$gallery->getConfig('storage.config');
if (!empty($storageConfig)) {
    /* We want to avoid using the cache */
    GalleryDataCache::setFileCachingEnabled(false);
    $ret = GalleryInitFirstPass(array('debug' => 'buffered', 'noDatabase' => 1));
    if ($ret) {
        print $ret->getAsHtml();
        return;
    }
    $translator =& $gallery->getTranslator();
    if (!$translator->canTranslate()) {
        unset($translator);
    } else {
        if (empty($_SESSION['language'])) {
            $_SESSION['language'] = GalleryTranslator::getLanguageCodeFromRequest();
        }
        $translator->init($_SESSION['language'], true);
        /* Select domain for translation */
        bindtextdomain('gallery2_upgrade', dirname(dirname(__FILE__)) . '/locale');
        textdomain('gallery2_upgrade');