Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update home.ctp, rename SQLDialect and remove database.default.php
  • Loading branch information
ceeram committed Jan 29, 2013
1 parent fa5733e commit 5e64649
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 96 deletions.
85 changes: 0 additions & 85 deletions App/Config/database.php.default

This file was deleted.

16 changes: 9 additions & 7 deletions App/View/Pages/home.ctp
Expand Up @@ -18,7 +18,7 @@
use Cake\Core\Configure;
use Cake\Utility\Debugger;
use Cake\Cache\Cache;
use Cake\Model\ConnectionManager;
use Cake\Model\Datasource\Database\Connection;
use Cake\Utility\Validation;
use Cake\Error;

Expand Down Expand Up @@ -97,31 +97,33 @@ endif;
<p>
<?php
$filePresent = null;
if (file_exists(APP . 'Config/database.php')):
if (file_exists(APP . 'Config/datasources.php')):
echo '<span class="notice success">';
echo __d('cake_dev', 'Your database configuration file is present.');
echo __d('cake_dev', 'Your datasources configuration file is present.');
$filePresent = true;
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Your database configuration file is NOT present.');
echo __d('cake_dev', 'Your datasources configuration file is NOT present.');
echo '<br/>';
echo __d('cake_dev', 'Rename APP/Config/database.php.default to APP/Config/database.php');
echo __d('cake_dev', 'Rename APP/Config/datasources.default.php to APP/Config/datasources.php');
echo '</span>';
endif;
?>
</p>
<?php
if (isset($filePresent)):
try {
$connected = ConnectionManager::getDataSource('default');
require APP . 'Config/datasources.php';
$connection = new Connection(Configure::read('Datasource.default'));
$connected = $connection->connect();
} catch (Exception $connectionError) {
$connected = false;
}
?>
<p>
<?php
if ($connected && $connected->isConnected()):
if ($connected):
echo '<span class="notice success">';
echo __d('cake_dev', 'Cake is able to connect to the database.');
echo '</span>';
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Error/MissingDatasourceConfigException.php
Expand Up @@ -25,6 +25,6 @@
*/
class MissingDatasourceConfigException extends Exception {

protected $_messageTemplate = 'The datasource configuration "%s" was not found in database.php';
protected $_messageTemplate = 'The datasource configuration "%s" was not found in datasources.php';

}
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Driver.php
Expand Up @@ -30,7 +30,7 @@ public abstract function disconnect();

/**
* Returns correct connection resource or object that is internally used
* If first argument is passed,
* If first argument is passed,
*
* @return void
**/
Expand Down
@@ -1,6 +1,6 @@
<?php
/**
*
*
* PHP Version 5.4
*
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
Expand All @@ -17,7 +17,7 @@
*/
namespace Cake\Model\Datasource\Database;

trait SQLDialect {
trait SqlDialect {

/**
* String used to start a database identifier quoting to make it safe
Expand Down

0 comments on commit 5e64649

Please sign in to comment.