Author: jablko
Date: Wed Sep 23 14:38:17 2009
New Revision: 3480
Log:
Add comments -- force
Modified:
trunk/plugins/sfInstallPlugin/config/sfInstallPluginConfiguration.class.php
Modified:
trunk/plugins/sfInstallPlugin/config/sfInstallPluginConfiguration.class.php
==============================================================================
--- trunk/plugins/sfInstallPlugin/config/sfInstallPluginConfiguration.class.php
Wed Sep 23 13:38:02 2009 (r3479)
+++ trunk/plugins/sfInstallPlugin/config/sfInstallPluginConfiguration.class.php
Wed Sep 23 14:38:17 2009 (r3480)
@@ -35,6 +35,7 @@
*/
public function initialize()
{
+ // Setup for test if this is the install.php front controller
foreach (array('SCRIPT_NAME', 'ORIG_SCRIPT_NAME') as $key)
{
if (isset($_SERVER[$key]))
@@ -53,6 +54,10 @@
if ($installScriptName == $scriptName)
{
+ // The install.php front controller avoids throwing an exception if
+ // databases.yml doesn't exist. It connects an event listener which trys
+ // to make a database connection if possible, but continues without one
+ // if not.
if (sfConfig::get('sf_use_database'))
{
$this->dispatcher->connect('context.load_factories', array($this,
'contextLoadFactories'));
@@ -63,6 +68,8 @@
}
else
{
+ // All other front controllers test that a database connection can be
+ // made and redirect to the install.php front controller if not
if (sfConfig::get('sf_use_database'))
{
try
@@ -74,15 +81,18 @@
$installUrl = $installScriptName.'/sfInstallPlugin';
header('Location: '.$installUrl);
+
echo '<html><head><meta http-equiv="refresh"
content="0;url='.htmlspecialchars($installUrl, ENT_QUOTES,
sfConfig::get('sf_charset')).'" /></head></html>';
}
}
}
+ // Enable sfInstallPlugin module
$enabledModules = sfConfig::get('sf_enabled_modules');
$enabledModules[] = 'sfInstallPlugin';
sfConfig::set('sf_enabled_modules', $enabledModules);
+ // Connect event listener to add routes
$this->dispatcher->connect('routing.load_configuration', array($this,
'routingLoadConfiguration'));
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---