Browse files

merging all changes done in sandbox for next release into the trunk

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1057 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
1 parent ab1db25 commit d44a364285f1797b165564449102cf525692c754 @phpnut phpnut committed Oct 3, 2005
Showing with 2,743 additions and 2,170 deletions.
  1. +3 −3 .htaccess
  2. +5 −0 app/.htaccess
  3. 0 { → app}/config/acl.ini.php
  4. +20 −0 { → app}/config/core.php
  5. 0 { → app}/config/database.php.default
  6. +44 −29 { → app}/config/paths.php
  7. 0 { → app}/config/routes.php
  8. 0 { → app}/config/routes.php.default
  9. 0 { → app}/config/tags.ini.php
  10. 0 app/{apis → controllers/components}/my_acl.php
  11. +0 −67 app/controllers/tests_controller.php
  12. +0 −47 app/helpers/pages_helper.php
  13. +3 −20 app/{helpers/tests_helper.php → index.php}
  14. 0 public/img/put_images_here → app/plugins/put_3rd_party_cake_apps_here
  15. +0 −1 app/views/layouts/ajax.thtml
  16. +0 −19 app/views/layouts/default.thtml
  17. +0 −11 app/views/layouts/error.thtml
  18. +0 −91 app/views/layouts/test.thtml
  19. +0 −29 app/views/pages/home.thtml
  20. +0 −4 app/views/tests/index.thtml
  21. +0 −30 app/views/tests/test_all.thtml
  22. +5 −0 app/webroot/.htaccess
  23. 0 {public → app/webroot}/css.php
  24. +167 −0 app/webroot/css/cake.default.css
  25. +19 −35 public/css/forms.css → app/webroot/css/cake.forms.css
  26. +161 −0 app/webroot/css/cake.scaffold.css
  27. BIN app/webroot/favicon.ico
  28. 0 {public → app/webroot}/files/put_downloadable_files_here
  29. BIN app/webroot/img/cake.bg.body.gif
  30. 0 public/img/bg_header.gif → app/webroot/img/cake.bg.header.gif
  31. 0 public/img/logo.png → app/webroot/img/cake.logo.png
  32. 0 public/img/red_box.gif → app/webroot/img/cake.redbox.gif
  33. 0 {public → app/webroot}/img/pbcake.gif
  34. +69 −21 {public → app/webroot}/index.php
  35. 0 {public → app/webroot}/js/vendors.php
  36. 0 {app → cake}/app_controller.php
  37. 0 {app → cake}/app_model.php
  38. +68 −26 {libs → cake}/basics.php
  39. +70 −14 {libs → cake}/dispatcher.php
  40. 0 { → cake}/docs/CHANGELOG.txt
  41. 0 { → cake}/docs/COPYING.txt
  42. 0 { → cake}/docs/CREDITS.txt
  43. 0 { → cake}/docs/LICENSE.txt
  44. 0 { → cake}/docs/README.txt
  45. 0 { → cake}/libs/cache.php
  46. 0 { → cake}/libs/class_registry.php
  47. 0 {libs → cake/libs/controller/components}/acl.php
  48. 0 {libs → cake/libs/controller/components}/acl_base.php
  49. +45 −3 {libs → cake/libs/controller}/controller.php
  50. +1 −2 {app/controllers → cake/libs/controller}/pages_controller.php
  51. +11 −6 {libs → cake/libs/controller}/scaffold.php
  52. +2 −5 {libs/controllers → cake/libs/controller}/templates/scaffolds/edit.thtml
  53. 0 {libs/controllers → cake/libs/controller}/templates/scaffolds/list.thtml
  54. +7 −0 cake/libs/controller/templates/scaffolds/new.thtml
  55. +15 −0 cake/libs/controller/templates/scaffolds/scaffold.thtml
  56. 0 {libs/controllers → cake/libs/controller}/templates/scaffolds/show.thtml
  57. +1 −1 { → cake}/libs/error_messages.php
  58. +348 −0 cake/libs/file.php
  59. 0 { → cake}/libs/flay.php
  60. +183 −37 { → cake}/libs/folder.php
  61. 0 {libs → cake/libs/generator}/bake.php
  62. 0 { → cake}/libs/generator/base.php
  63. 0 { → cake}/libs/generator/commands.php
  64. 0 { → cake}/libs/generator/generators/applications/app/app_generator.php
  65. 0 .../components → cake/libs/generator/generators/class_templates}/controller/controller_generator.php
  66. 0 .../components → cake/libs/generator/generators/class_templates}/controller/templates/controller.php
  67. 0 ...onents → cake/libs/generator/generators/class_templates}/controller/templates/functional_test.php
  68. 0 ...tors/components → cake/libs/generator/generators/class_templates}/controller/templates/helper.php
  69. 0 ...tors/components → cake/libs/generator/generators/class_templates}/controller/templates/view.thtml
  70. 0 ...generators/components → cake/libs/generator/generators/class_templates}/model/model_generator.php
  71. 0 ...erators/components → cake/libs/generator/generators/class_templates}/model/templates/fixtures.php
  72. 0 ...generators/components → cake/libs/generator/generators/class_templates}/model/templates/model.php
  73. 0 ...rators/components → cake/libs/generator/generators/class_templates}/model/templates/unit_test.php
  74. 0 ...tors/components → cake/libs/generator/generators/class_templates}/scaffold/scaffold_generator.php
  75. 0 ...rs/components → cake/libs/generator/generators/class_templates}/scaffold/templates/controller.php
  76. 0 ...rators/components → cake/libs/generator/generators/class_templates}/scaffold/templates/form.thtml
  77. 0 ...nents → cake/libs/generator/generators/class_templates}/scaffold/templates/form_scaffolding.thtml
  78. 0 ...mponents → cake/libs/generator/generators/class_templates}/scaffold/templates/functional_test.php
  79. 0 ...rators/components → cake/libs/generator/generators/class_templates}/scaffold/templates/helper.php
  80. 0 ...lates/scaffolds → cake/libs/generator/generators/class_templates/scaffold/templates}/layout.thtml
  81. 0 ...erators/components → cake/libs/generator/generators/class_templates}/scaffold/templates/style.css
  82. 0 ...s/components → cake/libs/generator/generators/class_templates}/scaffold/templates/view_edit.thtml
  83. 0 ...s/components → cake/libs/generator/generators/class_templates}/scaffold/templates/view_list.thtml
  84. 0 ...rs/components → cake/libs/generator/generators/class_templates}/scaffold/templates/view_new.thtml
  85. 0 ...s/components → cake/libs/generator/generators/class_templates}/scaffold/templates/view_show.thtml
  86. 0 ...ors/components → cake/libs/generator/generators/class_templates}/web/templates/api_definition.php
  87. 0 ...erators/components → cake/libs/generator/generators/class_templates}/web/templates/controller.php
  88. 0 ...rs/components → cake/libs/generator/generators/class_templates}/web/templates/functional_test.php
  89. 0 ...tor/generators/components → cake/libs/generator/generators/class_templates}/web/web_generator.php
  90. 0 { → cake}/libs/generator/lookup.php
  91. 0 { → cake}/libs/generator/manifest.php
  92. 0 { → cake}/libs/generator/options.php
  93. 0 { → cake}/libs/generator/scripts.php
  94. 0 { → cake}/libs/generator/scripts/destroy.php
  95. 0 { → cake}/libs/generator/scripts/generate.php
  96. 0 { → cake}/libs/generator/scripts/update.php
  97. 0 { → cake}/libs/generator/simple_logger.php
  98. 0 { → cake}/libs/generator/spec.php
  99. 0 { → cake}/libs/inflector.php
  100. 0 { → cake}/libs/legacy.php
  101. 0 { → cake}/libs/log.php
  102. 0 {libs → cake/libs/model/dbo}/dbo.php
  103. 0 {libs → cake/libs/model}/dbo/dbo_adodb.php
  104. +4 −4 {libs → cake/libs/model/dbo}/dbo_factory.php
  105. 0 {libs → cake/libs/model}/dbo/dbo_generic.php
  106. +1 −1 {libs → cake/libs/model}/dbo/dbo_mysql.php
  107. +1 −1 {libs → cake/libs/model}/dbo/dbo_pear.php
  108. +1 −1 {libs → cake/libs/model}/dbo/dbo_postgres.php
  109. +1 −1 {libs → cake/libs/model}/dbo/dbo_sqlite.php
  110. +6 −10 {libs → cake/libs/model}/model.php
  111. +203 −158 { → cake}/libs/neat_array.php
  112. 0 { → cake}/libs/neat_string.php
  113. +142 −0 cake/libs/new_inflector.php
  114. 0 { → cake}/libs/object.php
  115. 0 { → cake}/libs/router.php
  116. +197 −197 { → cake}/libs/sanitize.php
  117. 0 { → cake}/libs/time.php
  118. 0 { → cake}/libs/validators.php
  119. +6 −0 {libs → cake/libs/view}/helper.php
  120. 0 {libs → cake/libs/view}/helpers/acl.php
  121. +43 −52 {libs → cake/libs/view}/helpers/ajax.php
  122. +35 −46 {libs → cake/libs/view}/helpers/form.php
  123. +3 −3 {libs → cake/libs/view}/helpers/html.php
  124. +52 −8 {libs → cake/libs/view}/helpers/javascript.php
  125. +9 −6 {libs → cake/libs/view}/helpers/number.php
  126. 0 {libs → cake/libs/view}/helpers/text.php
  127. +447 −447 {libs → cake/libs/view}/helpers/time.php
  128. 0 {app/views → cake/libs/view/templates}/errors/missing_action.thtml
  129. 0 {app/views → cake/libs/view/templates}/errors/missing_controller.thtml
  130. 0 {app/views → cake/libs/view/templates}/errors/missing_database.thtml
  131. +45 −0 cake/libs/view/templates/errors/missing_helper_class.thtml
  132. +45 −0 cake/libs/view/templates/errors/missing_helper_file.thtml
  133. 0 {app/views → cake/libs/view/templates}/errors/missing_scaffolddb.thtml
  134. 0 {app/views → cake/libs/view/templates}/errors/missing_table.thtml
  135. 0 {app/views → cake/libs/view/templates}/errors/missing_view.thtml
  136. +1 −0 cake/libs/view/templates/layouts/ajax.thtml
  137. +57 −0 cake/libs/view/templates/layouts/default.thtml
  138. +12 −0 cake/libs/view/templates/layouts/error.thtml
  139. 0 {app/views → cake/libs/view/templates}/layouts/flash.thtml
  140. +41 −0 cake/libs/view/templates/pages/home.thtml
  141. +126 −39 {libs → cake/libs/view}/view.php
  142. 0 { → cake}/scripts/bake.bat
  143. 0 { → cake}/scripts/bake.php
  144. 0 { → cake}/scripts/test.bat
  145. 0 { → cake}/scripts/test.php
  146. +18 −29 index.php
  147. 0 libs/controllers/templates/rescues/_request_and_response.thtml
  148. 0 libs/controllers/templates/rescues/diagnostics.thtml
  149. 0 libs/controllers/templates/rescues/layout.thtml
  150. 0 libs/controllers/templates/rescues/missing_template.thtml
  151. 0 libs/controllers/templates/rescues/routing_error.thtml
  152. 0 libs/controllers/templates/rescues/template_error.thtml
  153. 0 libs/controllers/templates/rescues/unknown_action.thtml
  154. +0 −11 libs/controllers/templates/scaffolds/new.thtml
  155. +0 −17 libs/controllers/templates/scaffolds/scaffold.thtml
  156. +0 −108 libs/file.php
  157. 0 libs/generator/generators/components/scaffold/templates/layout.thtml
  158. +0 −112 libs/template.php
  159. 0 libs/web/templates/scaffolds/methods.thtml
  160. 0 libs/web/templates/scaffolds/parameters.thtml
  161. 0 libs/web/templates/scaffolds/result.thtml
  162. 0 modules/put_modules_here
  163. +0 −13 public/.htaccess
  164. +0 −11 public/500.html
  165. +0 −116 public/css/default.css
  166. +0 −168 public/css/scaffold.css
  167. BIN public/img/bg_fade.gif
  168. +0 −110 public/test/rss2html.xsl
  169. 0 { → tmp}/logs/put_logs_here
View
6 .htaccess
@@ -1,5 +1,5 @@
<IfModule mod_rewrite.c>
RewriteEngine on
- RewriteRule ^$ public/ [L]
- RewriteRule (.*) public/$1 [L]
-</IfModule>
+ RewriteRule ^$ app/webroot/ [L]
+ RewriteRule (.*) app/webroot/$1 [L]
+</IfModule>
View
5 app/.htaccess
@@ -0,0 +1,5 @@
+<IfModule mod_rewrite.c>
+ RewriteEngine on
+ RewriteRule ^$ webroot/ [L]
+ RewriteRule (.*) webroot/$1 [L]
+ </IfModule>
View
0 config/acl.ini.php → app/config/acl.ini.php
File renamed without changes.
View
20 config/core.php → app/config/core.php
@@ -31,6 +31,16 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
+if(function_exists('apache_get_modules'))
+{
+ $modules = apache_get_modules();
+ if(!in_array('mod_rewrite', $modules) || !is_file('.htaccess'))
+ {
+ define ('BASE_URL', $_SERVER['SCRIPT_NAME']);
+ }
+}
+
/**
* Set debug level here:
* - 0: production
@@ -55,6 +65,16 @@
define('AUTO_OUTPUT', false);
/**
+ * If set to false, session would not automatically be started.
+ */
+define('AUTO_SESSION', true);
+
+/**
+ * Set the max size of file to use md5() .
+ */
+define('MAX_MD5SIZE', (5*1024)*1024 );
+
+/**
* To use Access Control Lists with Cake...
*/
define('ACL_CLASSNAME', 'MyACL');
View
0 config/database.php.default → app/config/database.php.default
File renamed without changes.
View
73 config/paths.php → app/config/paths.php
@@ -39,110 +39,125 @@
*/
if(!defined('ROOT'))
{
- define('ROOT', '../');
+ define ('ROOT', '../');
+}
+
+if(!defined('WEBROOT_DIR'))
+{
+ define ('WEBROOT_DIR', 'webroot');
}
/**
* Path to the application's directory.
*/
-define('APP', ROOT.'app'.DS);
+define ('CAKE', ROOT.'cake'.DS);
+
+/**
+ * Path to the application's directory.
+ */
+define ('APP', ROOT.APP_DIR.DS);
/**
* Path to the application's models directory.
*/
-define('MODELS', APP.'models'.DS);
+define ('MODELS', APP.'models'.DS);
/**
* Path to the application's controllers directory.
*/
-define('CONTROLLERS', APP.'controllers'.DS);
+define ('CONTROLLERS', APP.'controllers'.DS);
/**
- * Path to the application's helpers directory.
+ * Path to the application's views directory.
*/
-define('HELPERS', APP.'helpers'.DS);
+define ('VIEWS', APP.'views'.DS);
/**
- * Path to the application's views directory.
+ * Path to the application's helpers directory.
*/
-define('VIEWS', APP.'views'.DS);
+define ('HELPERS', VIEWS.'helpers'.DS);
/**
* Path to the application's view's layouts directory.
*/
-define('LAYOUTS', APP.'views'.DS.'layouts'.DS);
+define ('LAYOUTS', APP.'views'.DS.'layouts'.DS);
/**
* Path to the application's view's elements directory.
* It's supposed to hold pieces of PHP/HTML that are used on multiple pages
* and are not linked to a particular layout (like polls, footers and so on).
*/
-define('ELEMENTS', APP.'views'.DS.'elements'.DS);
+define ('ELEMENTS', APP.'views'.DS.'elements'.DS);
/**
* Path to the configuration files directory.
*/
-define('CONFIGS', ROOT.'config'.DS);
+define ('CONFIGS', APP.'config'.DS);
/**
* Path to the libs directory.
*/
-define ('LIBS', ROOT.'libs'.DS);
+define ('LIBS', CAKE.'libs'.DS);
/**
* Path to the logs directory.
*/
-define('LOGS', ROOT.'logs'.DS);
+define ('LOGS', ROOT.'logs'.DS);
/**
* Path to the modules directory.
*/
-define('MODULES', ROOT.'modules'.DS);
+define ('MODULES', ROOT.'modules'.DS);
+
+/**
+ * Path to the public directory.
+ */
+define ('WWW_ROOT', APP.WEBROOT_DIR.DS);
/**
* Path to the public directory.
*/
-define('WWW_ROOT', ROOT.'public'.DS);
+define ('CSS', WWW_ROOT.'css'.DS);
/**
* Path to the public directory.
*/
-define('CSS', WWW_ROOT.'css'.DS);
+define ('JS', WWW_ROOT.'js'.DS);
/**
* Path to the scripts direcotry.
*/
-define('SCRIPTS', ROOT.'scripts'.DS);
+define('SCRIPTS', CAKE.'scripts'.DS);
/**
* Path to the tests directory.
*/
-define('TESTS', ROOT.'tests'.DS);
+define ('TESTS', ROOT.'tests'.DS);
/**
* Path to the controller test directory.
*/
-define('CONTROLLER_TESTS', TESTS.'app'.DS.'controllers'.DS);
+define ('CONTROLLER_TESTS',TESTS.APP_DIR.'controllers'.DS);
/**
* Path to the helpers test directory.
*/
-define('HELPER_TESTS', TESTS.'app'.DS.'helpers'.DS);
+define ('HELPER_TESTS', TESTS.APP_DIR.'helpers'.DS);
/**
* Path to the models' test directory.
*/
-define('MODEL_TESTS', TESTS.'app'.DS.'models'.DS);
+define ('MODEL_TESTS', TESTS.APP_DIR.'models'.DS);
/**
* Path to the lib test directory.
*/
-define('LIB_TESTS', TESTS.'libs'.DS);
+define ('LIB_TESTS', TESTS.'libs'.DS);
/**
* Path to the temporary files directory.
*/
-define('TMP', ROOT.'tmp'.DS);
+define ('TMP', ROOT.'tmp'.DS);
/**
* Path to the cache files directory. It can be shared between hosts in a multi-server setup.
@@ -152,15 +167,14 @@
/**
* Path to the vendors directory.
*/
-define('VENDORS', ROOT.'vendors'.DS);
+define ('VENDORS', ROOT.'vendors'.DS);
/**
* Path to the Pear directory
* The purporse is to make it easy porting Pear libs into Cake
* without setting the include_path PHP variable.
*/
-define('PEAR', VENDORS.'Pear'.DS);
-
+define ('PEAR', VENDORS.'Pear'.DS);
/**
* Full url prefix
@@ -170,16 +184,17 @@
/**
* Web path to the public images directory.
*/
-define('IMAGES_URL', '/img/');
+define ('IMAGES_URL', 'img/');
/**
* Web path to the CSS files directory.
*/
-define('CSS_URL', '/css/');
+define ('CSS_URL', 'css/');
/**
* Web path to the js files directory.
*/
-define('JS_URL', '/js/');
+define ('JS_URL', 'js/');
+
?>
View
0 config/routes.php → app/config/routes.php
File renamed without changes.
View
0 config/routes.php.default → app/config/routes.php.default
File renamed without changes.
View
0 config/tags.ini.php → app/config/tags.ini.php
File renamed without changes.
View
0 app/apis/my_acl.php → app/controllers/components/my_acl.php
File renamed without changes.
View
67 app/controllers/tests_controller.php
@@ -1,67 +0,0 @@
-<?php
-/* SVN FILE: $Id$ */
-
-/**
- * Short description for file.
- *
- * Long description for file
- *
- * PHP versions 4 and 5
- *
- * CakePHP : Rapid Development Framework <http://www.cakephp.org/>
- * Copyright (c) 2005, CakePHP Authors/Developers
- *
- * Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
- * Larry E. Masters aka PhpNut <nut@phpnut.com>
- * Kamil Dzielinski aka Brego <brego.dk@gmail.com>
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @filesource
- * @author CakePHP Authors/Developers
- * @copyright Copyright (c) 2005, CakePHP Authors/Developers
- * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
- * @package cake
- * @subpackage cake.app.controllers
- * @since CakePHP v 0.2.9
- * @version $Revision$
- * @modifiedby $LastChangedBy$
- * @lastmodified $Date$
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
- */
-
-/**
- * Short description for class.
- *
- * Long description for class
- *
- * @package cake
- * @subpackage cake.app.controllers
- */
-class TestsController extends TestsHelper {
-
- function index ()
- {
- $this->layout = null;
- require_once TESTS.'index.php';
- }
-
- function groups ()
- {
- $this->layout = null;
- $_GET['show'] = 'groups';
- require_once TESTS.'index.php';
- exit();
- }
-
- function cases ()
- {
- $this->layout = null;
- $_GET['show'] = 'cases';
- require_once TESTS.'index.php';
- exit();
- }
-}
-
-?>
View
47 app/helpers/pages_helper.php
@@ -1,47 +0,0 @@
-<?php
-/* SVN FILE: $Id$ */
-
-/**
- * Short description for file.
- *
- * In this file you can extend the PagesController.
- *
- * PHP versions 4 and 5
- *
- * CakePHP : Rapid Development Framework <http://www.cakephp.org/>
- * Copyright (c) 2005, CakePHP Authors/Developers
- *
- * Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
- * Larry E. Masters aka PhpNut <nut@phpnut.com>
- * Kamil Dzielinski aka Brego <brego.dk@gmail.com>
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @filesource
- * @author CakePHP Authors/Developers
- * @copyright Copyright (c) 2005, CakePHP Authors/Developers
- * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
- * @package cake
- * @subpackage cake.app.helpers
- * @since CakePHP v 0.2.9
- * @version $Revision$
- * @modifiedby $LastChangedBy$
- * @lastmodified $Date$
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
- *
-
-/**
- * Short description for class.
- *
- * Long description for class
- *
- * @package cake
- * @subpackage cake.app.helpers
- */
-
-class PagesHelper extends AppController
-{
-}
-
-?>
View
23 app/helpers/tests_helper.php → app/index.php
@@ -2,10 +2,6 @@
/* SVN FILE: $Id$ */
/**
- * Short description for file.
- *
- * In this file you can extend the TestsController.
- *
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
@@ -23,25 +19,12 @@
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
- * @subpackage cake.app.helpers
- * @since CakePHP v 0.2.9
+ * @subpackage cake.libs
+ * @since CakePHP v 0.10.0.1036
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-
-/**
- * Short description for class.
- *
- * Long description for class
- *
- * @package cake
- * @subpackage cake.app.helpers
- */
-
-class TestsHelper extends AppController
-{
-}
-
+include_once('webroot'.DIRECTORY_SEPARATOR.'index.php');
?>
View
0 public/img/put_images_here → app/plugins/put_3rd_party_cake_apps_here
File renamed without changes.
View
1 app/views/layouts/ajax.thtml
@@ -1 +0,0 @@
-<?=$content_for_layout?>
View
19 app/views/layouts/default.thtml
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title><?php echo $title_for_layout?></title>
- <?php echo $html->charsetTag('UTF-8')?>
- <?php echo $html->cssTag('default')?>
- <?php echo $html->cssTag('forms')?>
-</head>
-
-<body>
-<div id="main">
-<?php echo $content_for_layout?>
-
- <p>
-<a id="logo" href="http://www.cakephp.org/" target="_new"><img src="<?php echo $html->url("/img/pbcake.gif"); ?>" width="120" height="28" alt="CakePHP : Rapid Development Framework" /></a>
-</p>
-</div>
-</body>
-</html>
View
11 app/views/layouts/error.thtml
@@ -1,11 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
-<html>
-<head>
-<title><?=$code?> <?=$name?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-</head>
-<body>
-<h1><?=$name?></h1>
-<p><?=$message?></p>
-</body>
-</html>
View
91 app/views/layouts/test.thtml
@@ -1,91 +0,0 @@
-<html>
-<head>
-<style type="text/css"><!--
-
-BODY {
-font:normal .9em Arial,sans-serif;
-color:Black;
-}
-TABLE {
-margin-left:3em;
-border-collapse:collapse;
-border:2px solid #DDD;
-}
-TH, TD {
-font:normal .8em Tahoma, sans-serif;
-}
-TH {
-text-align:left;
-padding:.4em .3em .1em .3em;
-}
-TH B {
-font:bold 1.2em Arial,sans-serif;
-}
-TD {
-padding:.1em .55em;
-}
-TR.fail TD {
-font-weight:bold;
-color:#FFF;
-background-color:#F31;
-}
-TR.info TD {
-background-color:#F8F8F8;
-padding:.5em 1em .5em 2em;
-}
-TR.info .ok {
- color:Green;
-}
-TR.info .not {
- color:Red;
-}
-TR.info EM {
- color:Gray;
- font-style:normal;
-}
-TR.unkn TD {
-background-color:#FF0;
-}
-TR.pass TD, TR.expected TD {
-color:Green;
-}
-
-CODE {
-font-size:1.2em;
-}
-CODE.expected {
-color: green;
-}
-CODE.actual {
-color: red;
-}
-.typeinfo {
-color: gray;
-}
-
-
-.box {
-font-size:3em;
-text-align:center;
-margin-top:1em;
-}
-.box B {
-color:#FFF;
-padding:.3em .6em;
-background-color:#BBB;
-}
-#ok B {
-background-color:#82AF15;
-}
-#error B {
-background-color:#C2361B;
-}
-
---></style>
-
-<body>
-
-<?=$content_for_layout?>
-
-</body>
-</html>
View
29 app/views/pages/home.thtml
@@ -1,29 +0,0 @@
-<h1>CakePHP <em>Works!</em></h1><br/>
-<hr/>
-Your database configuration file is <?php echo file_exists(CONFIGS.'database.php') ? 'present.'. $filePresent = ' ' : 'not present.';?><br/>
-<?php $db = DboFactory::getInstance(); ?>
-<?php if (!empty($filePresent)):?>
-Cake <?php echo $db->connected ? "is able to" : "is not able to" ?> connect to the database.
-<?php endif; ?>
-<hr/>
-<br/>
-<h2>Editing <em>this Page</em></h2>
-<p>
-To change the content of this page, edit <code>/app/views/pages/home.thtml</code>. To change it's layout, edit <code>/app/views/layouts/default.thtml</code>. You can also edit the CSS styles for this page at <code>/public/css/default.css</code>.
-</p><br/>
-
-<h2>Introducing <em>Cake</em></h2>
-
-<p>Cake is a rapid development framework for PHP: a structure of libraries, classes and run-time infrastructure for programmers creating web applications. Our primary goal is to enable you to work in a structured and rapid manner within a framework - without loss of flexibility. </p><br/>
-<p>Tired of repeating yourself? Ever copy and pasted code? Want to get your app in production quicker? Cake is for you. </p><br/>
-
-<h2>Get <em>Involved</em></h2>
-<p>Cake PHP needs you! We have an active user base and are always open to new bug reports or feature ideas!</p><br/>
-<?php echo $html->linkOut('Google Group','http://groups-beta.google.com/group/cake-php')?> &ndash; for public discussions about everything Cake.<br/>
-<?php echo $html->linkOut('Wiki','https://trac.cakephp.org/wiki')?> &ndash; fastest way of getting newest information on Cake PHP.<br/>
-<?php echo $html->linkOut('Report a bug or feature request','https://trac.cakephp.org/newticket')?>.<br/>
-<?php echo $html->linkOut('Roadmap','https://trac.cakephp.org/roadmap')?> &ndash; check our plans for the bright future.<br/>
-#cakephp on irc.euirc.net for quick help<br/>
-</p>
-<br/>
-<p>Cake 0.9.2</p>
View
4 app/views/tests/index.thtml
@@ -1,4 +0,0 @@
-<?php
-/* empty view
- * output is handle by the test suite
- */ ?>
View
30 app/views/tests/test_all.thtml
@@ -1,30 +0,0 @@
-<?php /* if ($success) { ?>
-<p class="box" id="ok"><b>PASSED</b></p>
-<?php } else { ?>
-<p class="box" id="error"><b>FAILED</b></p>
-<?php } ?>
-
-<table>
-<?php foreach ($results as $r) {
-$performed = $r['result']['tests'];
-if ($performed||1) {
-?>
-<tr><th><b><?=$r['name']?></b> <?=$performed?> test<?=$performed==1?'':'s'?></th></tr>
-<?php if ($r['result']['tests']) {
-foreach ($r['result']['details'] as $detail) {
-if ($detail['failed']) { ?>
-<tr class="fail"><td><?=$r['name']?>::<?=$detail['method']?></td></tr>
-<?php foreach ($detail['errors'] as $error) { ?>
-<tr class="info"><td>
-<span class="ok"><?=$error['expected'][0]?></span> <em><?=$error['expected'][1]?></em><br />
-<span class="not"><?=$error['actual'][0]?></span> <em><?=$error['actual'][1]?></em>
-</td></tr>
-<?php
-}
-}
-else { ?>
-<tr class="pass"><td><?=$r['name']?>::<?=$detail['method']?></td></tr>
-
-<?php } } } } } ?>
-</table>
-<?php */ ?>
View
5 app/webroot/.htaccess
@@ -0,0 +1,5 @@
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
+</IfModule>
View
0 public/css.php → app/webroot/css.php
File renamed without changes.
View
167 app/webroot/css/cake.default.css
@@ -0,0 +1,167 @@
+body
+{
+ margin: 0;
+ font:small "Trebuchet MS",Verdana,Arial,Sans-serif;
+ background: #F2F5F5 url('../img/cake.bg.body.gif') top center repeat-y;
+}
+
+h1
+{
+ margin: 4px;
+ padding: 0;
+ color: #71300F;
+ font-size: 30px;
+}
+
+h1 em {
+ color: #DBA941;
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+}
+
+h2
+{
+ margin-top: 20px;
+ margin-bottom: 6px;
+ padding: 0;
+ color: #71300F;
+}
+
+h2 em {
+ color: #DBA941;
+ font-style: normal;
+ font-weight: bold;
+ font-variant: normal;
+}
+h3
+{
+ margin-top: 20px;
+ margin-bottom: 6px;
+ color: #71300F;
+}
+acronym
+{
+ border-bottom: 1px dotted #DBA941;
+}
+
+ul
+{
+ font-family: Helvetica;
+ margin-top: 2px;
+ margin-bottom: 6px;
+ padding: 2px 30px;
+}
+ul li
+{
+ list-style-image: url(../img/cake.redbox.gif);
+ padding-bottom: 8px;
+
+}
+p
+{
+ font-family: Helvetica;
+ margin-top: 2px;
+ margin-left: 4px;
+ margin-bottom: 6px;
+}
+
+#main
+{
+ width: 752px;
+ margin-top: 0px;
+ margin-left: auto;
+ margin-right: auto;
+ padding-bottom: 20px;
+ background-color: #EFF1F1;
+ border-top: 4px solid #fff;
+ /*border-bottom: 1px solid #D2D7D8;*/
+ /*border-top: 1px solid #C9CFD1;
+ border-bottom: 1px solid #C9CFD1;
+ border-left: 1px solid #C9CFD1;
+ border-right: 1px solid #C9CFD1;*/
+}
+
+#header
+{
+ padding: 0px;
+ height: 112px;
+ background: #fff url(../img/cake.bg.header.gif) repeat-x;
+ border-bottom: 1px solid #D2D7D8;
+}
+
+#headerLogo
+{
+ float: left;
+}
+
+#headerNav
+{
+ float: left;
+ margin-top: 56px;
+ margin-left: 10px;
+}
+
+#headerNav a {
+ padding: 4px 10px;
+ font-weight: bold;
+}
+#headerSubNav
+{
+ float: left;
+ margin-top: 12px;
+ margin-left: 10px;
+}
+
+#headerSubNav a {
+ padding: 4px 10px;
+ font-weight: bold;
+}
+#content
+{
+ margin: 20px 20px;
+ padding: 0px 28px 40px 22px;
+ background-color: #fff;
+ border-top: 1px solid #D2D7D8;
+ border-left: 1px solid #D2D7D8;
+ border-right: 1px solid #D2D7D8;
+ border-bottom: 1px solid #D2D7D8;
+}
+a
+{
+ color: #71300F;
+ text-decoration: none;
+ font-weight: bold;
+}
+
+a:hover
+{
+ color: #71300F;
+ text-decoration: underline;
+ font-weight: bold;
+}
+
+#footer
+{
+ padding-bottom: 40px;
+
+}
+
+.active {
+ background-color: #D2D7D8;
+ padding: 10px;
+}
+
+***Please Leave Powered by Cake****/
+ #pb-cake {
+ width: 752px;
+ margin-top: 0px;
+ margin-left: auto;
+ margin-right: auto;
+ padding-right: 6px;
+ text-align: right;
+ }
+
+ #pb-cake a{
+ padding: 0;
+ }
View
54 public/css/forms.css → app/webroot/css/cake.forms.css
@@ -1,13 +1,6 @@
/* form.css */
-* {
- margin: 0px;
- padding: 0px;
-}
-
form {
- margin: 0px;
- padding: 0px;
font-size: 100%;
min-width: 560px;
max-width: 620px;
@@ -20,14 +13,12 @@ form fieldset {
border-width: 1px 0px 0px 0px;
border-style: solid none none none;
padding: 10px;
- margin: 0px 0px 0px 0px;
}
form fieldset legend {
font-size: 150%;
font-weight: normal;
- color: #000000;
- margin: 0px 0px 0px 0px;
+ color: #000;
padding: 0px 5px;
}
@@ -43,7 +34,7 @@ label u {
input, select, textarea {
font-family: Tahoma, Arial, sans-serif;
font-size: 100%;
- color: #000000;
+ color: #000;
}
textarea {
@@ -65,9 +56,9 @@ form fieldset div.notes {
height: auto;
margin: 0px 0px 10px 10px;
padding: 5px;
- border: 1px solid #666666;
+ border: 1px solid #666;
background-color: #ffffe1;
- color: #666666;
+ color: #666;
font-size: 88%;
}
@@ -78,14 +69,14 @@ form fieldset div.notes h4 {
padding: 3px 0px 3px 27px;
border-width: 0px 0px 1px 0px;
border-style: solid;
- border-color: #666666;
- color: #666666;
+ border-color: #666;
+ color: #666;
font-size: 110%;
}
form fieldset div.notes p {
margin: 0em 0em 1.2em 0em;
- color: #666666;
+ color: #666;
}
form fieldset div.notes p.last {
@@ -96,7 +87,7 @@ form div fieldset {
clear: none;
border-width: 1px;
border-style: solid;
- border-color: #666666;
+ border-color: #666;
margin: 0px 0px 0px 142px;
padding: 0px 5px 5px 5px;
width: 197px;
@@ -133,7 +124,6 @@ form div label.labelCheckbox, form div label.labelRadio {
display: block;
width: 200px;
height: expression('1%');
- padding: 0px;
margin: 0px 0px 5px 142px;
text-align: left;
}
@@ -144,13 +134,13 @@ form div fieldset label.labelCheckbox, form div fieldset label.labelRadio {
}
p.error {
- background-color: #ff0000;
+ background-color: #f00;
background-image: url(/images/icon_error.gif);
background-repeat: no-repeat;
background-position: 3px 3px;
color: #ffffff;
padding: 3px 3px 5px 27px;
- border: 1px solid #000000;
+ border: 1px solid #000;
margin: auto 100px;
}
@@ -159,8 +149,8 @@ form div.error {
background-image: url(/images/required_bg.gif);
background-repeat: no-repeat;
background-position: top left;
- color: #666666;
- border: 1px solid #ff0000;
+ color: #666;
+ border: 1px solid #f00;
}
form div.error p.error {
@@ -172,7 +162,7 @@ form div.error p.error {
font-weight: bold;
margin: 0px 0px 0px 118px;
width: 200px;
- color: #ff0000;
+ color: #f00;
}
form div input, form div select, form div textarea {
@@ -196,8 +186,6 @@ form div input.inputCheckbox, form div input.inputRadio, input.inputCheckbox, in
width: 14px;
background-color: transparent;
border-width: 0px;
- padding: 0px;
- margin: 0px 0px 0px 0px;
}
form div.submit {
@@ -208,7 +196,6 @@ form div.submit {
}
div.submit input {
- align:center;
text-align:center;
font-weight: bold;
color: #fff;
@@ -227,16 +214,13 @@ form div.submit div {
float: left;
text-align: left;
width: auto;
- padding: 0px;
- margin: 0px;
}
form div input.inputSubmit, form div input.inputButton, input.inputSubmit, input.inputButton {
background-color: #cccccc;
color: #000000;
width: auto;
padding: 0px 6px;
- margin: 0px;
}
form div.submit div input.inputSubmit, form div.submit div input.inputButton {
@@ -259,7 +243,7 @@ form fieldset legend {
}
form input, form select, form textarea {
- background-color: #ffffff;
+ background-color: #fff;
}
form textarea.expanding {
@@ -286,7 +270,7 @@ form div label.labelCheckbox, form div label.labelRadio, label.labelCheckbox, la
}
form div label.labelCheckbox input.inputCheckbox, form div label.labelRadio input.inputRadio, label.labelCheckbox input.inputCheckbox, label.labelRadio input.inputRadio {
- margin: 0px 0px 0px 0px;
+ margin: 0;
}
form div fieldset input.inputText, form div fieldset input.inputPassword, form div fieldset input.inputFile, form div fieldset textarea.inputTextarea {
@@ -300,7 +284,7 @@ form div label.compact {
width: auto;
padding: 4px 10px 0px 0px;
text-indent: 0px;
- margin: 0px 0px 0px 0px;
+ margin: 0;
}
form div.wide label {
@@ -314,7 +298,7 @@ form div label.wide {
form div.wide input.inputText, form div.wide input.inputPassword, form div.wide input.inputFile, form div.wide select, form div.wide textarea {
width: 344px;
- margin: 0px;
+ margin: 0;
}
form div.notes p, form div small {
@@ -334,5 +318,5 @@ select.autoWidth {
}
option {
-padding-left:1em;
-}
+ padding-left:1em;
+}
View
161 app/webroot/css/cake.scaffold.css
@@ -0,0 +1,161 @@
+/* CSS Document */
+* {
+ margin: 0;
+ padding: 0;
+}
+body {
+ color: #333;
+ font: 76% Verdana, Arial, Helvetica, sans-serif;
+}
+h1 {
+ color: #69c;
+ font-size:2.1em;
+}
+h2 {
+ color: #383;
+ clear: both;
+ display:block;
+ font-size:1.7em;
+ float:left;
+ margin-top:5px;
+}
+h3 {
+ color: #553;
+ font-size:1.4em;
+}
+h4 {
+ color: #338;
+ font-size:1.15em;
+}
+a {
+ text-decoration:underline;
+ white-space:nowrap;
+}
+a:hover {
+ background-color:#eee;
+}
+code, pre {
+ color:#44a;
+ font-family:monospace;
+ font-size:1.15em;
+}
+code {
+ color:#227;
+ margin:0 .2em;
+ white-space:nowrap;
+}
+pre {
+ margin-left:1em;
+}
+acronym {
+ border-bottom:1px dotted #666;
+}
+ul {
+ margin-top:1em;
+ list-style:none;
+}
+li {
+ margin-left:2em;
+}
+#container {
+ color: #333;
+ margin: 2em auto;
+ width:80%;
+}
+.notice {
+ background: #ffd;
+ border: solid 2px #eeb;
+ display: block;
+ font-family: Verdana;
+ padding: 1em;
+}
+.tip {
+ background: #efe;
+ border: solid 2px #cdc;
+ padding: 1em;
+}
+.error {
+ background: #fee;
+ border: solid 2px #dcc;
+ padding: 1em;
+}
+ul.actions {
+ float:left;
+ list-style: none;
+ text-align:right;
+ margin:2em 0;
+}
+ul.actions li {
+ border: 1px solid #333;
+ float:left;
+ margin-left:1em;
+ width:10em;
+}
+ul.actions li a, ul.actions li input {
+ background-color:#3297FC;
+ border:1px solid #3297FC;
+ clear: both;
+ color: #fff;
+ display:block;
+ font-weight: bold;
+ text-align:center;
+ text-decoration: none;
+}
+td.listactions {
+ width:17em;
+}
+td.listactions a {
+ text-align:center;
+ font-weight: bold;
+ color: #fff;
+ background-color:#3297FC;
+ display:block;
+ float:left;
+ text-decoration: none;
+ margin-bottom:3px;
+ margin-right: 3px;
+ border: 1px;
+ width:5em;
+}
+table {
+ background-color: #fff;
+ border: 1px solid #686E74;
+ clear:both;
+ margin: 1em 0 2em 0;
+ width: 100%;
+}
+th {
+ background-color: #ccc;
+ border-top: 1px solid #fff;
+ border-right: 1px solid #666;
+ border-bottom: 1px solid #666;
+ text-align: left;
+ padding:3px;
+ white-space:nowrap;
+}
+table tr td {
+ border-right: 1px solid #ccc;
+ padding:2px 0;
+ vertical-align:top;
+}
+table tr.altRow td {
+ background: #EBF4FD;
+}
+div.related {
+ clear:both;
+ display:block;
+ float:left;
+}
+dl {
+ line-height:2em;
+ margin:1em;
+}
+dt {
+ font-weight: bold;
+ vertical-align:top;
+}
+dd {
+ margin-left:10em;
+ margin-top:-2em;
+ vertical-align:top;
+}
View
BIN app/webroot/favicon.ico
Binary file not shown.
View
0 public/files/put_downloadable_files_here → ...webroot/files/put_downloadable_files_here
File renamed without changes.
View
BIN app/webroot/img/cake.bg.body.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 public/img/bg_header.gif → app/webroot/img/cake.bg.header.gif
File renamed without changes
View
0 public/img/logo.png → app/webroot/img/cake.logo.png
File renamed without changes
View
0 public/img/red_box.gif → app/webroot/img/cake.redbox.gif
File renamed without changes
View
0 public/img/pbcake.gif → app/webroot/img/pbcake.gif
File renamed without changes
View
90 public/index.php → app/webroot/index.php
@@ -33,11 +33,6 @@
/**
- * Enter description here...
- */
-$url = empty($_GET['url'])? null: $_GET['url'];
-
-/**
* Get Cake's root directory
*/
if (!defined('DS'))
@@ -54,25 +49,70 @@
* Enter description here...
*
*/
- define('ROOT', dirname(dirname(__FILE__)).DS);
+ define('ROOT', dirname(dirname(dirname(__FILE__))).DS);
}
+if (!defined('APP_DIR'))
+{
+ define ('APP_DIR', basename(dirname(dirname(__FILE__))));
+}
+
+if (!defined('WEBROOT_DIR'))
+{
+ define ('WEBROOT_DIR', basename(dirname(__FILE__)));
+}
+
+
+/**
+ * Configuration, directory layout and standard libraries
+ */
+require_once ROOT.APP_DIR.DS.'config'.DS.'core.php';
+require_once ROOT.APP_DIR.DS.'config'.DS.'paths.php';
+require_once CAKE.'basics.php';
+require_once LIBS.'log.php';
+require_once LIBS.'object.php';
+require_once LIBS.'neat_array.php';
+require_once LIBS.'inflector.php';
+
+/**
+ * Enter description here...
+ */
+
+ if (empty($uri) && defined('BASE_URL'))
+ {
+ $uri = setUri();
+ if ($uri === '/' || $uri === '/index.php' || $uri === '/app/')
+ {
+ $_GET['url'] = '/';
+ $url = '/';
+ }
+ else
+ {
+ $elements = explode('/index.php', $uri);
+ if(!empty($elements[1]))
+ {
+ $_GET['url'] = $elements[1];
+ $url = $elements[1];
+ }
+ else
+ {
+ $_GET['url'] = '/';
+ $url = '/';
+ }
+ }
+ }
+ else
+ {
+ $url = empty($_GET['url'])? null: $_GET['url'];
+ }
+
+
if (strpos($url, 'ccss/') === 0)
{
include ROOT.'public'.DS.'css.php';
die;
}
-/**
- * Configuration, directory layout and standard libraries
- */
-require_once ROOT.'config/core.php';
-require_once ROOT.'config/paths.php';
-require_once ROOT.'libs/basics.php';
-require_once ROOT.'libs/log.php';
-require_once ROOT.'libs/object.php';
-require_once ROOT.'libs/neat_array.php';
-require_once ROOT.'libs/inflector.php';
DEBUG? error_reporting(E_ALL): error_reporting(0);
if (DEBUG)
@@ -82,9 +122,15 @@
$TIME_START = getMicrotime();
-uses('folder', 'dispatcher', 'dbo_factory');
+uses('folder');
+require_once CAKE.'dispatcher.php';
+require_once LIBS.'model'.DS.'dbo'.DS.'dbo_factory.php';
-session_start();
+if(!defined('AUTO_SESSION') || AUTO_SESSION == true)
+{
+ // Starts the session unless AUTO_SESSION is explicitly set to false in config/core
+ session_start();
+}
config('database');
@@ -93,14 +139,16 @@
loadModels();
}
+
+
//RUN THE SCRIPT
if(isset($_GET['url']) && $_GET['url'] === 'favicon.ico')
{
}else{
- $DISPATCHER = new Dispatcher ();
- $DISPATCHER->dispatch($url);
+ $Dispatcher= new Dispatcher ();
+ $Dispatcher->dispatch($url);
}
-//CLEANUP
+
if (DEBUG) {
echo "<!-- ". round(getMicrotime() - $TIME_START, 2) ."s -->";
}
View
0 public/js/vendors.php → app/webroot/js/vendors.php
File renamed without changes.
View
0 app/app_controller.php → cake/app_controller.php
File renamed without changes.
View
0 app/app_model.php → cake/app_model.php
File renamed without changes.
View
94 libs/basics.php → cake/basics.php
@@ -51,11 +51,18 @@
*/
function loadModels ()
{
- require (APP.'app_model.php');
- foreach (listClasses(MODELS) as $model_fn)
- {
- require_once (MODELS.$model_fn);
- }
+ if(file_exists(APP.'app_model.php'))
+ {
+ require_once(APP.'app_model.php');
+ }
+ else
+ {
+ require_once(CAKE.'app_model.php');
+ }
+ foreach (listClasses(MODELS) as $model_fn)
+ {
+ require_once (MODELS.$model_fn);
+ }
}
/**
@@ -67,18 +74,20 @@ function loadModels ()
* @uses CONTROLLERS
*/
function loadControllers ()
-{
- require (APP.'app_controller.php');
-
- foreach (listClasses(HELPERS) as $helper)
- {
- require_once (HELPERS.$helper.'.php');
- }
-
- foreach (listClasses(CONTROLLERS) as $controller)
- {
- require_once (CONTROLLERS.$controller.'.php');
- }
+{
+ if(file_exists(APP.'app_controller.php'))
+ {
+ require_once(APP.'app_controller.php');
+ }
+ else
+ {
+ require_once(CAKE.'app_controller.php');
+ }
+
+ foreach (listClasses(CONTROLLERS) as $controller)
+ {
+ require_once (CONTROLLERS.$controller.'.php');
+ }
}
/**
@@ -89,15 +98,29 @@ function loadControllers ()
*/
function loadController ($name)
{
- $controller_fn = CONTROLLERS.Inflector::underscore($name).'_controller.php';
- $helper_fn = HELPERS.Inflector::underscore($name).'_helper.php';
-
- require_once(APP.'app_controller.php');
-
- if (file_exists($helper_fn))
- require_once($helper_fn);
-
- return file_exists($controller_fn)? require_once($controller_fn): false;
+ if(file_exists(CONTROLLERS.Inflector::underscore($name).'_controller.php'))
+ {
+ $controller_fn = CONTROLLERS.Inflector::underscore($name).'_controller.php';
+ }
+ elseif(file_exists(LIBS.'controller'.DS.Inflector::underscore($name).'_controller.php'))
+ {
+ $controller_fn = LIBS.'controller'.DS.Inflector::underscore($name).'_controller.php';
+ }
+ else
+ {
+ $controller_fn = false;
+ }
+
+ if(file_exists(APP.'app_controller.php'))
+ {
+ require_once(APP.'app_controller.php');
+ }
+ else
+ {
+ require_once(CAKE.'app_controller.php');
+ }
+
+ return file_exists($controller_fn)? require_once($controller_fn): false;
}
/**
@@ -335,4 +358,23 @@ function params($p)
}
+function setUri() {
+ if (isset($_SERVER['REQUEST_URI']))
+ {
+ $uri = $_SERVER['REQUEST_URI'];
+ }
+ else
+ {
+ if (isset($_SERVER['argv']))
+ {
+ $uri = $_SERVER['PHP_SELF'] .'/'. $_SERVER['argv'][0];
+ }
+ else
+ {
+ $uri = $_SERVER['PHP_SELF'] .'/'. $_SERVER['QUERY_STRING'];
+ }
+ }
+ return $uri;
+}
+
?>
View
84 libs/dispatcher.php → cake/dispatcher.php
@@ -35,7 +35,7 @@
/**
* Add Description
*/
-uses('error_messages', 'object', 'router', 'controller', 'scaffold');
+uses('error_messages', 'object', 'router', '/controller/controller', '/controller/scaffold');
/**
* Short description for class.
@@ -85,7 +85,6 @@ function dispatch($url, $additionalParams=array())
$params['render'] = 0;
}
-
if (empty($params['controller']))
{
$missingController = true;
@@ -103,15 +102,16 @@ function dispatch($url, $additionalParams=array())
if ($missingController)
{
- $ctrlClass = 'AppController';
- $controller = new $ctrlClass($this);
+ $controller =& new AppController();
$params['action'] = 'missingController';
$params['controller'] = Inflector::camelize($params['controller']."Controller");
$controller->missingController = $params['controller'];
+ $controller->webroot = $this->webroot;
+ return $this->_invoke($controller, $params );
}
else
{
- $controller = new $ctrlClass($this);
+ $controller =& new $ctrlClass($this);
}
$classMethods = get_class_methods($controller);
@@ -129,6 +129,7 @@ function dispatch($url, $additionalParams=array())
$controller->base = $this->base;
$controller->here = $this->base.'/'.$url;
+ $controller->webroot = $this->webroot;
$controller->params = $params;
$controller->action = $params['action'];
$controller->data = empty($params['data'])? null: $params['data'];
@@ -235,21 +236,76 @@ function urldecode_deep($val)
*/
function baseUrl()
{
- if (defined('BASE_URL'))
- {
- return BASE_URL;
- }
+ $base = null;
+ if (defined('BASE_URL'))
+ {
+ $base = BASE_URL;
+ }
$docRoot = $_SERVER['DOCUMENT_ROOT'];
$scriptName = $_SERVER['PHP_SELF'];
+
- // if document root ends with 'public', it's probably correctly set
+ // if document root ends with 'webroot', it's probably correctly set
$r = null;
- if (ereg('/^.*/public(\/)?$/', $docRoot))
- return preg_match('/^(.*)\/index\.php$/', $scriptName, $r)? $r[1]: false;
+ if (preg_match('/\\/'.APP_DIR.'\/'.WEBROOT_DIR.'(\/)?$/i', $docRoot))
+ {
+ $this->webroot = DS;
+ //return preg_match('/\\/index.php(\/)?$/i', $scriptName, $r)? $base.$r[1]: $base;
+ if (preg_match('/\\/index.php(\/)?$/i', $scriptName, $r))
+ {
+ if(!empty($r[1]))
+ {
+ return $base.$r[1];
+ }
+ else
+ {
+ return $base;
+ }
+ }
+ else
+ {
+ return $base;
+ }
+ }
else
- // document root is probably not set to Cake 'public' dir
- return preg_match('/^(.*)\/public\/index\.php$/', $scriptName, $r)? $r[1]: false;
+ {
+ if(empty($base)){
+ $isDir = explode('/', setUri());
+ $first = $isDir[1];
+ $webPath[] = DS.$first.DS;
+ foreach ($isDir as $dirName)
+ {
+ if(!empty($dirName) && is_dir($docRoot.$first.DS.$dirName))
+ {
+ $webPath[] = $dirName.DS;
+ }
+ }
+ $webroot = implode('', $webPath);
+ $base = substr($webroot, 0, -1);
+ }
+ else
+ {
+ $webroot =setUri();
+ }
+ $this->webroot = preg_replace('/(?:'.APP_DIR.'(.*)|index\\.php(.*))/i', '', $webroot).APP_DIR.DS.WEBROOT_DIR.DS;
+ // document root is probably not set to Cake 'webroot' dir
+ if (preg_match('/\\/index.php(\/)?$/i', $scriptName, $r))
+ {
+ if(!empty($r[1]))
+ {
+ return $base.$r[1];
+ }
+ else
+ {
+ return $base;
+ }
+ }
+ else
+ {
+ return $base;
+ }
+ }
}
View
0 docs/CHANGELOG.txt → cake/docs/CHANGELOG.txt
File renamed without changes.
View
0 docs/COPYING.txt → cake/docs/COPYING.txt
File renamed without changes.
View
0 docs/CREDITS.txt → cake/docs/CREDITS.txt
File renamed without changes.
View
0 docs/LICENSE.txt → cake/docs/LICENSE.txt
File renamed without changes.
View
0 docs/README.txt → cake/docs/README.txt
File renamed without changes.
View
0 libs/cache.php → cake/libs/cache.php
File renamed without changes.
View
0 libs/class_registry.php → cake/libs/class_registry.php
File renamed without changes.
View
0 libs/acl.php → cake/libs/controller/components/acl.php
File renamed without changes.
View
0 libs/acl_base.php → cake/libs/controller/components/acl_base.php
File renamed without changes.
View
48 libs/controller.php → cake/libs/controller/controller.php
@@ -32,8 +32,7 @@
/**
* Include files
*/
-uses('model', 'inflector', 'folder', 'view', 'helper');
-
+uses('/model/model', 'inflector', 'folder', '/view/view', '/view/helper');
/**
* Controller
@@ -374,6 +373,7 @@ function render($action=null, $layout=null, $file=null)
*/
function missingController()
{
+ $this->autoLayout = true;
$this->pageTitle = 'Missing Controller';
$this->render('../errors/missingController');
}
@@ -384,6 +384,7 @@ function missingController()
*/
function missingAction()
{
+ $this->autoLayout = true;
$this->pageTitle = 'Missing Method in Controller';
$this->render('../errors/missingAction');
}
@@ -394,6 +395,7 @@ function missingAction()
*/
function missingDatabase()
{
+ $this->autoLayout = true;
$this->pageTitle = 'Scaffold Missing Database Connection';
//We are simulating action call below, this is not a filename!
$this->render('../errors/missingScaffolddb');
@@ -405,18 +407,47 @@ function missingDatabase()
*/
function missingTable($tableName)
{
+ $this->autoLayout = true;
$this->missingTableName = $tableName;
$this->pageTitle = 'Missing Database Table';
//We are simulating action call below, this is not a filename!
$this->render('../errors/missingTable');
}
/**
+ * Renders the Missing Helper file web page.
+ *
+ */
+ function missingHelperFile($file)
+ {
+ $this->missingHelperFile = $file;
+ $this->missingHelperClass = Inflector::camelize($file) . "Helper";
+ $this->pageTitle = 'Missing Helper File';
+ //We are simulating action call below, this is not a filename!
+ $this->render('../errors/missingHelperFile');
+ }
+
+
+/**
+ * Renders the Missing Helper class web page.
+ *
+ */
+ function missingHelperClass($class)
+ {
+ $this->missingHelperClass = Inflector::camelize($class) . "Helper";
+ $this->missingHelperFile = Inflector::underscore($class);
+ $this->pageTitle = 'Missing Helper Class';
+ //We are simulating action call below, this is not a filename!
+ $this->render('../errors/missingHelperClass');
+ }
+
+/**
* Renders the Missing Table web page.
*
*/
function missingConnection()
{
+ $this->autoLayout = true;
$this->pageTitle = 'Missing Database Connection';
//We are simulating action call below, this is not a filename!
$this->render('../errors/missingDatabase');
@@ -480,7 +511,18 @@ function flash($message, $url, $pause=1)
$this->set('pause', $pause);
$this->set('page_title', $message);
- $this->render(null,false,VIEWS.'layouts'.DS.'flash.thtml');
+ if(file_exists(VIEWS.'layouts'.DS.'flash.thtml'))
+ {
+ $flash = VIEWS.'layouts'.DS.'flash.thtml';
+ }
+ else if(file_exists(LIBS.'view'.DS.'templates'.DS."layouts".DS.'flash.thtml'))
+ {
+ $flash = LIBS.'view'.DS.'templates'.DS."layouts".DS.'flash.thtml';
+ }
+
+
+
+ $this->render(null,false,$flash);
}
/**
View
3 app/controllers/pages_controller.php → cake/libs/controller/pages_controller.php
@@ -45,7 +45,7 @@
* @package cake
* @subpackage cake.app.controllers
*/
-class PagesController extends PagesHelper{
+class PagesController extends AppController{
/**
* Enter description here...
@@ -72,7 +72,6 @@ function display()
{
$this->redirect('/');
}
-
$this->set('page', $path[0]);
$this->set('subpage', empty($path[1])? null: $path[1]);
$this->set('title', ucfirst($path[count($path)-1]));
View
17 libs/scaffold.php → cake/libs/controller/scaffold.php
@@ -34,7 +34,7 @@
/**
* Enter description here...
*/
-uses('model', 'template', 'inflector', 'object');
+uses('/model/model', 'inflector', 'object');