2.1.* - 2.2.2 upgrade - gallery now completely garbled !
jsnielsen
Joined: 2006-06-02
Posts: 7 |
![]() |
Hello, I wanted to upgrade from 2.1.* to 2.2.2, and downloaded the recommended full package. Unzipped it, But - when I do that, I get this: Quote:
h = $months[gmstrftime('%m', $time)]; $out = gmstrftime('%%s, %d %%s %Y %H:%M:%S GMT', $time); return sprintf($out, $dow, $month); } /** * Check if Gallery is in embedded mode * * @return boolean true if Gallery is in embedded mode, false otherwise */ function isEmbedded() { return GalleryDataCache::containsKey('G2_EMBED') && GalleryDataCache::get('G2_EMBED'); } /** * Add an action to be performed at the end of the request. * * @param callback $callback * @param array $parameters */ function addShutdownAction($callback, $parameters) { if (!isset($this->_shutdownActions)) { $this->_shutdownActions = array(); } $action = array($callback, $parameters); /* Skip duplicate actions */ foreach ($this->_shutdownActions as $item) { if ($item == $action) { $duplicate = true; break; } } if (!isset($duplicate)) { $this->_shutdownActions[] = $action; } } /** * Process registered shutdown actions. */ function performShutdownActions() { if (isset($this->_shutdownActions)) { foreach ($this->_shutdownActions as $action) { $ret = @call_user_func_array($action[0], $action[1]); if ($this->getDebug() || class_exists('GalleryTestCase')) { /* Ignore errors unless debug is on */ if (is_array($ret) && GalleryUtilities::isA($ret[0], 'GalleryStatus')) { $ret = $ret[0]; } else if (!GalleryUtilities::isA($ret, 'GalleryStatus')) { $ret = null; } if (isset($ret) && $ret) { $this->debug('Error from shutdown action:'); $this->debug_r($action); $this->debug_r($ret); } } } } } /** * Return our PHP virtual machine abstraction * * @return object GalleryPhpVm */ function getPhpVm() { if (!isset($this->_phpVm)) { GalleryCoreApi::requireOnce('modules/core/classes/GalleryPhpVm.class'); $this->_phpVm = new GalleryPhpVm(); } return $this->_phpVm; } } ?> anonymousUser'); if ($ret) { return $ret; } list ($ret, $acceleration) = GalleryCoreApi::getPluginParameter('module', 'core', 'acceleration'); if ($ret) { return $ret; } $acceleration = unserialize($acceleration); list ($ret, $isAnonymous) = GalleryCoreApi::isAnonymousUser(); if ($ret) { return $ret; } $expiration = $acceleration[$isAnonymous ? 'guest' : 'user']['expiration']; $phpVm = $gallery->getPhpVm(); $cutoff = $phpVm->time() - $expiration; /* Use UPDATE instead of DELETE since UPDATE is faster and we reuse the rows. */ $storage =& $gallery->getStorage(); if ($isAnonymous) { $userIdForSql = (int)$anonymousUserId; } else { $userIdForSql = new GallerySqlFragment('<> ?', (int)$anonymousUserId); } list ($ret, $results) = GalleryCoreApi::updateMapEntry('GalleryCacheMap', array('userId' => $userIdForSql, 'timestamp' => new GallerySqlFragment('< ?', (int)$cutoff), 'isEmpty' => 0), array('value' => null, 'isEmpty' => 1)); if ($ret) { return $ret; } return null; } } ?> * * PHP versions before PHP 4.4.2 / PHP 5.1.2 allowed for HTTP header injection (HTTP RS). * This function ensures that servers running older PHP versions are protected as well. * * @param string $header * @return bool true if the given header is safe */ function isSafeHttpHeader($header) { if (!is_string($header)) { return false; } /* Don't allow plain occurrences of CR or LF */ if (strpos($header, chr(13)) !== false || strpos($header, chr(10)) !== false) { return false; } /* Don't allow (x times) url encoded versions of CR or LF */ if (preg_match('/%(25)*(0a|0d)/i', $header)) { return false; } return true; } } ?> on.use_trans_sid to mitigate performance-penalty * (do it before any output is started) */ if (!defined('SID')) { @ini_set('session.use_trans_sid', 0); } ?> on =& $gallery->getSession(); $navData = $session->getNavigation($this->_navId); return (count($navData) > 0); } /** * Get a list of navigation links to go back to where we came from. * * @param int $depth set this to get links back to a certain depth * @return array ( object GalleryStatus a status code, * array of navigational links: array('url' => ..., * 'name' => 'Back to ...')) */ function getNavigationLinks($depth=null) { global $gallery; if (empty($this->_navId)) { return array(null, array()); } list ($ret, $core) = GalleryCoreApi::loadPlugin('module', 'core'); if ($ret) { return array($ret, null); } $session =& $gallery->getSession(); $navData = $session->getNavigation($this->_navId); $links = array(); $i = 0; foreach ($navData as $navItem) { $i++; if (isset($depth) && $i > $depth) { break; } $url = $navItem['returnUrl']; $params = array('fromNavId' => $this->_navId); if (isset($navItem['returnNavId'])) { $params['navId'] = $navItem['returnNavId']; } if (!empty($navItem['returnName'])) { $name = $core->translate(array('text' => 'Back to %s', 'arg1' => $navItem['returnName'])); } else { $name = $core->translate('Back'); } $url = GalleryUrlGenerator::appendParamsToUrl($url, $params); $links[] = array('url' => $url, 'name' => $name); } return array(null, $links); } /** * Decide whether to include session id in the URL. * * Force the session id in the URL for embedded DownloadItem URLs if the cookie.path plugin * parameter is not set. See GallerySession::init for details * * @param array $params (string param) * @return boolean forceSessionId * @access protected */ function embedForceSessionId($params) { if (isset($params['view']) && $params['view'] == 'core.DownloadItem' && GalleryUtilities::isEmbedded() && empty($this->_isCookiePathConfigured)) { /* * It is assumed that the Gallery session is initiated before generateUrl() is called * for the first time */ return true; } else { return false; } } } ?> When I go to http://www.fantastisk.net/gallery2/upgrade, I get this: Quote:
'gallery2_upgrade'); } } function _startDebugLog($header) { global $gallery; $gallery->setDebug('logged'); if (!isset($_SESSION['debugLogFile'])) { $dataBase = $gallery->getConfig('data.gallery.base'); $tag = substr(md5(microtime() . rand(1, 32767)), 0, 10); $_SESSION['debugLogFile'] = $dataBase . '/upgrade_' . $tag . '.log'; } $gallery->setDebugLogFile($_SESSION['debugLogFile']); $gallery->debug("\n\n--------------------------------------------------------\n\t$header\n" . "--------------------------------------------------------\n\n"); } } ?> h = $months[gmstrftime('%m', $time)]; $out = gmstrftime('%%s, %d %%s %Y %H:%M:%S GMT', $time); return sprintf($out, $dow, $month); } /** * Check if Gallery is in embedded mode * * @return boolean true if Gallery is in embedded mode, false otherwise */ function isEmbedded() { return GalleryDataCache::containsKey('G2_EMBED') && GalleryDataCache::get('G2_EMBED'); } /** * Add an action to be performed at the end of the request. * * @param callback $callback * @param array $parameters */ function addShutdownAction($callback, $parameters) { if (!isset($this->_shutdownActions)) { $this->_shutdownActions = array(); } $action = array($callback, $parameters); /* Skip duplicate actions */ foreach ($this->_shutdownActions as $item) { if ($item == $action) { $duplicate = true; break; } } if (!isset($duplicate)) { $this->_shutdownActions[] = $action; } } /** * Process registered shutdown actions. */ function performShutdownActions() { if (isset($this->_shutdownActions)) { foreach ($this->_shutdownActions as $action) { $ret = @call_user_func_array($action[0], $action[1]); if ($this->getDebug() || class_exists('GalleryTestCase')) { /* Ignore errors unless debug is on */ if (is_array($ret) && GalleryUtilities::isA($ret[0], 'GalleryStatus')) { $ret = $ret[0]; } else if (!GalleryUtilities::isA($ret, 'GalleryStatus')) { $ret = null; } if (isset($ret) && $ret) { $this->debug('Error from shutdown action:'); $this->debug_r($action); $this->debug_r($ret); } } } } } /** * Return our PHP virtual machine abstraction * * @return object GalleryPhpVm */ function getPhpVm() { if (!isset($this->_phpVm)) { GalleryCoreApi::requireOnce('modules/core/classes/GalleryPhpVm.class'); $this->_phpVm = new GalleryPhpVm(); } return $this->_phpVm; } } ?> anonymousUser'); if ($ret) { return $ret; } list ($ret, $acceleration) = GalleryCoreApi::getPluginParameter('module', 'core', 'acceleration'); if ($ret) { return $ret; } $acceleration = unserialize($acceleration); list ($ret, $isAnonymous) = GalleryCoreApi::isAnonymousUser(); if ($ret) { return $ret; } $expiration = $acceleration[$isAnonymous ? 'guest' : 'user']['expiration']; $phpVm = $gallery->getPhpVm(); $cutoff = $phpVm->time() - $expiration; /* Use UPDATE instead of DELETE since UPDATE is faster and we reuse the rows. */ $storage =& $gallery->getStorage(); if ($isAnonymous) { $userIdForSql = (int)$anonymousUserId; } else { $userIdForSql = new GallerySqlFragment('<> ?', (int)$anonymousUserId); } list ($ret, $results) = GalleryCoreApi::updateMapEntry('GalleryCacheMap', array('userId' => $userIdForSql, 'timestamp' => new GallerySqlFragment('< ?', (int)$cutoff), 'isEmpty' => 0), array('value' => null, 'isEmpty' => 1)); if ($ret) { return $ret; } return null; } } ?> * * PHP versions before PHP 4.4.2 / PHP 5.1.2 allowed for HTTP header injection (HTTP RS). * This function ensures that servers running older PHP versions are protected as well. * * @param string $header * @return bool true if the given header is safe */ function isSafeHttpHeader($header) { if (!is_string($header)) { return false; } /* Don't allow plain occurrences of CR or LF */ if (strpos($header, chr(13)) !== false || strpos($header, chr(10)) !== false) { return false; } /* Don't allow (x times) url encoded versions of CR or LF */ if (preg_match('/%(25)*(0a|0d)/i', $header)) { return false; } return true; } } ?> on.use_trans_sid to mitigate performance-penalty * (do it before any output is started) */ if (!defined('SID')) { @ini_set('session.use_trans_sid', 0); } ?> ssion; } /** * Returns the authentication token associated with this session. * @return string the authentication token */ function getAuthToken() { $authToken = $this->get('core.authToken'); if (empty($authToken)) { global $gallery; $phpVm = $gallery->getPhpVm(); $authToken = substr($phpVm->md5(uniqid(microtime() . mt_rand())), 0, 12); $this->put('core.authToken', $authToken); } return $authToken; } /** * Checks the given authentication token and resets the internal token on failure. * @param string $authToken Authentication token to be verified * @return bool true if the given */ function isCorrectAuthToken($authToken) { $internalAuthToken = $this->get('core.authToken'); if (empty($authToken) || empty($internalAuthToken) || strcmp($internalAuthToken, $authToken)) { $this->put('core.authToken', null); return false; } else { return true; } } } /** * Get the active user from the session's user id. * @package GalleryCore * @subpackage Classes */ class SessionAuthPlugin /* extends GalleryAuthPlugin */ { /** * @see GalleryAuthPlugin::getUser */ function getUser() { global $gallery; $session =& $gallery->getSession(); $userId = $session->getUserId(); if (!empty($userId)) { list ($ret, $user) = GalleryCoreApi::loadEntitiesById($userId); /* ERROR_MISSING_OBJECT check to suppress error if user id doesn't exist */ if ($ret && !($ret->getErrorCode() & ERROR_MISSING_OBJECT)) { return array($ret, null); } return array(null, $user); } } } ?> } } ?> ata['authFileErrors']['missing'] = 1; } else if (!is_readable($authFile)) { $templateData['authFileErrors']['unreadable'] = 1; } else { $authKeyFromFile = trim(join('', file($authFile))); if ($authKeyFromFile == $templateData['authKey']) { GallerySetupUtilities::authenticateThisSession(); } else { $templateData['authFileErrors']['mismatch'] = 1; } } $templateData['renderType'] = 'loginTxtForm'; } else { if (isset($_POST['password_sent'])) { if (empty($_POST['password'])) { $templateData['error']['password'] = _('Error: missing password.'); } else if ($_POST['password'] != $gallery->getConfig('setup.password')) { $templateData['error']['password'] = _('Error: invalid password.'); GallerySetupUtilities::setLoginAttempts(++$attempts); if ($attempts > G2_SUPPORT_MAX_LOGIN_ATTEMPTS) { GallerySetupUtilities::notifySiteAdministrator(); } } else { GallerySetupUtilities::authenticateThisSession(); } } $templateData['renderType'] = 'password'; } if (GallerySetupUtilities::isSessionAuthenticated()) { $this->setComplete(true); } } if ($this->isComplete()) { $templateData['bodyFile'] = 'AuthenticateSuccessful.html'; } else { $templateData['bodyFile'] = 'AuthenticateRequest.html'; } } } ?> eturn boolean success */ function _checkStorageSubDirectory($dirname, &$tested, $max) { global $gallery; $platform =& $gallery->getPlatform(); if (!($fd = $platform->opendir($dirname))) { return false; } while (($filename = $platform->readdir($fd)) !== false && $tested < $max) { if (!strcmp($filename, '.') || !strcmp($filename, '..')) { continue; } $tested++; $path = $dirname . $platform->getDirectorySeparator() . $filename; if (!$platform->is_link($path) && (!$platform->is_writeable($path) || !$platform->is_readable($path))) { return false; } if ($platform->is_dir($path) && $tested < $max) { /* Threshold not yet reached, check subdirectory tree */ if (!SystemChecksStep::_checkStorageSubDirectory($path, $tested, $max)) { return false; } } } $platform->closedir($fd); return true; } function CheckManifest(&$statusMonitor, $useSetTimeLimit) { $base = realpath(dirname(__FILE__) . '/../..') . '/'; if ($useSetTimeLimit) { set_time_limit(180); } $manifest = GalleryUtilities::readManifest(); if (empty($manifest)) { return null; } if (isset($statusMonitor)) { $statusMonitor->renderStatusMessage(_('Performing system checks'), '', 0.1); } if ($useSetTimeLimit) { set_time_limit(180); } $missing = $modified = $shouldRemove = array(); $stepSize = max((int)(count($manifest) / 22), 1); $i = 0; foreach ($manifest as $file => $info) { $i++; if ($file == 'MANIFEST') { continue; } $path = $base . $file; if ($i % $stepSize == 0) { if (isset($statusMonitor)) { $statusMonitor->renderStatusMessage(_('Performing system checks'), '', 0.12 + $i / $stepSize * 0.04); } if ($useSetTimeLimit) { set_time_limit(180); } } if (!empty($info['removed'])) { if (file_exists($path)) { $shouldRemove[] = $file; } } else if (!file_exists($path)) { $missing[] = $file; } else { /* * Use size comparison instead of checksum for speed. We have * two sizes, one calculated with unix eols, one with windows eols. */ $actualSize = filesize($path); if ($actualSize != $info['size'] && $actualSize != $info['size_crlf']) { /* This can be useful debug info */ if (false) { printf("%s (expected: %s/%s, actual: %s) Can you point me in the right direction, or possibly provide a solution ?
|
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
please upload your gallery2 folder again. -------------- |
|
jsnielsen
Joined: 2006-06-02
Posts: 7 |
![]() |
I just remembered - I think I took the "light" version when I first installed the gallery. This time I uploaded the "Full" version. Can this error be a result of this ? Will try to re-upload. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
no. please reupload the full version. some of the gallery2 files on your webspace are corrupt. -------------- |
|