home.ctp 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <?php
  2. /**
  3. *
  4. * PHP 5
  5. *
  6. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  7. * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  8. *
  9. * Licensed under The MIT License
  10. * Redistributions of files must retain the above copyright notice.
  11. *
  12. * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  13. * @link http://cakephp.org CakePHP(tm) Project
  14. * @package Cake.View.Pages
  15. * @since CakePHP(tm) v 0.10.0.1076
  16. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  17. */
  18. if (!Configure::read('debug')):
  19. throw new NotFoundException();
  20. endif;
  21. App::uses('Debugger', 'Utility');
  22. ?>
  23. <iframe src="http://cakephp.org/bake-banner" width="830" height="160" style="overflow:hidden; border:none;">
  24. <p>For updates and important announcements, visit http://cakefest.org</p>
  25. </iframe>
  26. <h2><?php echo __d('cake_dev', 'Release Notes for CakePHP %s.', Configure::version()); ?></h2>
  27. <a href="http://cakephp.org/changelogs/<?php echo Configure::version(); ?>"><?php echo __d('cake_dev', 'Read the changelog'); ?> </a>
  28. <?php
  29. if (Configure::read('debug') > 0):
  30. Debugger::checkSecurityKeys();
  31. endif;
  32. ?>
  33. <p id="url-rewriting-warning" style="background-color:#e32; color:#fff;">
  34. <?php echo __d('cake_dev', 'URL rewriting is not properly configured on your server.'); ?>
  35. 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>
  36. 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>
  37. </p>
  38. <p>
  39. <?php
  40. if (version_compare(PHP_VERSION, '5.2.8', '>=')):
  41. echo '<span class="notice success">';
  42. echo __d('cake_dev', 'Your version of PHP is 5.2.8 or higher.');
  43. echo '</span>';
  44. else:
  45. echo '<span class="notice">';
  46. echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.8 or higher to use CakePHP.');
  47. echo '</span>';
  48. endif;
  49. ?>
  50. </p>
  51. <p>
  52. <?php
  53. if (is_writable(TMP)):
  54. echo '<span class="notice success">';
  55. echo __d('cake_dev', 'Your tmp directory is writable.');
  56. echo '</span>';
  57. else:
  58. echo '<span class="notice">';
  59. echo __d('cake_dev', 'Your tmp directory is NOT writable.');
  60. echo '</span>';
  61. endif;
  62. ?>
  63. </p>
  64. <p>
  65. <?php
  66. $settings = Cache::settings();
  67. if (!empty($settings)):
  68. echo '<span class="notice success">';
  69. echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit APP/Config/core.php ', '<em>'. $settings['engine'] . 'Engine</em>');
  70. echo '</span>';
  71. else:
  72. echo '<span class="notice">';
  73. echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in APP/Config/core.php');
  74. echo '</span>';
  75. endif;
  76. ?>
  77. </p>
  78. <p>
  79. <?php
  80. $filePresent = null;
  81. if (file_exists(APP . 'Config' . DS . 'database.php')):
  82. echo '<span class="notice success">';
  83. echo __d('cake_dev', 'Your database configuration file is present.');
  84. $filePresent = true;
  85. echo '</span>';
  86. else:
  87. echo '<span class="notice">';
  88. echo __d('cake_dev', 'Your database configuration file is NOT present.');
  89. echo '<br/>';
  90. echo __d('cake_dev', 'Rename APP/Config/database.php.default to APP/Config/database.php');
  91. echo '</span>';
  92. endif;
  93. ?>
  94. </p>
  95. <?php
  96. if (isset($filePresent)):
  97. App::uses('ConnectionManager', 'Model');
  98. try {
  99. $connected = ConnectionManager::getDataSource('default');
  100. } catch (Exception $connectionError) {
  101. $connected = false;
  102. $errorMsg = $connectionError->getMessage();
  103. if (method_exists($connectionError, 'getAttributes')) {
  104. $attributes = $connectionError->getAttributes();
  105. if (isset($errorMsg['message'])) {
  106. $errorMsg .= '<br />' . $attributes['message'];
  107. }
  108. }
  109. }
  110. ?>
  111. <p>
  112. <?php
  113. if ($connected && $connected->isConnected()):
  114. echo '<span class="notice success">';
  115. echo __d('cake_dev', 'Cake is able to connect to the database.');
  116. echo '</span>';
  117. else:
  118. echo '<span class="notice">';
  119. echo __d('cake_dev', 'Cake is NOT able to connect to the database.');
  120. echo '<br /><br />';
  121. echo $errorMsg;
  122. echo '</span>';
  123. endif;
  124. ?>
  125. </p>
  126. <?php endif; ?>
  127. <?php
  128. App::uses('Validation', 'Utility');
  129. if (!Validation::alphaNumeric('cakephp')) {
  130. echo '<p><span class="notice">';
  131. echo __d('cake_dev', 'PCRE has not been compiled with Unicode support.');
  132. echo '<br/>';
  133. echo __d('cake_dev', 'Recompile PCRE with Unicode support by adding <code>--enable-unicode-properties</code> when configuring');
  134. echo '</span></p>';
  135. }
  136. ?>
  137. <p>
  138. <?php
  139. if (CakePlugin::loaded('DebugKit')):
  140. echo '<span class="notice success">';
  141. echo __d('cake_dev', 'DebugKit plugin is present');
  142. echo '</span>';
  143. else:
  144. echo '<span class="notice">';
  145. echo __d('cake_dev', 'DebugKit is not installed. It will help you inspect and debug different aspects of your application.');
  146. echo '<br/>';
  147. echo __d('cake_dev', 'You can install it from %s', $this->Html->link('github', 'https://github.com/cakephp/debug_kit'));
  148. echo '</span>';
  149. endif;
  150. ?>
  151. </p>
  152. <h3><?php echo __d('cake_dev', 'Editing this Page'); ?></h3>
  153. <p>
  154. <?php
  155. echo __d('cake_dev', 'To change the content of this page, edit: APP/View/Pages/home.ctp.<br />
  156. To change its layout, edit: APP/View/Layouts/default.ctp.<br />
  157. You can also add some CSS styles for your pages at: APP/webroot/css.');
  158. ?>
  159. </p>
  160. <h3><?php echo __d('cake_dev', 'Getting Started'); ?></h3>
  161. <p>
  162. <?php
  163. echo $this->Html->link(
  164. sprintf('<strong>%s</strong> %s', __d('cake_dev', 'New'), __d('cake_dev', 'CakePHP 2.0 Docs')),
  165. 'http://book.cakephp.org/2.0/en/',
  166. array('target' => '_blank', 'escape' => false)
  167. );
  168. ?>
  169. </p>
  170. <p>
  171. <?php
  172. echo $this->Html->link(
  173. __d('cake_dev', 'The 15 min Blog Tutorial'),
  174. 'http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html',
  175. array('target' => '_blank', 'escape' => false)
  176. );
  177. ?>
  178. </p>
  179. <h3><?php echo __d('cake_dev', 'Official Plugins'); ?></h3>
  180. <p>
  181. <ul>
  182. <li>
  183. <?php echo $this->Html->link('DebugKit', 'https://github.com/cakephp/debug_kit') ?>:
  184. <?php echo __d('cake_dev', 'provides a debugging toolbar and enhanced debugging tools for CakePHP applications.'); ?>
  185. </li>
  186. <li>
  187. <?php echo $this->Html->link('Localized', 'https://github.com/cakephp/localized') ?>:
  188. <?php echo __d('cake_dev', 'contains various localized validation classes and translations for specific countries'); ?>
  189. </li>
  190. </ul>
  191. </p>
  192. <h3><?php echo __d('cake_dev', 'More about Cake'); ?></h3>
  193. <p>
  194. <?php echo __d('cake_dev', 'CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.'); ?>
  195. </p>
  196. <p>
  197. <?php echo __d('cake_dev', 'Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.'); ?>
  198. </p>
  199. <ul>
  200. <li><a href="http://cakefoundation.org/"><?php echo __d('cake_dev', 'Cake Software Foundation'); ?> </a>
  201. <ul><li><?php echo __d('cake_dev', 'Promoting development related to CakePHP'); ?></li></ul></li>
  202. <li><a href="http://www.cakephp.org"><?php echo __d('cake_dev', 'CakePHP'); ?> </a>
  203. <ul><li><?php echo __d('cake_dev', 'The Rapid Development Framework'); ?></li></ul></li>
  204. <li><a href="http://book.cakephp.org"><?php echo __d('cake_dev', 'CakePHP Documentation'); ?> </a>
  205. <ul><li><?php echo __d('cake_dev', 'Your Rapid Development Cookbook'); ?></li></ul></li>
  206. <li><a href="http://api20.cakephp.org"><?php echo __d('cake_dev', 'CakePHP API'); ?> </a>
  207. <ul><li><?php echo __d('cake_dev', 'Quick Reference'); ?></li></ul></li>
  208. <li><a href="http://bakery.cakephp.org"><?php echo __d('cake_dev', 'The Bakery'); ?> </a>
  209. <ul><li><?php echo __d('cake_dev', 'Everything CakePHP'); ?></li></ul></li>
  210. <li><a href="http://plugins.cakephp.org"><?php echo __d('cake_dev', 'CakePHP plugins repo'); ?> </a>
  211. <ul><li><?php echo __d('cake_dev', 'A comprehensive list of all CakePHP plugins created by the community'); ?></li></ul></li>
  212. <li><a href="http://groups.google.com/group/cake-php"><?php echo __d('cake_dev', 'CakePHP Google Group'); ?> </a>
  213. <ul><li><?php echo __d('cake_dev', 'Community mailing list'); ?></li></ul></li>
  214. <li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
  215. <ul><li><?php echo __d('cake_dev', 'Live chat about CakePHP'); ?></li></ul></li>
  216. <li><a href="http://github.com/cakephp/"><?php echo __d('cake_dev', 'CakePHP Code'); ?> </a>
  217. <ul><li><?php echo __d('cake_dev', 'For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li>
  218. <li><a href="http://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>
  219. <ul><li><?php echo __d('cake_dev', 'CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li>
  220. </ul>