Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update home.ctp, rename SQLDialect and remove database.default.php #1097

Merged
merged 1 commit into from Jan 29, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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