? .htaccess
? config.php
? login.txt
? modules/core/classes/helpers/myGalleryChildEntityHelper_simple.class
Index: install/steps/InstallCoreModuleStep.class
===================================================================
RCS file: /cvsroot/gallery/gallery2/install/steps/InstallCoreModuleStep.class,v
retrieving revision 1.19
diff -u -w -r1.19 InstallCoreModuleStep.class
--- install/steps/InstallCoreModuleStep.class 9 Jul 2005 05:42:41 -0000 1.19
+++ install/steps/InstallCoreModuleStep.class 4 Aug 2005 15:15:16 -0000
@@ -30,18 +30,32 @@
define('GALLERY_CONFIG_DIR', $_SESSION['configPath']);
require(dirname(__FILE__) . '/../../bootstrap.inc');
require(dirname(__FILE__) . '/../../init.inc');
- $ret = GalleryInitFirstPass(array('debug' => 'buffered',
+
+ /* We want to log all debug output in our install log */
+ $gallery =& $GLOBALS['gallery'];
+ $gallery->setDebug('logged');
+ $dataBase = $gallery->getConfig('data.gallery.base');
+ $installLogPath = sprintf('%s/install.log', $dataBase);
+ $gallery->setDebugLogFile($installLogPath);
+ $templateData['installLogPath'] = $installLogPath;
+ $this->_createDebugLogHeader();
+
+ $gallery->debug('Init first pass');
+ $ret = GalleryInitFirstPass(array('debug' => 'logged',
'noDatabase' => 1));
if ($ret->isError()) {
+ $gallery->debug('Error: Unable to initialize our Gallery data');
$templateData['errors'][] = _('Unable to initialize our Gallery data');
$templateData['stackTrace'] = $ret->getAsHtml();
}
- $gallery =& $GLOBALS['gallery'];
+
+ $this->_addSystemInformationToDebugLog();
/* We want to avoid using the cache */
GalleryDataCache::setFileCachingEnabled(false);
/* Gallery init selects language from browser; reset to language currently in use */
+ $gallery->debug('Initiate translator');
$translator =& $gallery->getTranslator();
$translator->init($_SESSION['language']);
@@ -50,7 +64,7 @@
* installing on top of an older install.
*/
$platform = $gallery->getPlatform();
- $dataBase = $gallery->getConfig('data.gallery.base');
+ $gallery->debug('Clear the cache directory');
$cacheDirs = array('entity', 'theme', 'module', 'derivative');
foreach ($cacheDirs as $dir) {
$dir = sprintf('%s/cache/%s', $dataBase, $dir);
@@ -62,6 +76,7 @@
}
if (empty($templateData['errors'])) {
+ $gallery->debug('Check if the persistent storage is installed');
/*
* Check to see if the database tables already exist. If they do then
* we should assume that they said that it was ok to reuse existing tables
@@ -71,15 +86,18 @@
$storage =& $gallery->getStorage();
list ($ret, $isInstalled) = $storage->isInstalled();
if ($ret->isError()) {
+ $gallery->debug('Error: Unable to communicate with the database');
$templateData['errors'][] = _('Unable to communicate with the database');
$templateData['stackTrace'] = $ret->getAsHtml();
}
}
if (empty($templateData['errors'])) {
+ $gallery->debug('Load core module');
list ($ret, $core) = GalleryCoreApi::loadPlugin('module', 'core', true);
$this->resetL10Domain();
if ($ret->isError()) {
+ $gallery->debug('Error: Unable to load the core module');
$templateData['errors'][] = _('Unable to load the core module');
$templateData['stackTrace'] = $ret->getAsHtml();
}
@@ -87,6 +105,7 @@
$freshInstall = $galleryStub->getConfig('freshInstall');
if ($freshInstall) {
+ $gallery->debug('Hand over admin user parameters');
/* It's a fresh install. Hand over install config parameters */
$gallery->setConfig('setup.admin.userName',
$galleryStub->getConfig('setup.admin.userName'));
@@ -98,26 +117,39 @@
if (empty($templateData['errors'])) {
if (!$isInstalled) {
+ $gallery->debug('Install core module now!');
$ret = $core->installOrUpgrade(true);
if ($ret->isError()) {
$this->resetL10Domain();
+ $gallery->debug('Error: Unable to install the core module');
$templateData['errors'][] = _('Unable to install the core module');
$templateData['stackTrace'] = $ret->getAsHtml();
+ } else {
+ $gallery->debug('Core module installed successfully');
}
+ $gallery->debug('Activate core module');
list ($ret, $ignored) = $core->activate();
$this->resetL10Domain();
if ($ret->isError()) {
+ $gallery->debug('Error: Unable to activate the core module');
$templateData['errors'][] = _('Unable to activate the core module');
$templateData['stackTrace'] = $ret->getAsHtml();
+ } else {
+ $gallery->debug('Core module activated successfully');
}
+ $gallery->debug('Commit transaction');
$ret = $storage->commitTransaction();
if ($ret->isError()) {
+ $gallery->debug('Error: Unable to commit database transactio');
$templateData['errors'][] = _('Unable to commit database transaction');
$templateData['stackTrace'] = $ret->getAsHtml();
+ } else {
+ $gallery->debug('Committed transaction successfully');
}
} else {
+ $gallery->debug('NOT installing, rollback!');
$storage->rollbackTransaction(); /* Ignore any errors from this */
/*
* Don't allow this step to complete when only partially installed.
@@ -125,22 +157,62 @@
*/
$versions = $core->getInstalledVersions();
if (empty($versions['core']) || $versions['core'] != $core->getVersion()) {
+ $gallery->debug('Error: Core module is only partially installed');
$templateData['errors'][] = _('Core module is only partially installed.');
$templateData['stackTrace'] = '';
+ } else {
+ $gallery->debug('Core module version is ok');
}
}
}
+ $gallery->debug('Finish install core module step');
if (empty($templateData['errors'])) {
+ $gallery->debug('Install core module step completed successfully');
$this->setComplete(true);
- }
-
- if (empty($templateData['errors'])) {
$templateData['bodyFile'] = 'InstallCoreModuleSuccess.html';
} else {
- $templateData['debug'] = $gallery->getDebugBuffer();
+ $gallery->debug('Error: Failure during install core module step');
$templateData['bodyFile'] = 'InstallCoreModuleError.html';
}
}
+
+ /* Adds a header to the debug log */
+ function _createDebugLogHeader() {
+ global $gallery;
+
+ $gallery->debug("\n\n
+--------------------------------------------------------
+ Prepare installation of the core module
+--------------------------------------------------------\n\n");
+ }
+
+ /* Adds some system information to the log */
+ function _addSystemInformationToDebugLog() {
+ global $gallery;
+ global $galleryStub;
+
+ $storage =& $gallery->getStorage();
+ $isCvsInstall = $galleryStub->getConfig('systemchecks.iscvsinstall');
+ $isCvsInstall = empty($isCvsInstall) ? "No" : "Yes";
+
+ $gallery->debug("\n
+--------------------------------------------------------
+System and Gallery information:
+--------------------------------------------------------
+ Gallery version:\t" . $galleryStub->getConfig('codebase.version') . "
+ File integrity:\t" . $galleryStub->getConfig('systemchecks.fileintegrity') . "
+ CVS install:\t" . $isCvsInstall . "
+ PHP version:\t" . phpversion() . " " . php_sapi_name() . "
+ PHP memory limit:\t" . ini_get('memory_limit') . "
+ PHP disable_functions:\t" . ini_get('disable_functions') . "
+ PHP zend.ze1_compatibility_mode:\t" . ini_get('zend.ze1_compatibility_mode') . "
+ Webserver:\t" . GalleryUtilities::getServerVar('SERVER_SOFTWARE') . "
+ Database:\t" . $storage->_impl->getAdoDbType() . " " . @$storage->_impl->getVersion() . "
+ Operating system:\t" . php_uname() . "
+ Browser:\t " . GalleryUtilities::getServerVar('HTTP_USER_AGENT') . "
+--------------------------------------------------------\n\n
+");
+ }
}
?>
Index: install/steps/MultisiteStep.class
===================================================================
RCS file: /cvsroot/gallery/gallery2/install/steps/MultisiteStep.class,v
retrieving revision 1.2
diff -u -w -r1.2 MultisiteStep.class
--- install/steps/MultisiteStep.class 31 Jul 2005 12:41:07 -0000 1.2
+++ install/steps/MultisiteStep.class 4 Aug 2005 15:15:16 -0000
@@ -147,6 +147,12 @@
ob_end_clean();
}
global $galleryStub;
+ /* Copy config data from system checks step which will be used in the install log */
+ $gallery->setConfig('systemchecks.fileintegrity',
+ $galleryStub->getConfig('systemchecks.fileintegrity'));
+ $gallery->setConfig('systemchecks.iscvsinstall',
+ $galleryStub->getConfig('systemchecks.iscvsinstall'));
+ /* Replace galleryStub */
$galleryStub = $gallery;
}
}
Index: install/steps/SystemChecksStep.class
===================================================================
RCS file: /cvsroot/gallery/gallery2/install/steps/SystemChecksStep.class,v
retrieving revision 1.32
diff -u -w -r1.32 SystemChecksStep.class
--- install/steps/SystemChecksStep.class 2 Aug 2005 20:42:00 -0000 1.32
+++ install/steps/SystemChecksStep.class 4 Aug 2005 15:15:16 -0000
@@ -62,6 +62,10 @@
}
function loadTemplateData(&$templateData) {
+ /* Create GalleryStub to store information for the install core step / install log */
+ global $galleryStub;
+ $galleryStub = new GalleryStub();
+
$failCount = 0;
$suggestedHtaccess = array();
@@ -213,9 +217,15 @@
array('title' => $title,
'warning' => true,
'notice' => _('Manifest missing or inaccessible.'));
+
+ $galleryStub->setConfig('systemchecks.fileintegrity',
+ 'Manifest missing or inaccessible.');
} else if (empty($manifest['missing']) && empty($manifest['modified'])
&& empty($manifest['shouldRemove'])) {
$templateData['check'][] = array('title' => $title, 'success' => true);
+
+ $galleryStub->setConfig('systemchecks.fileintegrity',
+ 'Ok');
} else {
ob_start();
include(dirname(__FILE__) . '/../templates/ManifestSystemCheck.html');
@@ -226,7 +236,16 @@
array('title' => $title,
'warning' => true,
'notice' => $notice);
+
+ if (empty($manifest['missing']) && empty($manifest['modified'])) {
+ $galleryStub->setConfig('systemchecks.fileintegrity',
+ 'There are some old files');
+ } else {
+ $galleryStub->setConfig('systemchecks.fileintegrity',
+ 'There are missing/modified files!');
+ }
}
+ $galleryStub->setConfig('systemchecks.iscvsinstall', $isCvsInstall);
}
$templateData['suggestedHtaccess'] = join("\n", $suggestedHtaccess);
Index: install/styles/style.css
===================================================================
RCS file: /cvsroot/gallery/gallery2/install/styles/style.css,v
retrieving revision 1.27
diff -u -w -r1.27 style.css
--- install/styles/style.css 31 Jul 2005 12:41:08 -0000 1.27
+++ install/styles/style.css 4 Aug 2005 15:15:16 -0000
@@ -340,3 +340,7 @@
border:1px solid #f0f0f0;
}
+ol {
+ font-size: 1.1em;
+ line-height: 1.4em;
+}
\ No newline at end of file
Index: install/templates/InstallCoreModule.html
===================================================================
RCS file: /cvsroot/gallery/gallery2/install/templates/InstallCoreModule.html,v
retrieving revision 1.2
diff -u -w -r1.2 InstallCoreModule.html
--- install/templates/InstallCoreModule.html 19 Aug 2004 06:46:48 -0000 1.2
+++ install/templates/InstallCoreModule.html 4 Aug 2005 15:15:16 -0000
@@ -1,12 +1,8 @@
-
-
-
-
Index: install/templates/InstallCoreModuleError.html
===================================================================
RCS file: /cvsroot/gallery/gallery2/install/templates/InstallCoreModuleError.html,v
retrieving revision 1.2
diff -u -w -r1.2 InstallCoreModuleError.html
--- install/templates/InstallCoreModuleError.html 19 May 2005 21:31:22 -0000 1.2
+++ install/templates/InstallCoreModuleError.html 4 Aug 2005 15:15:16 -0000
@@ -1,10 +1,21 @@
- ', '') ?>
+
+
+ -
+
+
-
+
+
-
+ ', '', '', ''); ?>
+
-
+ ', ''); ?>
+
+
+
@@ -13,12 +24,3 @@
-
-
-
-
-
Index: modules/core/CoreModuleExtras.inc
===================================================================
RCS file: /cvsroot/gallery/gallery2/modules/core/CoreModuleExtras.inc,v
retrieving revision 1.105
diff -u -w -r1.105 CoreModuleExtras.inc
--- modules/core/CoreModuleExtras.inc 29 Jul 2005 18:41:18 -0000 1.105
+++ modules/core/CoreModuleExtras.inc 4 Aug 2005 15:15:21 -0000
@@ -44,6 +44,7 @@
function upgrade($module, $currentVersion, $statusMonitor) {
global $gallery;
$storage =& $gallery->getStorage();
+ $gallery->debug('Entering CoreModuleExras::upgrade');
/*
* We store our version outside of the database so that we can upgrade
@@ -51,8 +52,8 @@
*/
$versions = $module->getInstalledVersions();
$currentVersion = $versions['core'];
-
if (!isset($currentVersion)) {
+ $gallery->debug('Current version not set');
/*
* This is either an initial install or an upgrade from version
* 0.8 (which didn't have the core versions.dat file). Use a module
@@ -80,8 +81,10 @@
* that one with the old version number. For our example you'd add: "case '1.0.1':" and
* then your code. Do *not* put in a break statement. (Update _prepareConfigUpgrade too)
*/
+ $gallery->debug(sprintf('The current version is %s', $currentVersion));
switch ($currentVersion) {
case '0':
+ $gallery->debug('Install core module');
if (GalleryUtilities::isA($platform, 'WinNtPlatform')) {
$flockType = 'database';
} else {
@@ -94,7 +97,9 @@
}
$platform->fclose($fileToLock);
}
+ $gallery->debug(sprintf('Flocktype %s selected', $flockType));
/* Initial install. Make sure all our module parameters are set. */
+ $gallery->debug('Set core module parameters');
GalleryCoreApi::relativeRequireOnce('modules/core/classes/GalleryTranslator.class');
foreach (array('permissions.directory' => '0755',
'permissions.file' => '0644',
@@ -113,24 +118,36 @@
if (!isset($param[$key])) {
$ret = $module->setParameter($key, $value);
if ($ret->isError()) {
+ $gallery->debug(sprintf('Error: Failed to set core module parameter %s, ' .
+ 'this is the error stack trace: %s', $key,
+ $ret->getAsText()));
return $ret->wrap(__FILE__, __LINE__);
}
}
}
/* Activate the Matrix theme */
+ $gallery->debug('Load Matrix theme');
list ($ret, $theme) = GalleryCoreApi::loadPlugin('theme', 'matrix');
if ($ret->isError()) {
+ $gallery->debug(sprintf('Error: Failed to load matrix theme, this is the error ' .
+ 'stack trace; %s', $ret->getAsText()));
return $ret->wrap(__FILE__, __LINE__);
}
+ $gallery->debug('InstallOrUpgrade Matrix theme');
$ret = $theme->installOrUpgrade();
if ($ret->isError()) {
+ $gallery->debug(sprintf('Error: Failed to installOrUpgrade matrix theme, this is ' .
+ 'the error stack trace; %s', $ret->getAsText()));
return $ret->wrap(__FILE__, __LINE__);
}
+ $gallery->debug('Activate Matrix theme');
list ($ret, $ignored) = $theme->activate();
if ($ret->isError()) {
+ $gallery->debug(sprintf('Error: Failed to activate matrix theme, this is ' .
+ 'the error stack trace; %s', $ret->getAsText()));
return $ret->wrap(__FILE__, __LINE__);
}
@@ -141,6 +158,7 @@
* put a line like this translate('key') in for each description so
* that our extractor can find it.
*/
+ $gallery->debug('Register core module permissions');
$permissions[] = array('all', $gallery->i18n('All access'),
GALLERY_PERMISSION_ALL_ACCESS, array());
$permissions[] = array('view', $gallery->i18n('[core] View item'), 0, array());
@@ -166,6 +184,9 @@
$ret = GalleryCoreApi::registerPermission(
$module->getId(), 'core.' . $p[0], $p[1], $p[2], $p[3]);
if ($ret->isError()) {
+ $gallery->debug(sprintf('Error: Failed to register a permission, ' .
+ 'this is the error stack trace: %s',
+ $ret->getAsText()));
return $ret->wrap(__FILE__, __LINE__);
}
}
@@ -178,21 +199,30 @@
'_createAdminUser',
'_createRootAlbumItem') as $func) {
+ $gallery->debug(sprintf('Call user func %s', $func));
$ret = call_user_func(array('CoreModuleExtras', $func), $module);
if ($ret->isError()) {
+ $gallery->debug(sprintf('Error: %s returned an error, ' .
+ 'this is the error stack trace: %s', $func,
+ $ret->getAsText()));
return $ret->wrap(__FILE__, __LINE__);
}
}
+ $gallery->debug('Initialize MIME types');
GalleryCoreApi::relativeRequireOnce(
'modules/core/classes/helpers/GalleryMimeTypeHelper_advanced.class');
$ret = GalleryMimeTypeHelper_advanced::initializeMimeTypes();
if ($ret->isError()) {
+ $gallery->debug(sprintf('Error: Failed to initialize MIME types, this is ' .
+ 'the error stack trace: %s', $ret->getAsText()));
return $ret->wrap(__FILE__, __LINE__);
}
+ $gallery->debug('CoreModulesExtra::upgrade: successfully installed core');
break;
case '0.8':
+ $gallery->debug('Warning: Upgrading from version 0.8 (not supported)');
case '0.8.1':
case '0.8.2':
/*
@@ -1130,10 +1160,12 @@
break;
default:
+ $gallery->debug('Error: Unknown module version');
return GalleryStatus::error(ERROR_BAD_PLUGIN, __FILE__, __LINE__,
sprintf('Unknown module version %s', $currentVersion));
}
+ $gallery->debug('Write new version to versions file');
$baseDir = $gallery->getConfig('data.gallery.base');
$versionFile = sprintf('%s%s%s',
$baseDir,
@@ -1154,6 +1186,7 @@
}
if ($versionDatError) {
+ $gallery->debug('Error: Can\'t write to versions file');
return GalleryStatus::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__,
'Can\'t write to the versions file');
}
Index: modules/core/classes/GalleryModule.class
===================================================================
RCS file: /cvsroot/gallery/gallery2/modules/core/classes/GalleryModule.class,v
retrieving revision 1.72
diff -u -w -r1.72 GalleryModule.class
--- modules/core/classes/GalleryModule.class 29 Jul 2005 00:15:00 -0000 1.72
+++ modules/core/classes/GalleryModule.class 4 Aug 2005 15:15:22 -0000
@@ -111,12 +111,17 @@
function installOrUpgrade($bootstrap=false, $statusMonitor=null) {
global $gallery;
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('GalleryModule::installOrUpgrade %s module', $this->getId()));
+ }
+
if (!GalleryCoreApi::isPluginCompatibleWithApis($this)) {
return GalleryStatus::error(ERROR_PLUGIN_VERSION_MISMATCH, __FILE__, __LINE__,
sprintf('incompatible %s %s', $this->getPluginType(), $this->getId()));
}
if ($bootstrap) {
+ $gallery->debug('In bootstrap mode (core module)');
/*
* If we're in bootstrap mode, then we may not even have a version
* table. If we try to query it, we will cause our current
@@ -132,20 +137,44 @@
}
if ($installedVersion != $this->getVersion()) {
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Configure store for %s module', $this->getId()));
+ }
/* The store requires configuration. */
$storage =& $gallery->getStorage();
$ret = $storage->configureStore($this->getId());
if ($ret->isError()) {
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Error: Failed to configure the persistent store, ' .
+ 'this is the error stack trace: %s',
+ $ret->getAsText()));
+ }
return $ret->wrap(__FILE__, __LINE__);
}
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Upgrade (or install) %s module', $this->getId()));
+ }
$ret = $this->upgrade($installedVersion, $statusMonitor);
if ($ret->isError()) {
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Error: Failed to upgrade the %s module, this ' .
+ 'is the error stack trace: %s', $this->getId(),
+ $ret->getAsText()));
+ }
return $ret->wrap(__FILE__, __LINE__);
}
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('ConfigureStoreCleanup for %s module', $this->getId()));
+ }
$ret = $storage->configureStoreCleanup($this->getId());
if ($ret->isError()) {
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Error: Failed to clean up the persistent store, ' .
+ 'this is the error stack trace: %s',
+ $ret->getAsText()));
+ }
return $ret->wrap(__FILE__, __LINE__);
}
@@ -155,11 +184,22 @@
* this to successfully deactivate and then fail to activate again. upgrade() should
* get the module read properly but it may fail under some edge cases.
*/
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Reactivate %s module', $this->getId()));
+ }
list ($ret, $redirect) = $this->reactivate();
if ($ret->isError()) {
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Error: Failed to reactivate the module, this' .
+ ' is the error stack trace: %s', $ret->getAsText()));
+ }
return $ret->wrap(__FILE__, __LINE__);
}
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Update module paramater for the %s module',
+ $this->getId()));
+ }
$data = array('_version' => $this->getVersion(),
'_callbacks' => $this->getCallbacks(),
'_requiredCoreApi' => join(',', $this->getRequiredCoreApi()),
@@ -167,11 +207,21 @@
foreach ($data as $key => $value) {
$ret = $this->setParameter($key, $value);
if ($ret->isError()) {
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Error: Failed to update the module parameter %s' .
+ ', this is the error stack trace: %s', $key,
+ $ret->getAsText()));
+ }
return $ret->wrap(__FILE__, __LINE__);
}
}
}
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Successfully finished installOrUpgrade %s module',
+ $this->getId()));
+ }
+
return GalleryStatus::success();
}
Index: modules/core/classes/GalleryTheme.class
===================================================================
RCS file: /cvsroot/gallery/gallery2/modules/core/classes/GalleryTheme.class,v
retrieving revision 1.55
diff -u -w -r1.55 GalleryTheme.class
--- modules/core/classes/GalleryTheme.class 2 Aug 2005 15:42:20 -0000 1.55
+++ modules/core/classes/GalleryTheme.class 4 Aug 2005 15:15:23 -0000
@@ -511,22 +511,45 @@
* @return object GalleryStatus a status code
*/
function installOrUpgrade() {
+ global $gallery;
+
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('GalleryTheme::installOrUpgrade %s theme', $this->getId()));
+ }
+
if (!GalleryCoreApi::isPluginCompatibleWithApis($this)) {
return GalleryStatus::error(ERROR_PLUGIN_VERSION_MISMATCH, __FILE__, __LINE__,
sprintf('incompatible %s %s', $this->getPluginType(), $this->getId()));
}
+ if ($gallery->getDebug()) {
+ $gallery->debug('GalleryTheme::installOrUpgrade get the version parameter');
+ }
+
list ($ret, $installedVersion) = $this->getParameter('_version');
if ($ret->isError()) {
return $ret->wrap(__FILE__, __LINE__);
}
+ if ($gallery->getDebug()) {
+ $gallery->debug('GalleryTheme::installOrUpgrade compare versions');
+ }
+
if ($installedVersion != $this->getVersion()) {
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('GalleryTheme::installOrUpgrade, installed version is %s,' .
+ ' theme upgrade required', $installedVersion));
+ }
+
$ret = $this->upgrade($installedVersion);
if ($ret->isError()) {
return $ret->wrap(__FILE__, __LINE__);
}
+ if ($gallery->getDebug()) {
+ $gallery->debug('GalleryTheme::installOrUpgrade set new theme version etc.');
+ }
+
$data = array('_version' => $this->getVersion(),
'_requiredCoreApi' => join(',', $this->getRequiredCoreApi()),
'_requiredThemeApi' => join(',', $this->getRequiredThemeApi()));
@@ -538,6 +561,10 @@
}
}
+ if ($gallery->getDebug()) {
+ $gallery->debug('GalleryTheme::installOrUpgrade finished successfully');
+ }
+
return GalleryStatus::success();
}
Index: modules/core/classes/helpers/GalleryPluginHelper_medium.class
===================================================================
RCS file: /cvsroot/gallery/gallery2/modules/core/classes/helpers/GalleryPluginHelper_medium.class,v
retrieving revision 1.25
diff -u -w -r1.25 GalleryPluginHelper_medium.class
--- modules/core/classes/helpers/GalleryPluginHelper_medium.class 9 Jul 2005 05:44:20 -0000 1.25
+++ modules/core/classes/helpers/GalleryPluginHelper_medium.class 4 Aug 2005 15:15:24 -0000
@@ -318,6 +318,12 @@
* @static
*/
function setParameter($pluginType, $pluginId, $parameterName, $parameterValue, $itemId=0) {
+ global $gallery;
+
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('setParameter %s for %s plugin', $parameterName, $pluginId));
+ }
+
if (empty($pluginType) || empty($pluginId) || empty($parameterName)) {
return GalleryStatus::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__);
}
@@ -363,6 +369,11 @@
'itemId' => $itemId,
'id' => $pluginId));
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Plugin parameter %s for %s plugin set successfully',
+ $parameterName, $pluginId));
+ }
+
return GalleryStatus::success();
}
Index: modules/core/classes/helpers/GalleryPluginHelper_simple.class
===================================================================
RCS file: /cvsroot/gallery/gallery2/modules/core/classes/helpers/GalleryPluginHelper_simple.class,v
retrieving revision 1.28
diff -u -w -r1.28 GalleryPluginHelper_simple.class
--- modules/core/classes/helpers/GalleryPluginHelper_simple.class 9 Jul 2005 05:44:21 -0000 1.28
+++ modules/core/classes/helpers/GalleryPluginHelper_simple.class 4 Aug 2005 15:15:24 -0000
@@ -47,6 +47,10 @@
function loadPlugin($pluginType, $pluginId, $ignoreVersionMismatch=false, $depth=0) {
global $gallery;
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Loading plugin %s', $pluginId));
+ }
+
$cacheKey = "GalleryPluginHelper::loadPlugin($pluginType, $pluginId)";
if (!GalleryDataCache::containsKey($cacheKey)) {
@@ -67,6 +71,10 @@
}
if (!class_exists($pluginClass)) {
+ if ($gallery->getDebug()) {
+ $gallery->debug('Class not defined, trying to include it.');
+ }
+
$pluginBaseDir = dirname(__FILE__) . '/../../../../';
$pluginFile = sprintf('%ss/%s/%s.inc', $pluginType, $pluginId, $pluginType);
@@ -113,7 +121,15 @@
$plugin = GalleryDataCache::get($cacheKey);
}
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('%s plugin successfully instantiated', $pluginId));
+ }
+
if (!$ignoreVersionMismatch) {
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Check the version of the %s plugin', $pluginId));
+ }
+
/* Verify that the versions match */
list ($ret, $status) = GalleryPluginHelper_simple::fetchPluginStatus($pluginType);
if ($ret->isError()) {
@@ -171,6 +187,9 @@
$plugin);
}
}
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('The version of the %s plugin is ok', $pluginId));
+ }
}
return array(GalleryStatus::success(), $plugin);
@@ -207,6 +226,11 @@
* @static
*/
function getParameter($pluginType, $pluginId, $parameterName, $itemId=0) {
+ global $gallery;
+
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('getParameter %s for %s plugin', $parameterName, $pluginId));
+ }
/* Convert null to 0, just in case */
if ($itemId == null) {
Index: themes/matrix/theme.inc
===================================================================
RCS file: /cvsroot/gallery/gallery2/themes/matrix/theme.inc,v
retrieving revision 1.34
diff -u -w -r1.34 theme.inc
--- themes/matrix/theme.inc 29 Jul 2005 00:15:01 -0000 1.34
+++ themes/matrix/theme.inc 4 Aug 2005 15:16:09 -0000
@@ -145,8 +145,12 @@
* @see GalleryTheme::upgrade
*/
function upgrade($installedVersion) {
+ global $gallery;
+
if (version_compare($installedVersion, '0.9.7', '<')) {
/* Older than the big theme changeover. Set some default blocks */
+ $gallery->debug('Matrix theme upgrade to the new theme system');
+
foreach (array(
'sidebarBlocks' => serialize(
array(
@@ -169,6 +173,11 @@
$installedVersion = '0.9.7';
}
+ if ($gallery->getDebug()) {
+ $gallery->debug(sprintf('Matrix theme upgrade, installed version is %s',
+ $installedVersion));
+ }
+
switch ($installedVersion) {
case '0.9.7':
$ret = $this->setParameter('colorpack', '');