Skip to content

Commit

Permalink
Merge commit 'kawahara/t518'
Browse files Browse the repository at this point in the history
  • Loading branch information
kawahara committed Feb 10, 2010
2 parents fa7afb4 + d568783 commit 218fd81
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions lib/task/opPluginInstallTask.class.php
Expand Up @@ -56,6 +56,22 @@ protected function createConfiguration($application, $env)
return $configuration;
}

protected function isSnsConfigTableExists()
{
try
{
if (class_exists('SnsConfigTable'))
{
return Doctrine_Manager::connection()
->import
->tableExists(Doctrine::getTable('SnsConfig')->getTableName());
}
}
catch (Doctrine_Connection_Exception $e) { }

return false;
}

protected function execute($arguments = array(), $options = array())
{
// Remove E_STRICT and E_DEPRECATED from error_reporting
Expand Down Expand Up @@ -89,18 +105,17 @@ protected function execute($arguments = array(), $options = array())
if (count(sfFinder::type('file')->name('databases.yml')->in(sfConfig::get('sf_config_dir'))) && !$isExists)
{
$databaseManager = new sfDatabaseManager($this->configuration);
Doctrine::getTable('SnsConfig')->set($arguments['name'].'_needs_data_load', '1');
if ($this->isSnsConfigTableExists())
{
Doctrine::getTable('SnsConfig')->set($arguments['name'].'_needs_data_load', '1');
}
}
}
catch (sfPluginException $e)
{
$this->logBlock($e->getMessage(), 'ERROR');
return false;
}
catch (Doctrine_Connection_Exception $e)
{
$this->logBlock($e->getMessage(), 'COMMENT');
}
}

public function getPluginManager($channel = null)
Expand Down

0 comments on commit 218fd81

Please sign in to comment.