diff --git a/app/Config/Schema/i18n.php b/app/Config/Schema/i18n.php index c876f1b1a..3176aa2f0 100644 --- a/app/Config/Schema/i18n.php +++ b/app/Config/Schema/i18n.php @@ -29,10 +29,22 @@ class I18nSchema extends CakeSchema { public $name = 'i18n'; +/** + * Before callback. + * + * @param array $event Schema object properties + * @return boolean Should process continue + */ public function before($event = array()) { return true; } +/** + * After callback. + * + * @param array $event Schema object properties + * @return void + */ public function after($event = array()) { } diff --git a/app/Config/Schema/sessions.php b/app/Config/Schema/sessions.php index 14ff2c6d4..6157c34e7 100644 --- a/app/Config/Schema/sessions.php +++ b/app/Config/Schema/sessions.php @@ -28,10 +28,22 @@ class SessionsSchema extends CakeSchema { public $name = 'Sessions'; +/** + * Before callback. + * + * @param array $event Schema object properties + * @return boolean Should process continue + */ public function before($event = array()) { return true; } +/** + * After callback. + * + * @param array $event Schema object properties + * @return void + */ public function after($event = array()) { } diff --git a/app/View/Emails/html/default.ctp b/app/View/Emails/html/default.ctp index 63874c1cc..7588ed31c 100644 --- a/app/View/Emails/html/default.ctp +++ b/app/View/Emails/html/default.ctp @@ -20,4 +20,3 @@ $content = explode("\n", $content); foreach ($content as $line): echo '

' . $line . "

\n"; endforeach; -?> \ No newline at end of file diff --git a/app/View/Emails/text/default.ctp b/app/View/Emails/text/default.ctp index 7f8832498..b5a370af4 100644 --- a/app/View/Emails/text/default.ctp +++ b/app/View/Emails/text/default.ctp @@ -14,4 +14,4 @@ * @license http://www.opensource.org/licenses/mit-license.php MIT License */ ?> - \ No newline at end of file + 0): echo $this->element('exception_stack_trace'); endif; -?> diff --git a/app/View/Errors/error500.ctp b/app/View/Errors/error500.ctp index e36b5033a..1f54bf8c3 100644 --- a/app/View/Errors/error500.ctp +++ b/app/View/Errors/error500.ctp @@ -23,4 +23,3 @@ if (Configure::read('debug') > 0): echo $this->element('exception_stack_trace'); endif; -?> diff --git a/app/View/Layouts/Emails/html/default.ctp b/app/View/Layouts/Emails/html/default.ctp index 8e5d62c8d..fee3c386e 100644 --- a/app/View/Layouts/Emails/html/default.ctp +++ b/app/View/Layouts/Emails/html/default.ctp @@ -17,7 +17,7 @@ - <?php echo $title_for_layout; ?> + <?php echo $this->fetch('title'); ?> fetch('content'); ?> diff --git a/app/View/Layouts/ajax.ctp b/app/View/Layouts/ajax.ctp index 38b16b00f..e5d30a848 100644 --- a/app/View/Layouts/ajax.ctp +++ b/app/View/Layouts/ajax.ctp @@ -14,4 +14,4 @@ * @license http://www.opensource.org/licenses/mit-license.php MIT License */ ?> -fetch('content'); ?> +fetch('content'); diff --git a/app/View/Layouts/default.ctp b/app/View/Layouts/default.ctp index 79241d115..fb4e9f36e 100644 --- a/app/View/Layouts/default.ctp +++ b/app/View/Layouts/default.ctp @@ -23,7 +23,7 @@ $cakeVersion = __d('cake_dev', 'CakePHP %s', Configure::version()) Html->charset(); ?> <?php echo $cakeDescription ?>: - <?php echo $title_for_layout; ?> + <?php echo $this->fetch('title'); ?> Html->meta('icon'); diff --git a/app/View/Layouts/error.ctp b/app/View/Layouts/error.ctp index c0bcf7b64..852e3f386 100644 --- a/app/View/Layouts/error.ctp +++ b/app/View/Layouts/error.ctp @@ -22,7 +22,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework Html->charset(); ?> <?php echo $cakeDescription ?>: - <?php echo $title_for_layout; ?> + <?php echo $this->fetch('title'); ?> Html->meta('icon'); diff --git a/app/View/Layouts/flash.ctp b/app/View/Layouts/flash.ctp index b93b155e8..1b9951f38 100644 --- a/app/View/Layouts/flash.ctp +++ b/app/View/Layouts/flash.ctp @@ -18,11 +18,13 @@ Html->charset(); ?> -<?php echo $page_title; ?> +<?php echo $pageTitle; ?> - - - +', $pause, $url); +endif; +?> -

+

+ Html->link($message, $url); ?> +

diff --git a/app/View/Layouts/js/default.ctp b/app/View/Layouts/js/default.ctp index 7239b5dae..f694538e4 100644 --- a/app/View/Layouts/js/default.ctp +++ b/app/View/Layouts/js/default.ctp @@ -1,2 +1,2 @@ - +fetch('script'); ?> diff --git a/app/View/Layouts/rss/default.ctp b/app/View/Layouts/rss/default.ctp index 26d875eda..60a53659f 100644 --- a/app/View/Layouts/rss/default.ctp +++ b/app/View/Layouts/rss/default.ctp @@ -3,7 +3,7 @@ if (!isset($channel)): $channel = array(); endif; if (!isset($channel['title'])): - $channel['title'] = $title_for_layout; + $channel['title'] = $this->fetch('title'); endif; echo $this->Rss->document( @@ -11,4 +11,3 @@ echo $this->Rss->document( array(), $channel, $this->fetch('content') ) ); -?> diff --git a/app/View/Layouts/xml/default.ctp b/app/View/Layouts/xml/default.ctp index fbd5ee0c3..80a4d65f0 100644 --- a/app/View/Layouts/xml/default.ctp +++ b/app/View/Layouts/xml/default.ctp @@ -1 +1 @@ -fetch('content'); ?> +fetch('content'); diff --git a/app/View/Pages/home.ctp b/app/View/Pages/home.ctp index 0a028702e..c3f98b106 100644 --- a/app/View/Pages/home.ctp +++ b/app/View/Pages/home.ctp @@ -13,79 +13,75 @@ App::uses('Debugger', 'Utility'); ?>

- + Html->link(__d('cake_dev', 'Read the changelog'), 'http://cakephp.org/changelogs/' . Configure::version()); ?>

0): Debugger::checkSecurityKeys(); endif; ?> - -

- - 1) Help me configure it - 2) I don't / can't use URL rewriting -

- + +

+ + 1) Help me configure it + 2) I don't / can't use URL rewriting +

+

=')): +if (version_compare(PHP_VERSION, '5.2.8', '>=')): + echo ''; + echo __d('cake_dev', 'Your version of PHP is 5.2.8 or higher.'); + echo ''; +else: + echo ''; + echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.8 or higher to use CakePHP.'); + echo ''; +endif; +?> +

+

+ '; - echo __d('cake_dev', 'Your version of PHP is 5.2.8 or higher.'); + echo __d('cake_dev', 'Your tmp directory is writable.'); echo ''; else: echo ''; - echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.8 or higher to use CakePHP.'); + echo __d('cake_dev', 'Your tmp directory is NOT writable.'); echo ''; endif; -?> -

-

- '; - echo __d('cake_dev', 'Your tmp directory is writable.'); - echo ''; - else: - echo ''; - echo __d('cake_dev', 'Your tmp directory is NOT writable.'); - echo ''; - endif; ?>

'; - echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', ''. $settings['engine'] . 'Engine', 'APP/Config/core.php'); - echo ''; - else: - echo ''; - echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in %s', 'APP/Config/core.php'); - echo ''; - endif; + $settings = Cache::settings(); + if (!empty($settings)): + echo ''; + echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', '' . $settings['engine'] . 'Engine', 'APP/Config/core.php'); + echo ''; + else: + echo ''; + echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in %s', 'APP/Config/core.php'); + echo ''; + endif; ?>

'; - echo __d('cake_dev', 'Your database configuration file is present.'); - $filePresent = true; - echo ''; - else: - echo ''; - echo __d('cake_dev', 'Your database configuration file is NOT present.'); - echo '
'; - echo __d('cake_dev', 'Rename %s to %s', 'APP/Config/database.php.default', 'APP/Config/database.php'); - echo '
'; - endif; + $filePresent = null; + if (file_exists(APP . 'Config' . DS . 'database.php')): + echo ''; + echo __d('cake_dev', 'Your database configuration file is present.'); + $filePresent = true; + echo ''; + else: + echo ''; + echo __d('cake_dev', 'Your database configuration file is NOT present.'); + echo '
'; + echo __d('cake_dev', 'Rename %s to %s', 'APP/Config/database.php.default', 'APP/Config/database.php'); + echo '
'; + endif; ?>

-

- isConnected()): - echo ''; - echo __d('cake_dev', 'CakePHP is able to connect to the database.'); - echo ''; - else: - echo ''; - echo __d('cake_dev', 'CakePHP is NOT able to connect to the database.'); - echo '

'; - echo $errorMsg; - echo '
'; - endif; ?> -

- +

+ isConnected()): + echo ''; + echo __d('cake_dev', 'CakePHP is able to connect to the database.'); + echo ''; + else: + echo ''; + echo __d('cake_dev', 'CakePHP is NOT able to connect to the database.'); + echo '

'; + echo $errorMsg; + echo '
'; + endif; + ?> +

'; - echo __d('cake_dev', 'PCRE has not been compiled with Unicode support.'); - echo '
'; - echo __d('cake_dev', 'Recompile PCRE with Unicode support by adding --enable-unicode-properties when configuring'); - echo '

'; - endif; +endif; + +App::uses('Validation', 'Utility'); +if (!Validation::alphaNumeric('cakephp')): + echo '

'; + echo __d('cake_dev', 'PCRE has not been compiled with Unicode support.'); + echo '
'; + echo __d('cake_dev', 'Recompile PCRE with Unicode support by adding --enable-unicode-properties when configuring'); + echo '

'; +endif; ?>

'; - echo __d('cake_dev', 'DebugKit plugin is present'); - echo ''; - else: - echo ''; - echo __d('cake_dev', 'DebugKit is not installed. It will help you inspect and debug different aspects of your application.'); - echo '
'; - echo __d('cake_dev', 'You can install it from %s', $this->Html->link('GitHub', 'https://github.com/cakephp/debug_kit')); - echo '
'; - endif; + if (CakePlugin::loaded('DebugKit')): + echo ''; + echo __d('cake_dev', 'DebugKit plugin is present'); + echo ''; + else: + echo ''; + echo __d('cake_dev', 'DebugKit is not installed. It will help you inspect and debug different aspects of your application.'); + echo '
'; + echo __d('cake_dev', 'You can install it from %s', $this->Html->link('GitHub', 'https://github.com/cakephp/debug_kit')); + echo '
'; + endif; ?>

@@ -160,20 +157,20 @@ You can also add some CSS styles for your pages at: %s.',

Html->link( - sprintf('%s %s', __d('cake_dev', 'New'), __d('cake_dev', 'CakePHP 2.0 Docs')), - 'http://book.cakephp.org/2.0/en/', - array('target' => '_blank', 'escape' => false) - ); + echo $this->Html->link( + sprintf('%s %s', __d('cake_dev', 'New'), __d('cake_dev', 'CakePHP 2.0 Docs')), + 'http://book.cakephp.org/2.0/en/', + array('target' => '_blank', 'escape' => false) + ); ?>

Html->link( - __d('cake_dev', 'The 15 min Blog Tutorial'), - 'http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html', - array('target' => '_blank', 'escape' => false) - ); + echo $this->Html->link( + __d('cake_dev', 'The 15 min Blog Tutorial'), + 'http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html', + array('target' => '_blank', 'escape' => false) + ); ?>

diff --git a/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp index 771865397..e6e63cab8 100644 --- a/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp +++ b/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp @@ -9,7 +9,7 @@ Html->charset(); ?> -<?php echo $page_title; ?> +<?php echo $pageTitle; ?> diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index 17016971a..6727434ae 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -1004,7 +1004,7 @@ class Controller extends Object implements CakeEventListener { $this->set('url', Router::url($url)); $this->set('message', $message); $this->set('pause', $pause); - $this->set('page_title', $message); + $this->set('pageTitle', $message); $this->render(false, $layout); } diff --git a/lib/Cake/Test/Case/View/ViewTest.php b/lib/Cake/Test/Case/View/ViewTest.php index 29b543695..4f1c1d65b 100644 --- a/lib/Cake/Test/Case/View/ViewTest.php +++ b/lib/Cake/Test/Case/View/ViewTest.php @@ -1020,7 +1020,7 @@ class ViewTest extends CakeTestCase { $this->PostsController->set('url', 'flash'); $this->PostsController->set('message', 'yo what up'); $this->PostsController->set('pause', 3); - $this->PostsController->set('page_title', 'yo what up'); + $this->PostsController->set('pageTitle', 'yo what up'); $View = new TestView($this->PostsController); $result = $View->render(false, 'flash'); diff --git a/lib/Cake/Test/test_app/View/Layouts/flash.ctp b/lib/Cake/Test/test_app/View/Layouts/flash.ctp index aa1c74438..2314363eb 100644 --- a/lib/Cake/Test/test_app/View/Layouts/flash.ctp +++ b/lib/Cake/Test/test_app/View/Layouts/flash.ctp @@ -1,7 +1,7 @@ -<?php echo $page_title?> +<?php echo $pageTitle?> Html->charset(); ?> @@ -16,4 +16,4 @@ A:HOVER { text-decoration: underline; color:#44E }

- \ No newline at end of file +