Skip to content

Commit

Permalink
Changing references from core.php to new config files.
Browse files Browse the repository at this point in the history
  • Loading branch information
renan committed Nov 6, 2012
1 parent 0982445 commit 65684cd
Show file tree
Hide file tree
Showing 17 changed files with 110 additions and 67 deletions.
4 changes: 2 additions & 2 deletions App/View/Pages/home.ctp
Expand Up @@ -85,7 +85,7 @@ endif;
$settings = Cache::settings('_cake_model_');
if (!empty($settings)):
echo '<span class="notice success">';
echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit APP/Config/cache.php ', '<em>'. $settings['engine'] . 'Engine</em>');
echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit APP/Config/cache.php', '<em>'. $settings['engine'] . 'Engine</em>');
echo '</span>';
else:
echo '<span class="notice">';
Expand All @@ -104,7 +104,7 @@ endif;
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Your datasouces 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/datasources.default.php to APP/Config/datasources.php');
echo '</span>';
Expand Down
4 changes: 2 additions & 2 deletions index.php
Expand Up @@ -4,8 +4,8 @@
*
* This file collects requests if:
* - no mod_rewrite is available or .htaccess files are not supported
* - requires App.baseUrl to be uncommented in app/Config/core.php
* - app/webroot is not set as a document root.
* - requires App.baseUrl to be uncommented in App/Config/app.php
* - App/webroot is not set as a document root.
*
* PHP 5
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Command/BakeShell.php
Expand Up @@ -216,7 +216,7 @@ public function getOptionParser() {
'help' => __d('cake_console', 'Bake a new plugin folder in the path supplied or in current directory if no path is specified.'),
'parser' => $this->Plugin->getOptionParser()
))->addSubcommand('db_config', array(
'help' => __d('cake_console', 'Bake a database.php file in config directory.'),
'help' => __d('cake_console', 'Bake a datasources.php file in config directory.'),
'parser' => $this->DbConfig->getOptionParser()
))->addSubcommand('model', array(
'help' => __d('cake_console', 'Bake a model.'),
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Console/Command/Task/DbConfigTask.php
@@ -1,6 +1,6 @@
<?php
/**
* The DbConfig Task handles creating and updating the database.php
* The DbConfig Task handles creating and updating the datasources.php
*
* PHP 5
*
Expand Down Expand Up @@ -246,7 +246,7 @@ protected function _verify($config) {
}

/**
* Assembles and writes database.php
* Assembles and writes datasources.php
*
* @param array $configs Configuration settings to use
* @return boolean Success
Expand All @@ -257,7 +257,7 @@ public function bake($configs) {
return false;
}

$filename = $this->path . 'database.php';
$filename = $this->path . 'datasources.php';
$oldConfigs = array();

if (file_exists($filename)) {
Expand Down Expand Up @@ -344,7 +344,7 @@ public function bake($configs) {
}

$out .= "}\n";
$filename = $this->path . 'database.php';
$filename = $this->path . 'datasources.php';
return $this->createFile($filename, $out);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Console/Templates/skel/View/Pages/home.ctp
Expand Up @@ -85,7 +85,7 @@ endif;
$settings = Cache::settings('_cake_model_');
if (!empty($settings)):
echo '<span class="notice success">';
echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit APP/Config/cache.php ', '<em>'. $settings['engine'] . 'Engine</em>');
echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit APP/Config/cache.php', '<em>'. $settings['engine'] . 'Engine</em>');
echo '</span>';
else:
echo '<span class="notice">';
Expand All @@ -104,7 +104,7 @@ endif;
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Your datasouces 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/datasources.default.php to APP/Config/datasources.php');
echo '</span>';
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Controller/Component/AclComponent.php
Expand Up @@ -29,8 +29,8 @@
* Access Control List factory class.
*
* Uses a strategy pattern to allow custom ACL implementations to be used with the same component interface.
* You can define by changing `Configure::write('Acl.classname', 'DbAcl');` in your core.php. Concrete ACL
* implementations should extend `AclBase` and implement the methods it defines.
* You can define by changing `Configure::write('Acl.classname', 'DbAcl');` in your App/Config/acl.php.
* Concrete ACL implementations should extend `AclBase` and implement the methods it defines.
*
* @package Cake.Controller.Component
* @link http://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Error/ErrorHandler.php
Expand Up @@ -68,15 +68,15 @@
* #### Logging exceptions
*
* Using the built-in exception handling, you can log all the exceptions
* that are dealt with by ErrorHandler by setting `Exception.log` to true in your core.php.
* that are dealt with by ErrorHandler by setting `Exception.log` to true in your App/Config/error.php.
* Enabling this will log every exception to Log and the configured loggers.
*
* ### PHP errors
*
* Error handler also provides the built in features for handling php errors (trigger_error).
* While in debug mode, errors will be output to the screen using debugger. While in production mode,
* errors will be logged to Log. You can control which errors are logged by setting
* `Error.level` in your core.php.
* `Error.level` in your App/Config/error.php.
*
* #### Logging errors
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Error/ExceptionRenderer.php
Expand Up @@ -54,7 +54,7 @@
* #### Using a subclass of ExceptionRenderer
*
* Using a subclass of ExceptionRenderer gives you full control over how Exceptions are rendered, you
* can configure your class in your core.php, with `Configure::write('Exception.renderer', 'MyClass');`
* can configure your class in your App/Config/error.php, with `Configure::write('Exception.renderer', 'MyClass');`
* You should place any custom exception renderers in `app/Lib/Error`.
*
* @package Cake.Error
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';

}
4 changes: 2 additions & 2 deletions lib/Cake/Model/Model.php
Expand Up @@ -52,7 +52,7 @@ class Model extends Object implements EventListener {
/**
* The name of the DataSource connection that this Model uses
*
* The value must be an attribute name that you defined in `app/Config/database.php`
* The value must be an attribute name that you defined in `App/Config/datasources.php`
* or created using `ConnectionManager::create()`.
*
* @var string
Expand Down Expand Up @@ -3187,7 +3187,7 @@ public function getAffectedRows() {
/**
* Sets the DataSource to which this model is bound.
*
* @param string $dataSource The name of the DataSource, as defined in app/Config/database.php
* @param string $dataSource The name of the DataSource, as defined in App/Config/datasources.php
* @return void
* @throws MissingConnectionException
*/
Expand Down
98 changes: 69 additions & 29 deletions lib/Cake/Test/TestApp/View/Pages/home.ctp
Expand Up @@ -15,14 +15,58 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
use Cake\Routing\Dispatcher,
Cake\Cache\Cache,
Cake\Model\ConnectionManager,
Cake\Utility\Validation,
Cake\Core\Configure;
use Cake\Core\Configure;
use Cake\Utility\Debugger;
use Cake\Cache\Cache;
use Cake\Model\ConnectionManager;
use Cake\Utility\Validation;
use Cake\Error;

if (Configure::read('debug') == 0):
throw new Error\NotFoundException();
endif;
?>
<iframe src="http://cakephp.org/bake-banner" width="830" height="160" style="overflow:hidden; border:none;">
<p>For updates and important announcements, visit http://cakefest.org</p>
</iframe>
<h2><?php echo __d('cake_dev', 'Release Notes for CakePHP %s.', Configure::version()); ?></h2>
<a href="http://cakephp.org/changelogs/1.3.6"><?php echo __d('cake_dev', 'Read the changelog'); ?> </a>
<a href="http://cakephp.org/changelogs/<?php echo Configure::version(); ?>"><?php echo __d('cake_dev', 'Read the changelog'); ?> </a>
<?php
if (Configure::read('debug') > 0):
// Debugger::checkSecurityKeys();
endif;
?>
<p id="url-rewriting-warning" style="background-color:#e32; color:#fff;">
<?php echo __d('cake_dev', 'URL rewriting is not properly configured on your server.'); ?>
1) <a target="_blank" href="http://book.cakephp.org/2.0/en/installation/advanced-installation.html#apache-and-mod-rewrite-and-htaccess" style="color:#fff;">Help me configure it</a>
2) <a target="_blank" href="http://book.cakephp.org/2.0/en/development/configuration.html#cakephp-core-configuration" style="color:#fff;">I don't / can't use URL rewriting</a>
</p>
<p>
<?php
if (version_compare(PHP_VERSION, '5.4.3', '>=')):
echo '<span class="notice success">';
echo __d('cake_dev', 'Your version of PHP is 5.4.3 or higher.');
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.4.3 or higher to use CakePHP.');
echo '</span>';
endif;
?>
</p>
<p>
<?php
if (extension_loaded('mbstring')):
echo '<span class="notice success">';
echo __d('cake_dev', 'Your version of PHP has mbstring extension loaded.');
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Your version of PHP does NOT have the mbstring extension loaded.');
echo '</span>';
endif;
?>
</p>
<p>
<?php
if (is_writable(TMP)):
Expand All @@ -38,31 +82,31 @@ use Cake\Routing\Dispatcher,
</p>
<p>
<?php
$settings = Cache::settings();
$settings = Cache::settings('_cake_model_');
if (!empty($settings)):
echo '<span class="notice success">';
echo __d('cake_dev', 'The %s is being used for caching. To change the config edit APP/config/core.php ', '<em>'. $settings['engine'] . 'Engine</em>');
echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit APP/Config/cache.php', '<em>'. $settings['engine'] . 'Engine</em>');
echo '</span>';
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in APP/config/core.php');
echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in APP/Config/cache.php');
echo '</span>';
endif;
?>
</p>
<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 config/database.php.default to config/database.php');
echo __d('cake_dev', 'Rename APP/Config/datasources.default.php to APP/Config/datasources.php');
echo '</span>';
endif;
?>
Expand All @@ -71,7 +115,7 @@ use Cake\Routing\Dispatcher,
if (isset($filePresent)):
try {
$connected = ConnectionManager::getDataSource('default');
} catch (Exception $e) {
} catch (Exception $connectionError) {
$connected = false;
}
?>
Expand All @@ -84,6 +128,8 @@ if (isset($filePresent)):
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Cake is NOT able to connect to the database.');
echo '<br /><br />';
echo $connectionError->getMessage();
echo '</span>';
endif;
?>
Expand All @@ -92,17 +138,17 @@ if (isset($filePresent)):
<?php
if (!Validation::alphaNumeric('cakephp')) {
echo '<p><span class="notice">';
__('PCRE has not been compiled with Unicode support.');
echo '<br/>';
__('Recompile PCRE with Unicode support by adding <code>--enable-unicode-properties</code> when configuring');
echo __d('cake_dev', 'PCRE has not been compiled with Unicode support.');
echo '<br/>';
echo __d('cake_dev', 'Recompile PCRE with Unicode support by adding <code>--enable-unicode-properties</code> when configuring');
echo '</span></p>';
}
?>
<h3><?php echo __d('cake_dev', 'Editing this Page'); ?></h3>
<p>
<?php
echo __d('cake_dev', 'To change the content of this page, create: APP/views/pages/home.ctp.<br />
To change its layout, create: APP/views/layouts/default.ctp.<br />
echo __d('cake_dev', 'To change the content of this page, edit: APP/View/Pages/home.ctp.<br />
To change its layout, edit: APP/View/Layouts/default.ctp.<br />
You can also add some CSS styles for your pages at: APP/webroot/css.');
?>
</p>
Expand All @@ -111,8 +157,8 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<p>
<?php
echo $this->Html->link(
sprintf('<strong>%s</strong> %s', __d('cake_dev', 'New'), __d('cake_dev', 'CakePHP 1.3 Docs')),
'http://book.cakephp.org/view/875/x1-3-Collection',
sprintf('<strong>%s</strong> %s', __d('cake_dev', 'New'), __d('cake_dev', 'CakePHP 2.0 Docs')),
'http://book.cakephp.org/2.0/en/',
array('target' => '_blank', 'escape' => false)
);
?>
Expand All @@ -121,7 +167,7 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<?php
echo $this->Html->link(
__d('cake_dev', 'The 15 min Blog Tutorial'),
'http://book.cakephp.org/view/1528/Blog',
'http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html',
array('target' => '_blank', 'escape' => false)
);
?>
Expand All @@ -142,7 +188,7 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<ul><li><?php echo __d('cake_dev', 'The Rapid Development Framework'); ?></li></ul></li>
<li><a href="http://book.cakephp.org"><?php echo __d('cake_dev', 'CakePHP Documentation'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Your Rapid Development Cookbook'); ?></li></ul></li>
<li><a href="http://api.cakephp.org"><?php echo __d('cake_dev', 'CakePHP API'); ?> </a>
<li><a href="http://api20.cakephp.org"><?php echo __d('cake_dev', 'CakePHP API'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Quick Reference'); ?></li></ul></li>
<li><a href="http://bakery.cakephp.org"><?php echo __d('cake_dev', 'The Bakery'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Everything CakePHP'); ?></li></ul></li>
Expand All @@ -156,10 +202,4 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<ul><li><?php echo __d('cake_dev', 'For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li>
<li><a href="http://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li>
<li><a href="http://www.cakeforge.org"><?php echo __d('cake_dev', 'CakeForge'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Open Development for CakePHP'); ?></li></ul></li>
<li><a href="http://astore.amazon.com/cakesoftwaref-20/"><?php echo __d('cake_dev', 'Book Store'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Recommended Software Books'); ?></li></ul></li>
<li><a href="http://www.cafepress.com/cakefoundation"><?php echo __d('cake_dev', 'CakePHP gear'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li>
</ul>
10 changes: 5 additions & 5 deletions lib/Cake/Test/TestApp/View/Posts/test_nocache_tags.ctp
Expand Up @@ -41,7 +41,7 @@ use Cake\Core\Configure;
echo __d('cake', 'set up and initialized properly.');
$settings = Cache::settings();
echo '<p>' . $settings['engine'];
echo __d('cake', ' is being used to cache, to change this edit config/core.php ');
echo __d('cake', ' is being used to cache, to change this edit App/Config/cache.php ');
echo '</p>';

echo 'Settings: <ul>';
Expand All @@ -57,7 +57,7 @@ use Cake\Core\Configure;
echo __d('cake', 'NOT working.');
echo '<br />';
if (is_writable(TMP)):
echo __d('cake', 'Edit: config/core.php to insure you have the newset version of this file and the variable $cakeCache set properly');
echo __d('cake', 'Edit: App/Config/cache.php to insure you have the newset version of this file and the variable $cakeCache set properly');
endif;
endif;
?>
Expand All @@ -66,15 +66,15 @@ use Cake\Core\Configure;
<p>
<span class="notice">
<?php
echo __d('cake', 'Your database configuration file is ');
echo __d('cake', 'Your datasources configuration file is ');
$filePresent = null;
if (file_exists(APP . 'Config'.'database.php')):
if (file_exists(APP . 'Config'.'datasources.php')):
echo __d('cake', 'present.');
$filePresent = true;
else:
echo __d('cake', 'NOT present.');
echo '<br/>';
echo __d('cake', 'Rename config/database.php.default to config/database.php');
echo __d('cake', 'Rename App/Config/datasources.default.php to App/Config/datasources.php');
endif;
?>
</span>
Expand Down

0 comments on commit 65684cd

Please sign in to comment.