diff --git a/app/apis/my_acl.php b/app/apis/my_acl.php new file mode 100644 index 000000000..10d9185a7 --- /dev/null +++ b/app/apis/my_acl.php @@ -0,0 +1,185 @@ + + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * @filesource + * @package cake + * @subpackage cake.app.helpers + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + */ + +uses('acl_base'); + +/** + * In this file you can extend the AclBase. + * + * @package cake + * @subpackage cake.app.apis + */ + +class MyACL extends AclBase +{ + /** + * The constructor must be overridden, as AclBase is abstract. + * + */ + function __construct() + { + + } + + /** + * Main ACL check function. Checks to see if the ARO (access request object) has access to the ACO (access control object). + * Looks at the acl.ini.php file for permissions (see instructions in /config/acl.ini.php). + * + * @param string $aro + * @param string $aco + * @return boolean + */ + function check($aro, $aco) + { + $aclConfig = $this->readConfigFile(CONFIGS . 'acl.ini.php'); + + //First, if the user is specifically denied, then DENY + if(isset($aclConfig[$aro]['deny'])) + { + $userDenies = $this->arrayTrim(explode(",", $aclConfig[$aro]['deny'])); + if (array_search($aco, $userDenies)) + { + //echo "User Denied!"; + return false; + } + } + + //Second, if the user is specifically allowed, then ALLOW + if(isset($aclConfig[$aro]['allow'])) + { + $userAllows = $this->arrayTrim(explode(",", $aclConfig[$aro]['allow'])); + if (array_search($aco, $userAllows)) + { + //echo "User Allowed!"; + return true; + } + } + + //Check group permissions + if (isset($aclConfig[$aro]['groups'])) + { + $userGroups = $this->arrayTrim(explode(",", $aclConfig[$aro]['groups'])); + foreach ($userGroups as $group) + { + //If such a group exists, + if(array_key_exists($group, $aclConfig)) + { + //If the group is specifically denied, then DENY + if(isset($aclConfig[$group]['deny'])) + { + $groupDenies = $this->arrayTrim(explode(",", $aclConfig[$group]['deny'])); + if (array_search($aco, $groupDenies)) + { + //echo("Group Denied!"); + return false; + } + } + + //If the group is specifically allowed, then ALLOW + if(isset($aclConfig[$group]['allow'])) + { + $groupAllows = $this->arrayTrim(explode(",", $aclConfig[$group]['allow'])); + if (array_search($aco, $groupAllows)) + { + //echo("Group Allowed!"); + return true; + } + } + } + } + } + + //Default, DENY + //echo("DEFAULT: DENY."); + return false; + } + + /** + * Parses an INI file and returns an array that reflects the INI file's section structure. Double-quote friendly. + * + * @param string $fileName + * @return array + */ + function readConfigFile ($fileName) + { + $fileLineArray = file($fileName); + + foreach ($fileLineArray as $fileLine) + { + $dataLine = trim($fileLine); + $firstChar = substr($dataLine, 0, 1); + if ($firstChar != ';' && $dataLine != '') + { + if ($firstChar == '[' && substr($dataLine, -1, 1) == ']') + { + $sectionName = preg_replace('/[\[\]]/', '', $dataLine); + } + else + { + $delimiter = strpos($dataLine, '='); + if ($delimiter > 0) + { + $key = strtolower(trim(substr($dataLine, 0, $delimiter))); + $value = trim(substr($dataLine, $delimiter + 1)); + if (substr($value, 0, 1) == '"' && substr($value, -1) == '"') + { + $value = substr($value, 1, -1); + } + $iniSetting[$sectionName][$key] = stripcslashes($value); + } + else + { + if(!isset($sectionName)) + { + $sectionName = ''; + } + $iniSetting[$sectionName][strtolower(trim($dataLine))]=''; + } + } + } + else + { + } + } + return $iniSetting; + } + + /** + * Removes trailing spaces on all array elements (to prepare for searching) + * + * @param array $array + * @return array + */ + function arrayTrim($array) + { + foreach($array as $element) { + $element = trim($element); + } + + //Adding this element keeps array_search from returning 0: + //0 is the first key, which may be correct, but 0 is interpreted as false. + //Adding this element makes all the keys be positive integers. + array_unshift($array, ""); + return $array; + } + +} + +?> \ No newline at end of file diff --git a/app/app_controller.php b/app/app_controller.php index db2ae6bff..447248dac 100644 --- a/app/app_controller.php +++ b/app/app_controller.php @@ -1,34 +1,46 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** + * Short description for file. + * + * This file is application-wide controller file. You can put all + * application-wide controller-related methods here. + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. * * @filesource - * @package cake - * @subpackage cake.app - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @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 + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** - * This file is application-wide controller file. You can put all - * application-wide controller-related methods here. + * Short description for class. * * Add your application-wide methods in the class below, your controllers * will inherit them. * - * @package cake + * @package cake * @subpackage cake.app */ - class AppController extends Controller { } diff --git a/app/app_model.php b/app/app_model.php index 441da4e07..2500add26 100644 --- a/app/app_model.php +++ b/app/app_model.php @@ -1,34 +1,46 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * @filesource - * @package cake - * @subpackage cake.app - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - */ +/* SVN FILE: $Id$ */ /** + * Short description for file. + * * This file is application-wide model file. You can put all * application-wide model-related methods here. - * + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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 + * @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. + * * Add your application-wide methods in the class below, your models * will inherit them. * - * @package cake + * @package cake * @subpackage cake.app */ - class AppModel extends Model { } diff --git a/app/controllers/pages_controller.php b/app/controllers/pages_controller.php index 50d990e60..5788e33cf 100644 --- a/app/controllers/pages_controller.php +++ b/app/controllers/pages_controller.php @@ -1,32 +1,48 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -////////////////////////////////////////////////////////////////////////// - +/* SVN FILE: $Id$ */ /** + * Short description for file. + * + * This file is application-wide controller file. You can put all + * application-wide controller-related methods here. + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. * * @filesource - * @package cake - * @subpackage cake.app.controllers - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @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. + * * This file is application-wide controller file. You can put all * application-wide controller-related methods here. * * Add your application-wide methods in the class below, your controllers * will inherit them. * - * @package cake + * @package cake * @subpackage cake.app.controllers */ class PagesController extends PagesHelper{ @@ -35,7 +51,7 @@ class PagesController extends PagesHelper{ * Enter description here... * * @var unknown_type -*/ + */ var $helpers = array('html', 'ajax'); diff --git a/app/controllers/tests_controller.php b/app/controllers/tests_controller.php index ae9a8e733..f85ea43a6 100644 --- a/app/controllers/tests_controller.php +++ b/app/controllers/tests_controller.php @@ -1,39 +1,60 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. * * @filesource - * @package cake - * @subpackage cake.app.controllers - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @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. * - * @package cake + * Long description for class + * + * @package cake * @subpackage cake.app.controllers */ class TestsController extends TestsHelper { - + + function index () + { + $this->layout = null; + require_once TESTS.'menu.php'; + } /** * Runs all library and application tests * */ - function test_all () - { - $this->layout = null; - require_once SCRIPTS.'test.php'; - } +// function test_all () +// { +// $this->layout = null; +// require_once SCRIPTS.'test.php'; +// } } ?> diff --git a/app/helpers/pages_helper.php b/app/helpers/pages_helper.php index 6617c9b26..e0e28db00 100644 --- a/app/helpers/pages_helper.php +++ b/app/helpers/pages_helper.php @@ -1,27 +1,42 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * @filesource - * @package cake - * @subpackage cake.app.helpers - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - */ +/* SVN FILE: $Id$ */ /** + * Short description for file. + * * In this file you can extend the PagesController. * - * @package cake + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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 */ diff --git a/app/helpers/tests_helper.php b/app/helpers/tests_helper.php index ccc5a079e..0a75dcae2 100644 --- a/app/helpers/tests_helper.php +++ b/app/helpers/tests_helper.php @@ -1,27 +1,42 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** + * Short description for file. + * + * In this file you can extend the TestsController. + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. * * @filesource - * @package cake - * @subpackage cake.app.helpers - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @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 */ /** - * In this file you can extend the TestsController. + * Short description for class. * - * @package cake + * Long description for class + * + * @package cake * @subpackage cake.app.helpers */ diff --git a/app/views/layouts/default.thtml b/app/views/layouts/default.thtml index 016fb9570..ffe562245 100644 --- a/app/views/layouts/default.thtml +++ b/app/views/layouts/default.thtml @@ -1,5 +1,5 @@ - + <?=$title_for_layout?> charsetTag('UTF-8')?> @@ -8,10 +8,8 @@ -
-
- -
+
+
diff --git a/app/views/pages/home.thtml b/app/views/pages/home.thtml index 338238c34..ee3832d65 100644 --- a/app/views/pages/home.thtml +++ b/app/views/pages/home.thtml @@ -1,36 +1,29 @@ -

Cake PHP works!

+

CakePHP Works!


+
+Your database configuration file is
+ + +Cake connected ? "is able to" : "is not able to" ?> connect to the database. + +
+
+

Editing this Page

+

+To change the content of this page, edit /app/views/pages/home.thtml. To change it's layout, edit /app/views/layouts/default.thtml. You can also edit the CSS styles for this page at /public/css/default.css. +


-

Your installation of Cake PHP is functional. Edit /app/views/pages/home.thtml to change the contents of this page.

+

Introducing Cake

-

Introducing Cake PHP

+

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.


+

Tired of repeating yourself? Ever copy and pasted code? Want to get your app in production quicker? Cake is for you.


-

Cake is a structure of libraries, classes and run-time infrastructure for PHP programmers. It's also what It's original author, Michal uses at work. It's based on certain conventions, so you may find it rigid at first. The directory structure is already laid out, and it's different from what most people use. From what We've experienced, a great many PHP programmers start as web- or graphic-designers, i.e. they are not university-educated programmers as many in C++ and Java-land. They invent their own, peculiar ways of solving problems and stick to them. Perhaps that's why so few people use linkOut('PEAR', 'http://pear.php.net')?> and linkOut('PECL', 'http://pecl.php.net')?> libraries – they don't usually re-use their code.

- -

Cake PHP builds on a concept introduced in linkOut('Ruby on Rails', 'http://rubyonrails.com')?> – it enables rapid developement of feature-rich websites.

- -

Features

- -
    -
  • Compatibile with PHP4 and PHP5.
  • -
  • Supplies integrated CRUD for databases.
  • -
  • Pretty URL's that work with and without mod_rewrite.
  • -
  • Fast, flexible templating (PHP syntax with helper methods).
  • -
  • Suported database-types: MySQL, PostgreSQL and SQLIte
  • -
  • Suported webservers: Apache (others will most likely also work)
  • -
- -

Cake is still in its early infancy, but we are proceeding in good direction – table joins will most probably get added in 0.9.3 release, and better support for user-defined settings is also underway.

- -

Getting involved

- -

Cake PHP needs you! We have already quiet active user base, but we are allways open to new bug reports or feature ideas!

- -
    -
  • linkOut('Google Group','http://groups-beta.google.com/group/cake-php')?> – for public discussions about everything Cake.
  • -
  • linkOut('Wiki','https://trac.cakephp.org/wiki')?> – fastest way of getting newest information on Cake PHP.
  • -
  • linkOut('Report a bug or feature request','https://trac.cakephp.org/newticket')?>.
  • -
  • linkOut('Roadmap','https://trac.cakephp.org/roadmap')?> – check our plans for the bright future.
  • -
- -

Soon there will be oficial linkOut('Cake PHP website','http://www.cakephp.org/')?>, so stay tuned.

-

Also see Cake PHP's original authors linkOut('Amazon wishlish','http://www.amazon.com/gp/registry/registry.html?id=NODP8QT6LFTO')?> if you want to show appreciation for his work on the project.

\ No newline at end of file +

Get Involved

+

Cake PHP needs you! We have an active user base and are always open to new bug reports or feature ideas!


+linkOut('Google Group','http://groups-beta.google.com/group/cake-php')?> – for public discussions about everything Cake.
+linkOut('Wiki','https://trac.cakephp.org/wiki')?> – fastest way of getting newest information on Cake PHP.
+linkOut('Report a bug or feature request','https://trac.cakephp.org/newticket')?>.
+linkOut('Roadmap','https://trac.cakephp.org/roadmap')?> – check our plans for the bright future.
+#cakephp on irc.euirc.net for quick help
+

+
+

Cake 0.9.2

\ No newline at end of file diff --git a/config/acl.ini.php b/config/acl.ini.php new file mode 100644 index 000000000..0940ec8a8 --- /dev/null +++ b/config/acl.ini.php @@ -0,0 +1,50 @@ + + +; acl.ini.php - Cake ACL Configuration +; --------------------------------------------------------------------- +; Use this file to specify user permissions. +; aco = access control object (something in your application) +; aro = access request object (something requesting access) +; +; User records are added as follows: +; +; [uid] +; groups = group1, group2, group3 +; allow = aco1, aco2, aco3 +; deny = aco4, aco5, aco6 +; +; Group records are added in a similar manner: +; +; [gid] +; allow = aco1, aco2, aco3 +; deny = aco4, aco5, aco6 +; +; The allow, deny, and groups sections are all optional. +; NOTE: groups names *cannot* ever be the same as usernames! +; +; ACL permissions are checked in the following order: +; 1. Check for user denies (and DENY if specified) +; 2. Check for user allows (and ALLOW if specified) +; 3. Gather user's groups +; 4. Check group denies (and DENY if specified) +; 5. Check group allows (and ALLOW if specified) +; 6. If no aro, aco, or group information is found, DENY +; +; --------------------------------------------------------------------- + +;------------------------------------- +;Users +;------------------------------------- + +[username-goes-here] +groups = group1, group2 +deny = aco1, aco2 +allow = aco3, aco4 + +;------------------------------------- +;Groups +;------------------------------------- + +[groupname-goes-here] +deny = aco5, aco6 +allow = aco7, aco8 \ No newline at end of file diff --git a/config/core.php b/config/core.php index 539096d08..7ffa6cb2a 100644 --- a/config/core.php +++ b/config/core.php @@ -1,19 +1,34 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * This is core configuration file. Use it to configure core behaviour of - * Cake. + * This is core configuration file. * - * @package cake - * @subpackage cake.config + * Use it to configure core behaviour ofCake. + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.config + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** @@ -22,13 +37,24 @@ * - 1: development * - 2: full debug with sql */ -define ('DEBUG', 1); +define('DEBUG', 1); /** * Compress output CSS (removing comments, whitespace, repeating tags etc.) * This requires a /var/cache directory to be writable by the web server (caching). * To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use Controller::cssTag(). */ -define ('COMPRESS_CSS', false); +define('COMPRESS_CSS', false); + +/** + * If set to true, helpers would output data instead of returning it. + */ +define('AUTO_OUTPUT', false); + +/** + * To use Access Control Lists with Cake... + */ +define('ACL_CLASSNAME', 'MyACL'); +define('ACL_FILENAME', 'my_acl.php'); ?> \ No newline at end of file diff --git a/config/paths.php b/config/paths.php index b4a9f074a..9fef1f253 100644 --- a/config/paths.php +++ b/config/paths.php @@ -1,18 +1,34 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * In this file you set paths to different directories used by Cake. + * Short description for file. * - * @package cake - * @subpackage cake.config + * In this file you set paths to different directories used by Cake. + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.config + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** diff --git a/config/routes.php b/config/routes.php index bbb741a39..391cc8d9b 100644 --- a/config/routes.php +++ b/config/routes.php @@ -1,20 +1,36 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** + * Short description for file. + * * In this file, you set up routes to your controllers and their actions. * Routes are very important mechanism that allows you to freely connect * different urls to chosen controllers and their actions (functions). - * - * @package cake - * @subpackage cake.config + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.config + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** diff --git a/config/tags.ini.php b/config/tags.ini.php new file mode 100644 index 000000000..ba5e491a3 --- /dev/null +++ b/config/tags.ini.php @@ -0,0 +1,108 @@ +; +; SVN FILE: $Id$ +;/** +; * Short description for file. +; * +; * In this file, you can set up 'templates' for every tag generated by the tag +; * generator. +; * +; * PHP versions 4 and 5 +; * +; * CakePHP : Rapid Development Framework +; * Copyright (c) 2005, CakePHP Authors/Developers +; * +; * Author(s): Michal Tatarynowicz aka Pies +; * Larry E. Masters aka PhpNut +; * Kamil Dzielinski aka Brego +; * +; * 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.config +; * @since CakePHP v 0.2.9 +; * @version $Revision$ +; * @modifiedby $LastChangedBy$ +; * @lastmodified $Date$ +; * @license http://www.opensource.org/licenses/mit-license.php The MIT License +; */ + + +; Tag template for a link. +link = "%s" + +; Tag template for a mailto: link. +mailto = "%s" + +; Tag template for opening form tag. +form = "
" + +; Tag template for an input type='text' tag. +input = "" + +; Tag template for an input type='textarea' tag +textarea = "" + +; Tag template for an input type='hidden' tag. +hidden = "" + +; Tag template for a textarea tag. +textarea = "" + +; Tag template for a input type='checkbox ' tag. +checkbox = "" + +; Tag template for a input type='radio' tag. +radio = "" + +; Tag template for a select opening tag. +selectStart = "" + +; Tag template for a password tag. +password = "" + +; Tag template for a file input tag. +file = "" + +; Tag template for a submit button tag. +submit = "" + +; Tag template for an image tag. +image =" " + +; Tag template for a table header tag. +tableHeader = "%s" + +; Tag template for table headers row tag. +tableHeaderRow = "%s" + +; Tag template for a table cell tag. +tableCell = "%s" + +; Tag template for a table row tag. +tableRow = "%s" + +; Tag template for a CSS link tag. +css = "" + +; Tag template for a charset meta-tag. +charset = "" + +; Tag template for inline JavaScript. +javascriptBlock = "" + +; Tag template for included JavaScript. +javascriptLink = "" \ No newline at end of file diff --git a/config/tags.php b/config/tags.php deleted file mode 100644 index 09c8fe3b5..000000000 --- a/config/tags.php +++ /dev/null @@ -1,139 +0,0 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -////////////////////////////////////////////////////////////////////////// - -/** - * In this file, you can set up 'templates' for every tag generated by the tag - * generator. - * - * @package cake - * @subpackage cake.config - */ - -/** - * Tag template for a link. - */ -define('TAG_LINK', '%s'); - -/** - * Tag template for a mailto: link. - */ -define('TAG_MAILTO', '%s'); - -/** - * Tag template for opening form tag. - */ -define('TAG_FORM', ''); - -/** - * Tag template for an input type='text' tag. - */ -define('TAG_INPUT', ''); - -/** - * Tag template for an input type='hidden' tag. - */ -define('TAG_HIDDEN', ''); - -/** - * Tag template for a textarea tag. - */ -define('TAG_AREA', ''); - -/** - * Tag template for a input type='checkbox ' tag. - */ -define('TAG_CHECKBOX', ''); - -/** - * Tag template for a input type='radio' tag. - */ -define('TAG_RADIOS', ''); - -/** - * Tag template for a select opening tag. - */ -define('TAG_SELECT_START', ''); - -/** - * Tag template for a password tag. - */ -define('TAG_PASSWORD', ''); - -/** - * Tag template for a file input tag. - */ -define('TAG_FILE', ''); - -/** - * Tag template for a submit button tag. - */ -define('TAG_SUBMIT', ''); - -/** - * Tag template for an image tag. - */ -define('TAG_IMAGE', '%s'); - -/** - * Tag template for a table header tag. - */ -define('TAG_TABLE_HEADER', '%s'); - -/** - * Tag template for table headers row tag. - */ -define('TAG_TABLE_HEADERS','%s'); - -/** - * Tag template for a table cell tag. - */ -define('TAG_TABLE_CELL', '%s'); - -/** - * Tag template for a table row tag. - */ -define('TAG_TABLE_ROW', '%s'); - -/** - * Tag template for a CSS link tag. - */ -define('TAG_CSS', ''); - -/** - * Tag template for a charset meta-tag. - */ -define('TAG_CHARSET', ''); - -/** - * Tag template for inline JavaScript. - */ -define('TAG_JAVASCRIPT', ''); - -/** - * Tag template for included JavaScript. - */ -define('TAG_JAVASCRIPT_INCLUDE', ''); - -?> diff --git a/index.php b/index.php index 23bc190de..06176ca8d 100644 --- a/index.php +++ b/index.php @@ -1,33 +1,35 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** + * Short description for file. + * * This file collects requests if: * - no mod_rewrite is avilable or .htaccess files are not supported * - /public is not set as a web root. - * + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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 - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** diff --git a/libs/acl.php b/libs/acl.php new file mode 100644 index 000000000..a560b700a --- /dev/null +++ b/libs/acl.php @@ -0,0 +1,62 @@ + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.helpers + * @since CakePHP v 0.9.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Access Control List factory class. + * + * Looks for ACL implementation class in core config, and returns an instance of that class. + * + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.9.2 + * + */ +class Acl +{ + + /** + * Static function used to gain an instance of the correct ACL class. + * + * @return MyACL + */ + function getACL() + { + require_once(CONFIGS.'core.php'); + require_once(APP.'apis'.DS.ACL_FILENAME); + + $myacl = ACL_CLASSNAME; + return new $myacl; + } + +} +?> diff --git a/libs/model_collection.php b/libs/acl_base.php similarity index 71% rename from libs/model_collection.php rename to libs/acl_base.php index 6b22be298..b0912a29c 100644 --- a/libs/model_collection.php +++ b/libs/acl_base.php @@ -14,7 +14,7 @@ ////////////////////////////////////////////////////////////////////////// /** - * Model Collections. + * Access Control List. * * @filesource * @author CakePHP Authors/Developers @@ -30,24 +30,32 @@ * */ +uses('error_messages'); + /** - * Model Collections. + * Access Control List abstract class. Not to be instantiated. + * Subclasses of this class are used by AclHelper to perform ACL checks in Cake. * * @package cake - * @subpackage cake.libs + * @subpackage libs * @since CakePHP v 0.9.2 * */ - class ModelCollection +class AclBase +{ + + function AclBase() { - -/** - * Enter description here... - * - * @return ModelCollection - */ - function ModelCollection() + //No instantiations or constructor calls (even statically) + if (strcasecmp(get_class($this), "AclBase") == 0 || !is_subclass_of($this, "AclBase")) { + trigger_error(ERROR_ABSTRACT_CONSTRUCTION, E_USER_ERROR); + return NULL; } + } + + function check($aro, $aco) {} + +} ?> \ No newline at end of file diff --git a/libs/bake.php b/libs/bake.php index 4af452680..909ee0a3f 100644 --- a/libs/bake.php +++ b/libs/bake.php @@ -1,33 +1,35 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** + * Short description for file. + * * Creates controller, model, view files, and the required directories on demand. * Used by /scripts/bake.php. * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** @@ -36,12 +38,14 @@ uses('object', 'inflector'); /** + * Short description for class. + * * Bake class creates files in configured application directories. This is a * base class for /scripts/add.php. * - * @package cake + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 */ class Bake extends Object { diff --git a/libs/basics.php b/libs/basics.php index c131aca3a..191d7a368 100644 --- a/libs/basics.php +++ b/libs/basics.php @@ -1,33 +1,34 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** * Basic Cake functionalities. * - * @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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * Long description for file * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** diff --git a/libs/cache.php b/libs/cache.php index 45b22f4eb..921adf5b4 100644 --- a/libs/cache.php +++ b/libs/cache.php @@ -1,34 +1,36 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Cache - * Description: - * - * @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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ + * Cache + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + /** * Enter description here... @@ -37,12 +39,14 @@ uses('model'); /** - * Enter description here... - * - * @package cake - * @subpackage cake.libs - * @since CakePHP v 0.2.9 - */ + * Short description for class. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + */ class Cache extends Model { /** diff --git a/libs/class_registry.php b/libs/class_registry.php new file mode 100644 index 000000000..435a248d2 --- /dev/null +++ b/libs/class_registry.php @@ -0,0 +1,112 @@ + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.9.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Class Collections. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.9.2 + */ + class ClassRegistry + { + +/** + * Enter description here... + * + * @var unknown_type + * @access private + */ + var $_objects = array(); + +/** + * Enter description here... + * + * @return ClassRegistry instance + */ + function &getInstance() { + + static $instance = array(); + if (!$instance) + { + $instance[0] =& new ClassRegistry; + } + return $instance[0]; + } + +/** + * Enter description here... + * + * @param unknown_type $key + * @param unknown_type $object + */ + function addObject($key, &$object) + { + $key = strtolower($key); + + if (array_key_exists($key, $this->_objects) === false) + { + $this->_objects[$key] =& $object; + } + } + +/** + * Enter description here... + * + * @param unknown_type $key + * @return unknown + */ + function isKeySet($key) + { + $key = strtolower($key); + return array_key_exists($key, $this->_objects); + } + +/** + * Enter description here... + * + * @param unknown_type $key + * @return unknown + */ + function &getObject($key) + { + $key = strtolower($key); + return $this->_objects[$key]; + } + + + } + +?> \ No newline at end of file diff --git a/libs/controller.php b/libs/controller.php index 95234a54f..5fc4f7b12 100644 --- a/libs/controller.php +++ b/libs/controller.php @@ -1,397 +1,683 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Controller + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Enter description here... + */ +uses('model', 'inflector', 'folder', 'view', 'helper'); + + +/** + * Controller + * * Application controller (controllers are where you put all the actual code) * Provides basic functionality, such as rendering views (aka displaying templates). * Automatically selects model name from on singularized object class name * and creates the model object if proper class exists. - * - * @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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License * - */ - -/** - * Enter description here... - */ -uses('model', 'inflector', 'folder', 'view'); - -/** - * Enter description here... - * - * @package cake + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 * */ class Controller extends Object { -/** - * Name of the controller. - * - * @var unknown_type - * @access public - */ - var $name = null; + /** + * Name of the controller. + * + * @var unknown_type + * @access public + */ + var $name = null; -/** - * Stores the current URL (for links etc.) - * - * @var string Current URL - */ - var $here = null; + /** + * Stores the current URL (for links etc.) + * + * @var string Current URL + */ + var $here = null; -/** - * Enter description here... - * - * @var unknown_type - * @access public - */ - var $parent = null; + /** + * Enter description here... + * + * @var unknown_type + * @access public + */ + var $parent = null; -/** - * Action to be performed. - * - * @var string - * @access public - */ - var $action = null; + /** + * Action to be performed. + * + * @var string + * @access public + */ + var $action = null; -/** - * An array of names of models the particular controller wants to use. - * - * @var mixed A single name as a string or a list of names as an array. - * @access protected - */ - var $uses = false; + /** + * An array of names of models the particular controller wants to use. + * + * @var mixed A single name as a string or a list of names as an array. + * @access protected + */ + var $uses = false; -/** - * An array of names of built-in helpers to include. - * - * @var mixed A single name as a string or a list of names as an array. - * @access protected - */ - var $helpers = array('html'); + /** + * An array of names of built-in helpers to include. + * + * @var mixed A single name as a string or a list of names as an array. + * @access protected + */ + var $helpers = array('html'); - var $viewPath; + /** + * Enter description here... + * + * @var unknown_type + */ + var $viewPath; -/** - * Variables for the view - * - * @var array - * @access private - */ - var $_viewVars = array(); + /** + * Variables for the view + * + * @var array + * @access private + */ + var $_viewVars = array(); -/** - * Enter description here... - * - * @var boolean - * @access private - */ - var $pageTitle = false; + /** + * Enter description here... + * + * @var boolean + * @access private + */ + var $pageTitle = false; -/** - * An array of model objects. - * - * @var array Array of model objects. - * @access public - */ - var $models = array(); + /** + * An array of model objects. + * + * @var array Array of model objects. + * @access public + */ + var $models = array(); -/** - * Enter description here... - * - * @var unknown_type - * @access public - */ - var $base = null; + /** + * Enter description here... + * + * @var unknown_type + * @access public + */ + var $base = null; -/** - * Enter description here... - * - * @var string - * @access public - */ - var $layout = 'default'; + /** + * Enter description here... + * + * @var string + * @access public + */ + var $layout = 'default'; -/** - * Enter description here... - * - * @var boolean - * @access public - */ - var $autoRender = true; + /** + * Enter description here... + * + * @var boolean + * @access public + */ + var $autoRender = true; -/** - * Enter description here... - * - * @var boolean - * @access public - */ - var $autoLayout = true; + /** + * Enter description here... + * + * @var boolean + * @access public + */ + var $autoLayout = true; + + /** + * Enter description here... + * + * @var string + * @access public + */ + var $useDbConfig = 'default'; + + /** + * Enter description here... + * + * @var string + * @access public + */ + var $beforeFilter = null; + + /** + * Constructor. + * + */ + function __construct ($params=null) + { + // parent::__construct(); + $r = null; + if (!preg_match('/(.*)Controller/i', get_class($this), $r)) + { + die("Controller::__construct() : Can't get or parse my own class name, exiting."); + } + + $this->name = strtolower($r[1]); + $this->viewPath = Inflector::underscore($r[1]); + + //Adding Before Filter check + if (!empty($this->beforeFilter)) + { + if(is_array($this->beforeFilter)) + { + // If is an array we will use a foreach and run these methods + } + else + { + // Run a single before filter + } + } + + parent::__construct(); + } + + /** + * Enter description here... + * + */ + function contructClasses(){ + + if(empty($this->params['pass'])) + { + $id = false; + } + else + { + $id = $this->params['pass']; + } -/** - * Constructor. - * - */ - function __construct ($params=null) - { - // parent::__construct(); - $r = null; - if (!preg_match('/(.*)Controller/i', get_class($this), $r)) - { - die("Controller::__construct() : Can't get or parse my own class name, exiting."); - } + $model_class = Inflector::singularize($this->name); - $this->name = strtolower($r[1]); - $this->viewPath = Inflector::underscore($r[1]); - - parent::__construct(); - } - - function contructClasses(){ - - if(empty($this->params['pass'])) - { - $id = false; - } - else - { - $id = $this->params['pass']; - } + $this->db = DboFactory::getInstance($this->useDbConfig); - - $model_class = Inflector::singularize($this->name); - - //Is this needed? - $this->db = DboFactory::getInstance(); - - if (class_exists($model_class) && ($this->uses === false)) - { - $this->models[$model_class] = new $model_class($id); - } - elseif ($this->uses) - { - if (!$this->db) - { - die("Controller::__construct() : ".$this->name." controller needs database access, exiting."); - } - - $uses = is_array($this->uses)? $this->uses: array($this->uses); - - foreach ($uses as $model_name) - { - $model_class = ucfirst(strtolower($model_name)); - - if (class_exists($model_class)) + if (class_exists($model_class) && ($this->uses === false)) + { + $this->models[$model_class] = new $model_class($id); + } + elseif ($this->uses) + { + if (!$this->db) { - $this->models[$model_name] = new $model_class($id); + die("Controller::__construct() : ".$this->name." controller needs database access, exiting."); } + + $uses = is_array($this->uses)? $this->uses: array($this->uses); + + foreach ($uses as $model_name) + { + $model_class = ucfirst(strtolower($model_name)); + + if (class_exists($model_class)) + { + $this->models[$model_name] = new $model_class($id); + } + else + { + die("Controller::__construct() : ".ucfirst($this->name)." requires missing model {$model_class}, exiting."); + } + } + } + } + + /** + * Redirects to given $url, after turning off $this->autoRender. + * + * @param unknown_type $url + */ + function redirect ($url) + { + $this->autoRender = false; + header ('Location: '.$this->base.$url); + } + + /** + * Saves a variable to use inside a template. + * + * @param mixed $one A string or an array of data. + * @param string $two Value in case $one is a string (which then works as the key), otherwise unused. + * @return unknown + */ + function set($one, $two=null) + { + return $this->_setArray(is_array($one)? $one: array($one=>$two)); + } + + /** + * Enter description here... + * + * @param unknown_type $action + */ + function setAction ($action) + { + $this->action = $action; + + $args = func_get_args(); + call_user_func_array(array(&$this, $action), $args); + } + + /** + * Returns number of errors in a submitted FORM. + * + * @return int Number of errors + */ + function validate () + { + $args = func_get_args(); + $errors = call_user_func_array(array(&$this, 'validateErrors'), $args); + + return count($errors); + } + + /** + * Validates a FORM according to the rules set up in the Model. + * + * @return int Number of errors + */ + function validateErrors () + { + $objects = func_get_args(); + if (!count($objects)) return false; + + $errors = array(); + foreach ($objects as $object) + { + $errors = array_merge($errors, $object->invalidFields($object->data)); + } + + return $this->validationErrors = (count($errors)? $errors: false); + } + + /** + * Enter description here... + * + * @param unknown_type $action + * @param unknown_type $layout + * @param unknown_type $file + * @return unknown + */ + function render($action=null, $layout=null, $file=null) + { + $view = View::getInstance(); + $view->_viewVars =& $this->_viewVars; + $view->action =& $this->action; + $view->autoLayout =& $this->autoLayout; + $view->autoRender =& $this->autoRender; + $view->base =& $this->base; + $view->helpers =& $this->helpers; + $view->here =& $this->here; + $view->layout =& $this->layout; + $view->models =& $this->models; + $view->name =& $this->name; + $view->pageTitle =& $this->pageTitle; + $view->parent =& $this->parent; + $view->viewPath =& $this->viewPath; + $view->params =& $this->params; + $view->data =& $this->data; + $view->displayFields =& $this->displayFields; + + if(!empty($this->models)) + { + foreach ($this->models as $key => $value) + { + if(!empty($this->models[$key]->validationErrors)) + { + $view->validationErrors[$key] =& $this->models[$key]->validationErrors; + } + } + } + + return $view->render($action, $layout, $file); + } + + /** + * Enter description here... + * + */ + function missingController() + { + //We are simulating action call below, this is not a filename! + $this->render('../errors/missingController'); + } + + /** + * Enter description here... + * + */ + function missingAction() + { + //We are simulating action call below, this is not a filename! + $this->render('../errors/missingAction'); + } + + /** + * Enter description here... + * + */ + function missingView() + { + //We are simulating action call below, this is not a filename! + $this->render('../errors/missingView'); + } + + // /** + // * Displays an error page to the user. Uses layouts/error.html to render the page. + // * + // * @param int $code Error code (for instance: 404) + // * @param string $name Name of the error (for instance: Not Found) + // * @param string $message Error message + // */ + // function error ($code, $name, $message) + // { + // header ("HTTP/1.0 {$code} {$name}"); + // print ($this->_render(VIEWS.'layouts/error.thtml', array('code'=>$code,'name'=>$name,'message'=>$message))); + // } + + /** + * Sets data for this view. Will set title if the key "title" is in given $data array. + * + * @param array $data Array of + * @access private + */ + function _setArray($data) + { + foreach ($data as $name => $value) + { + if ($name == 'title') + $this->_setTitle($value); else - { - die("Controller::__construct() : ".ucfirst($this->name)." requires missing model {$model_class}, exiting."); - } + $this->_viewVars[$name] = $value; + } + } + + /** + * Set the title element of the page. + * + * @param string $pageTitle Text for the title + * @access private + */ + function _setTitle($pageTitle) + { + $this->pageTitle = $pageTitle; + } + + /** + * Enter description here... + * + * @param unknown_type $message + * @param unknown_type $url + * @param unknown_type $time + */ + function flash($message, $url, $time=1) + { + $this->autoRender = false; + $this->autoLayout = false; + + $this->set('url', $this->base.$url); + $this->set('message', $message); + $this->set('time', $time); + + $this->render(null,false,VIEWS.'layouts'.DS.'flash.thtml'); + } + + /** + * Enter description here... + * + * @param unknown_type $message + * @param unknown_type $url + * @param unknown_type $time + */ + function flashOut($message, $url, $time=1) + { + $this->autoRender = false; + $this->autoLayout = false; + + $this->set('url', $url); + $this->set('message', $message); + $this->set('time', $time); + + $this->render(null,false,VIEWS.'layouts'.DS.'flash.thtml'); + } + + /** + * This function creates a $fieldNames array for the view to use. + * @todo Map more database field types to html form fields. + * @todo View the database field types from all the supported databases. + * + */ + function generateFieldNames( $data = null, $doCreateOptions = true ) + { + // Initialize the list array + $fieldNames = array(); + + // figure out what model and table we are working with + $model = Inflector::pluralize($this->name); + $table = Inflector::singularize($this->name); + + // get all of the column names. + $classRegistry = ClassRegistry::getInstance(); + foreach ($classRegistry->getObject($table)->_table_info as $tables) + { + foreach ($tables as $tabl) + { + // set up the prompt + if( Model::isForeignKey($tabl['name']) ) + { + $niceName = substr( $tabl['name'], 0, strpos( $tabl['name'], "_id" ) ); + $fieldNames[ $tabl['name'] ]['prompt'] = Inflector::humanize($niceName); + // this is a foreign key, also set up the other controller + $fieldNames[ $tabl['name'] ]['model'] = Inflector::singularize($niceName); + $fieldNames[ $tabl['name'] ]['controller'] = Inflector::pluralize($niceName); + $fieldNames[ $tabl['name'] ]['foreignKey'] = true; + } + else if( 'created' != $tabl['name'] && 'updated' != $tabl['name'] ) + { + $fieldNames[$tabl['name']]['prompt'] = Inflector::humanize($tabl['name']); + } + else if( 'created' == $tabl['name'] ) + { + $fieldNames[$tabl['name']]['prompt'] = 'Created'; + } + else if( 'updated' == $tabl['name'] ) + { + $fieldNames[$tabl['name']]['prompt'] = 'Modified'; + } + + // Now, set up some other attributes that will be useful for auto generating a form. + //tagName is in the format table/field "post/title" + $fieldNames[ $tabl['name']]['tagName'] = $table.'/'.$tabl['name']; + + // Now, find out if this is a required field. + $validationFields = $classRegistry->getObject($table)->validate; + + if( isset( $validationFields[ $tabl['name'] ] ) ) + { + // Now, we know that this field has some validation set. + // find out if it is a required field. + if( VALID_NOT_EMPTY == $validationFields[ $tabl['name'] ] ) + { + // this is a required field. + $fieldNames[$tabl['name']]['required'] = true; + $fieldNames[$tabl['name']]['errorMsg'] = "Required Field"; + } + } + + // now, determine what the input type should be for this database field. + $lParenPos = strpos( $tabl['type'], '('); + $rParenPos = strpos( $tabl['type'], ')'); + if( false != $lParenPos ) + { + $type = substr($tabl['type'], 0, $lParenPos ); + $fieldLength = substr( $tabl['type'], $lParenPos+1, $rParenPos - $lParenPos -1 ); + } + else + { + $type = $tabl['type']; + } + switch( $type ) + { + case "text": + { + $fieldNames[ $tabl['name']]['type'] = 'area'; + //$fieldNames[ $tabl['name']]['size'] = $fieldLength; + } + break; + case "varchar": + { + if( isset( $fieldNames[ $tabl['name']]['foreignKey'] ) ) + { + $fieldNames[ $tabl['name']]['type'] = 'select'; + // This is a foreign key select dropdown box. now, we have to add the options. + $fieldNames[ $tabl['name']]['options'] = array(); + + // get the list of options from the other model. + $registry = ClassRegistry::getInstance(); + $otherModel = $registry->getObject($fieldNames[ $tabl['name']]['model']); + + if( is_object($otherModel) ) + { + if( $doCreateOptions ) + { + $otherDisplayField = $otherModel->getDisplayField(); + foreach( $otherModel->findAll() as $pass ) + { + foreach( $pass as $key=>$value ) + { + if( $key == $fieldNames[ $tabl['name']]['model'] && isset( $value['id'] ) && isset( $value[$otherDisplayField] ) ) + { + $fieldNames[ $tabl['name']]['options'][$value['id']] = $value[$otherDisplayField]; + } + } + } + } + $fieldNames[ $tabl['name']]['selected'] = $data[$table][$tabl['name']]; + } + } + else + { + $fieldNames[ $tabl['name']]['type'] = 'input'; + } + } + break; + case "int": + case "decimal": + { + //BUGBUG: Need a better way to determine if this field is an auto increment foreign key. + // If it is a number, and it is a foreign key, we'll make a HUGE assumption that it is an auto increment field. + // for foreign key autonumber fields, we'll set the type to 'key' so that it does not display in the input form. + if( 0 == strncmp($tabl['name'], 'id', 2) ) + { + $fieldNames[ $tabl['name']]['type'] = 'hidden'; + } + else if( isset( $fieldNames[ $tabl['name']]['foreignKey'] ) ) + { + $fieldNames[ $tabl['name']]['type'] = 'select'; + // This is a foreign key select dropdown box. now, we have to add the options. + $fieldNames[ $tabl['name']]['options'] = array(); + + // get the list of options from the other model. + $registry = ClassRegistry::getInstance(); + $otherModel = $registry->getObject($fieldNames[ $tabl['name']]['model']); + + if( is_object($otherModel) ) + { + if( $doCreateOptions ) + { + $otherDisplayField = $otherModel->getDisplayField(); + foreach( $otherModel->findAll() as $pass ) + { + foreach( $pass as $key=>$value ) + { + if( $key == $fieldNames[ $tabl['name']]['model'] && isset( $value['id'] ) && isset( $value[$otherDisplayField] ) ) + { + $fieldNames[ $tabl['name']]['options'][$value['id']] = $value[$otherDisplayField]; + } + } + } + } + $fieldNames[ $tabl['name']]['selected'] = $data[$table][$tabl['name']]; + } + } + else + { + $fieldNames[ $tabl['name']]['type'] = 'input'; + } + } + break; + case "enum": + { + // for enums, the $fieldLength variable is actually the list of enums. + $fieldNames[ $tabl['name']]['type'] = 'select'; + // This is a foreign key select dropdown box. now, we have to add the options. + $fieldNames[ $tabl['name']]['options'] = array(); + + $enumValues = split(',', $fieldLength ); + $iCount = 1; + foreach ($enumValues as $enum ) + { + $enum = trim( $enum, "'" ); + $fieldNames[$tabl['name']]['options'][$enum] = $enum; + } + $fieldNames[ $tabl['name']]['selected'] = $data[$table][$tabl['name']]; + + } + break; + case "date": + case "datetime": + { + $fieldNames[ $tabl['name']]['type'] = $type; + } + break; + default: + //sorry, this database field type is not yet set up. + break; + + + } // end switch } - } - } - -/** - * Redirects to given $url, after turning off $this->autoRender. - * - * @param unknown_type $url - */ - function redirect ($url) - { - $this->autoRender = false; - header ('Location: '.$this->base.$url); - } - -/** - * Saves a variable to use inside a template. - * - * @param mixed $one A string or an array of data. - * @param string $two Value in case $one is a string (which then works as the key), otherwise unused. - * @return unknown - */ - function set($one, $two=null) - { - return $this->_setArray(is_array($one)? $one: array($one=>$two)); - } - -/** - * Enter description here... - * - * @param unknown_type $action - */ - function setAction ($action) - { - $this->action = $action; - - $args = func_get_args(); - call_user_func_array(array(&$this, $action), $args); - } - -/** - * Returns number of errors in a submitted FORM. - * - * @return int Number of errors - */ - function validate () - { - $args = func_get_args(); - $errors = call_user_func_array(array(&$this, 'validateErrors'), $args); - - return count($errors); - } - -/** - * Validates a FORM according to the rules set up in the Model. - * - * @return int Number of errors - */ - function validateErrors () - { - $objects = func_get_args(); - if (!count($objects)) return false; - - $errors = array(); - foreach ($objects as $object) - { - $errors = array_merge($errors, $object->invalidFields($object->data)); - } - - return $this->validationErrors = (count($errors)? $errors: false); - } - - function render($action=null, $layout=null, $file=null) - { - $view =& View::getInstance(); - $view->_viewVars =& $this->_viewVars; - $view->action =& $this->action; - $view->autoLayout =& $this->autoLayout; - $view->autoRender =& $this->autoRender; - $view->base =& $this->base; - $view->helpers =& $this->helpers; - $view->here =& $this->here; - $view->layout =& $this->layout; - $view->models =& $this->models; - $view->name =& $this->name; - $view->pageTitle =& $this->pageTitle; - $view->parent =& $this->parent; - $view->viewPath =& $this->viewPath; - $view->params =& $this->params; - $view->data =& $this->data; - - if(!empty($this->models)) - { - foreach ($this->models as $key => $value) - { - if(!empty($this->models[$key]->validationErrors)) - { - $view->validationErrors[$key] =& $this->models[$key]->validationErrors; - } - } - } - - return $view->render($action, $layout, $file); - } - - function missingController() - { - //We are simulating action call below, this is not a filename! - $this->render('../errors/missingController'); - } - - function missingAction() - { - //We are simulating action call below, this is not a filename! - $this->render('../errors/missingAction'); - } - - function missingView() - { - //We are simulating action call below, this is not a filename! - $this->render('../errors/missingView'); - } - - // /** - // * Displays an error page to the user. Uses layouts/error.html to render the page. - // * - // * @param int $code Error code (for instance: 404) - // * @param string $name Name of the error (for instance: Not Found) - // * @param string $message Error message - // */ - // function error ($code, $name, $message) - // { - // header ("HTTP/1.0 {$code} {$name}"); - // print ($this->_render(VIEWS.'layouts/error.thtml', array('code'=>$code,'name'=>$name,'message'=>$message))); - // } - -/** - * Sets data for this view. Will set title if the key "title" is in given $data array. - * - * @param array $data Array of - * @access private - */ - function _setArray($data) - { - foreach ($data as $name => $value) - { - if ($name == 'title') - $this->_setTitle($value); - else - $this->_viewVars[$name] = $value; - } - } - -/** - * Set the title element of the page. - * - * @param string $pageTitle Text for the title - * @access private - */ - function _setTitle($pageTitle) - { - $this->pageTitle = $pageTitle; - } - - function flash($message, $url, $time=1) - { - $this->autoRender = false; - $this->autoLayout = false; - - $this->set('url', $this->base.$url); - $this->set('message', $message); - $this->set('time', $time); - - $this->render(null,false,VIEWS.'layouts'.DS.'flash.thtml'); - } + } + return $fieldNames; + } } ?> \ No newline at end of file diff --git a/tests/app/controllers/put_controller_tests_here b/libs/controllers/templates/rescues/_request_and_response.thtml similarity index 100% rename from tests/app/controllers/put_controller_tests_here rename to libs/controllers/templates/rescues/_request_and_response.thtml diff --git a/tests/app/helpers/put_helper_tests_here b/libs/controllers/templates/rescues/diagnostics.thtml similarity index 100% rename from tests/app/helpers/put_helper_tests_here rename to libs/controllers/templates/rescues/diagnostics.thtml diff --git a/tests/app/models/put_model_tests_here b/libs/controllers/templates/rescues/layout.thtml similarity index 100% rename from tests/app/models/put_model_tests_here rename to libs/controllers/templates/rescues/layout.thtml diff --git a/libs/controllers/templates/rescues/missing_template.thtml b/libs/controllers/templates/rescues/missing_template.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/controllers/templates/rescues/routing_error.thtml b/libs/controllers/templates/rescues/routing_error.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/controllers/templates/rescues/template_error.thtml b/libs/controllers/templates/rescues/template_error.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/controllers/templates/rescues/unknown_action.thtml b/libs/controllers/templates/rescues/unknown_action.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/controllers/templates/scaffolds/edit.thtml b/libs/controllers/templates/scaffolds/edit.thtml index 63341d7e4..718113941 100644 --- a/libs/controllers/templates/scaffolds/edit.thtml +++ b/libs/controllers/templates/scaffolds/edit.thtml @@ -1,102 +1,25 @@ -

Editing name); ?>

-formTag('/'.$this->viewPath.'/update');?> - - - - - - name); - $table = Inflector::singularize($this->name); - $evenNum = 1; - $css = false; - - foreach ($this->$table->_table_info as $tables) { - $columnCount = 0; - foreach ($tables as $tabl) { - foreach ($this->_viewVars as $names) {?> -formTag('/'.$this->name.'/update'); + + echo $form->generateFields( $html, $fieldNames ); + + echo $form->generateSubmitDiv( $html, 'Save' ) - if ($evenNum % 2 == 0 ){ - $css = ' class="or"'; - }else{ - $css = false; - } - $evenNum++; - ?> - -";?> - - - - - -
Column TypeColumn NameValue
-$table->joinedHasOne)){?> - - - - - - - - - - - - - +
    name); + echo "
  • ".$html->linkTo('Delete '.Inflector::humanize($modelName), '/'.$this->viewPath.'/destroy/'.$data[$modelName]['id'])."
  • "; - $joinedCount = count($this->$table->joinedHasOne); - $count = $columnCount; - $evenNum = 1; - $css = false; - - for ($i = 0; $i <= $joinedCount-1; $i++) { - foreach ($this->$table->joinedHasOne[$i]->_table_info as $tab) { - foreach($tab as $test){ -?> - - - -";?> -
- - - -$value ) { + if( isset( $value['foreignKey'] ) ) + { + echo "
  • ".$html->linkTo( "View ".Inflector::humanize($value['controller']), "/".Inflector::underscore($value['controller'])."/show/".$data[Inflector::singularize($params['controller'])][$field] )."
  • "; + } + } ?> -
    Joined Table
    Column TypeColumn NameValue
    $table->joinedHasOne[$i]->table)][$test['name']]?>
    - - - - -
    submitTag('Save')?>

    - - - - -
    - linkTo('Back', "/{$this->viewPath}/list/")?> -
    \ No newline at end of file + \ No newline at end of file diff --git a/libs/controllers/templates/scaffolds/list.thtml b/libs/controllers/templates/scaffolds/list.thtml index ed83cb6d6..76a2d09be 100644 --- a/libs/controllers/templates/scaffolds/list.thtml +++ b/libs/controllers/templates/scaffolds/list.thtml @@ -1,105 +1,66 @@ -

    Listing name); ?>

    - - name); + $model = Inflector::pluralize($this->name); $table = Inflector::singularize($this->name); - - foreach ($this->$table->_table_info as $tables) { - - - foreach ($tables as $tabl) { - $tableHeader = Inflector::humanize($tabl['name']); - + $humanName = Inflector::humanize($this->name); + $humanSingularName = Inflector::singularize( $humanName ); +// var_dump( $data ); ?> - -$table->joinedHasOne)){ - -echo" "; -} - -if(!empty($this->$table->_hasMany)){ - -echo" "; -} ?> - - - - -$table->findAll() as $columns){ - if ($evenNum % 2 == 0 ){ - $css = ' class="or"'; - }else{ - $css = false; - } - $evenNum++; - ?> - -";?> - - -$table->joinedHasOne)){echo" ";}?> - - - - -
    Joined Table ActionsHas Many "; - for ($i = 0; $i <= count($this->$table->_hasMany)-1; $i++) { - echo Inflector::humanize($this->$table->_hasMany[$i]); - } - echo "Actions for name);?>
    ";?> -$table->joinedHasOne); - - for ($i = 0; $i <= $joinedCount-1; $i++) { - foreach ($this->$table->joinedHasOne[$i]->_table_info as $tab) { - foreach($tab as $test){ - if($test['name'] === 'id'){ - echo $html->linkTo('Edit: '. Inflector::humanize(Inflector::singularize($this->$table->joinedHasOne[$i]->table)) .'',"/{$this->$table->joinedHasOne[$i]->table}/edit/{$columns[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']]}"); - echo '
    ' . Inflector::humanize($test['name']) .': ' . $columns[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']] .'
    '; - } else{ - echo '' . Inflector::humanize($test['name']) .': ' . $columns[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']] .'
    '; - } - } - } - } - } + + + + + + + + "; + } else { + echo ""; + } + foreach( $fieldNames as $field=>$value ) { ?> + + value ?> + -if(!empty($this->$table->joinedHasOne)){ echo" ";}?> + + + + +
    Actions
    + getObject( $otherModelName ); + if( is_object($otherModelObject) ) + { + $displayText = $row[$otherModelName][ $otherModelObject->getDisplayField() ]; + } else{ + $displayText = $row[$table][$field]; + } + echo $html->linkTo( $displayText, "/".Inflector::underscore($otherControllerName)."/show/".$row[$table][$field] ); + + } else { + echo $row[$table ][$field]; + } ?> + linkTo('View',"/".$this->viewPath."/show/{$row[$table]['id']}/")?> + linkTo('Edit',"/".$this->viewPath."/edit/{$row[$table]['id']}/")?> + linkTo('Delete',"/".$this->viewPath."/destroy/{$row[$table]['id']}/")?> +
    +
      +
    • linkTo('New '.$humanSingularName, '/'.$this->viewPath.'/new'); ?>
    • +
    -$table->_hasMany)){ echo"
    ";?> -$table->_hasMany)-1; $i++) { - for ($ia = 0; $ia <= count($columns)-2; $ia++) { - foreach ($this->$table->joinedHasMany[0] as $tab) { - foreach($tab as $test){ - if($test['name'] === 'id'){ - echo $html->linkTo('Edit: '. Inflector::humanize(Inflector::singularize($this->$table->_hasMany[$i])) .'',"/{$this->$table->_hasMany[$i]}/edit/{$columns[$ia][Inflector::singularize($this->$table->_hasMany[$i])][$test['name']]}"); - echo '
    ' . Inflector::humanize($test['name']) .': ' . $columns[$ia][Inflector::singularize($this->$table->_hasMany[$i])][$test['name']] .'
    '; - } else{ - echo '' . Inflector::humanize($test['name']) .': ' . $columns[$ia][Inflector::singularize($this->$table->_hasMany[$i])][$test['name']] .'
    '; - } - } - } - } - } -} - -if(!empty($this->$table->hasMany)){ echo"
    linkTo('Show', "/{$this->viewPath}/show/{$columns[Inflector::singularize($this->name)]['id']}")?> - linkTo('Edit',"/{$this->viewPath}/edit/{$columns[Inflector::singularize($this->name)]['id']}")?> - linkTo('Destroy',"/{$this->viewPath}/destroy/{$columns[Inflector::singularize($this->name)]['id']}")?> -
    - - - - -
    linkTo('Add New '.Inflector::humanize(Inflector::singularize($this->viewPath)).'', "/{$this->viewPath}/new/") ?>
    \ No newline at end of file diff --git a/libs/controllers/templates/scaffolds/new.thtml b/libs/controllers/templates/scaffolds/new.thtml index 34b7e79da..42382da69 100644 --- a/libs/controllers/templates/scaffolds/new.thtml +++ b/libs/controllers/templates/scaffolds/new.thtml @@ -1,94 +1,11 @@ -

    New name); ?>

    -formTag('/'.$this->viewPath.'/create');?> - - - - - name); - $table = Inflector::singularize($this->name); - $columnCount = 0; - $evenNum = 1; - $css = false; - - foreach ($this->$table->_table_info as $tables) { - foreach ($tables as $tabl) {?> - - -";?> - - - - - -
    Column TypeColumn Name
    -$table->joinedHasOne)){?> - - - - - - - - - +$form = new FormHelper(); -formTag('/'.$this->name.'/create'); + echo $form->generateFields( $html, $fieldNames ); - $joinedCount = count($this->$table->joinedHasOne); - $count = $columnCount; - $evenNum = 1; - $css = false; - - for ($i = 0; $i <= $joinedCount-1; $i++) { - foreach ($this->$table->joinedHasOne[$i]->_table_info as $tab) { - foreach($tab as $test){?> - -";?> - - - - - -
    Joined Table
    Column TypeColumn Name
    - - - - -
    submitTag('Save')?>

    - - - - -
    - linkTo('Back', "/{$this->viewPath}/list/")?> -
    \ No newline at end of file + echo $form->generateSubmitDiv( $html, 'Add' ) +?> \ No newline at end of file diff --git a/libs/controllers/templates/scaffolds/scaffold.thtml b/libs/controllers/templates/scaffolds/scaffold.thtml index 99845cc6f..3f162ff92 100644 --- a/libs/controllers/templates/scaffolds/scaffold.thtml +++ b/libs/controllers/templates/scaffolds/scaffold.thtml @@ -4,13 +4,14 @@ <?=$title_for_layout?> charsetTag('UTF-8')?> cssTag('scaffold')?> + cssTag('forms')?> - +

    - +
    diff --git a/libs/controllers/templates/scaffolds/show.thtml b/libs/controllers/templates/scaffolds/show.thtml index 7292aa0e4..39c1de8be 100644 --- a/libs/controllers/templates/scaffolds/show.thtml +++ b/libs/controllers/templates/scaffolds/show.thtml @@ -1,93 +1,95 @@ name); - $table = Inflector::singularize($this->name); - $evenNum = 1; - $css = false; - ?> + $modelName = Inflector::singularize($this->name); + $registry = ClassRegistry::getInstance(); -

    Showing name); ?>

    - - - - -$table->joinedHasOne)){ - -echo" "; -} - ?> - - - -$table->_table_info as $tables) { - $columnCount = 0; - - foreach ($tables as $tabl) { - $tableName[] = $tabl['name']; - - foreach ($this->_viewVars as $names) { - - ?> - - - -";?> - - - - - -$table->joinedHasOne)){?> - - - - - -
    FieldValueJoined Table
    -$table->joinedHasOne); - $count = $columnCount; - - for ($i = 0; $i <= $joinedCount-1; $i++) { - foreach ($this->$table->joinedHasOne[$i]->_table_info as $tab) { - foreach($tab as $test){ - if($test['name'] === 'id'){ - echo $html->linkTo('Edit: '. Inflector::humanize(Inflector::singularize($this->$table->joinedHasOne[$i]->table)) .'',"/{$this->$table->joinedHasOne[$i]->table}/edit/{$names[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']]}"); - echo '
    ' . Inflector::humanize($test['name']) .': ' . $names[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']]; - } else{ - echo '
    ' . Inflector::humanize($test['name']) .': ' . $names[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']]; - } - $count++; - } - echo '
    '; - } - } ?> -
    - - - - - -
    - linkTo('Back', "/{$this->viewPath}/list/")?> - linkTo('Edit',"/{$this->viewPath}/edit/{$names[Inflector::singularize($this->name)]['id']}")?> - linkTo('Destroy',"/{$this->viewPath}/destroy/{$names[Inflector::singularize($this->name)]['id']}")?> -
    +
    +$value ) { + echo "
    ".$value['prompt']."
    "; + if( isset( $value['foreignKey'] ) ) { + $otherModelObject = $registry->getObject($value['model']); + $displayField = $otherModelObject->getDisplayField(); + $displayText = $data[$value['model']][ $displayField ]; + echo "
    ".$html->linkTo($displayText, '/'.Inflector::underscore($value['controller']).'/show/'.$data[$modelName][ $field ] )."
    "; + } else { + // this is just a plain old field. + if( isset($data[$modelName][$field]) ) + { + echo "
    ".$data[$modelName][$field]."
    "; + } else { + echo "
     
    "; + } + } + } +?> + +
    +
      +".$html->linkTo('Edit '.Inflector::humanize($modelName), '/'.$this->viewPath.'/edit/'.$data[$modelName]['id']).""; + echo "
    • ".$html->linkTo('Delete '.Inflector::humanize($modelName), '/'.$this->viewPath.'/destroy/'.$data[$modelName]['id'])."
    • "; + + foreach( $fieldNames as $field=>$value ) { + if( isset( $value['foreignKey'] ) ) + { + echo "
    • ".$html->linkTo( "View ".Inflector::humanize($value['controller']), "/".Inflector::underscore($value['controller'])."/show/".$data[Inflector::singularize($params['controller'])][$field] )."
    • "; + } + } +?> +
    + +getObject($modelName); + foreach( $objModel->_oneToMany as $relation ) + { + + $count = 0; + list($table, $field, $value) = $relation; + $otherModelName = Inflector::singularize($table); + + echo " \ No newline at end of file diff --git a/libs/dbo.php b/libs/dbo.php index 0f1ae6a35..3d35be164 100644 --- a/libs/dbo.php +++ b/libs/dbo.php @@ -1,23 +1,47 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ + +/** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Enter description here... + * + */ +uses('object'); /** * Purpose: DBO/ADO * * Description: - * A MySQL functions wrapper. Provides ability to get results as arrays + * A SQL functions wrapper. Provides ability to get results as arrays * and query logging (with execution time). * * Example usage: @@ -51,32 +75,9 @@ * $db->showLog(TRUE); * * - * @filesource - * @author CakePHP Authors/Developers - * @copyright Copyright (c) 2005, CakePHP Authors/Developers - * @link https://trac.cakephp.org/wiki/Authors Authors/Developers - * @package cake + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - * - */ - -/** - * Enter description here... - * - */ -uses('object'); - -/** - * Enter description here... - * - * @package cake - * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 */ class DBO extends Object { diff --git a/libs/dbo/dbo_adodb.php b/libs/dbo/dbo_adodb.php index 719826b0c..272a9731f 100644 --- a/libs/dbo/dbo_adodb.php +++ b/libs/dbo/dbo_adodb.php @@ -1,46 +1,50 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * AdoDB layer for DBO. - * - * @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.libs.dbo - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ + * AdoDB layer for DBO. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.dbo + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** - * Include AdoDB files. - */ + * Include AdoDB files. + */ require_once(VENDORS.'adodb/adodb.inc.php'); /** - * AdoDB layer for DBO. - * - * @package cake - * @subpackage cake.libs.dbo - * @since CakePHP v 0.2.9 - */ + * Short description for class. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs.dbo + * @since CakePHP v 0.2.9 + */ class DBO_AdoDB extends DBO { @@ -53,10 +57,10 @@ class DBO_AdoDB extends DBO var $_adodb = null; /** - * Connects to the database using options in the given configuration array. - * - * @param array $config Configuration array for connecting - */ + * Connects to the database using options in the given configuration array. + * + * @param array $config Configuration array for connecting + */ function connect ($config) { if ($this->config = $config) @@ -70,46 +74,47 @@ class DBO_AdoDB extends DBO } } - if(!$this->connected) - die('Could not connect to DB.'); + if(!$this->connected){ + // die('Could not connect to DB.'); + } } /** - * Disconnects from database. - * - * @return boolean True if the database could be disconnected, else false - */ + * Disconnects from database. + * + * @return boolean True if the database could be disconnected, else false + */ function disconnect () { return $this->_adodb->close(); } /** - * Executes given SQL statement. - * - * @param string $sql SQL statement - * @return resource Result resource identifier - */ + * Executes given SQL statement. + * + * @param string $sql SQL statement + * @return resource Result resource identifier + */ function execute ($sql) { return $this->_adodb->execute($sql); } /** - * Returns a row from given resultset as an array . - * - * @return array The fetched row as an array - */ + * Returns a row from given resultset as an array . + * + * @return array The fetched row as an array + */ function fetchRow () { return $this->_result->FetchRow(); } /** - * Returns an array of tables in the database. If there are no tables, an error is raised and the application exits. - * - * @return array Array of tablenames in the database - */ + * Returns an array of tables in the database. If there are no tables, an error is raised and the application exits. + * + * @return array Array of tablenames in the database + */ function tablesList () { $tables = $this->_adodb->MetaTables('TABLES'); @@ -122,11 +127,11 @@ class DBO_AdoDB extends DBO } /** - * Returns an array of the fields in given table name. - * - * @param string $table_name Name of database table to inspect - * @return array Fields in table. Keys are name and type - */ + * Returns an array of the fields in given table name. + * + * @param string $table_name Name of database table to inspect + * @return array Fields in table. Keys are name and type + */ function fields ($table_name) { $data = $this->_adodb->MetaColumns($table_name); @@ -139,56 +144,56 @@ class DBO_AdoDB extends DBO } /** - * Returns a quoted and escaped string of $data for use in an SQL statement. - * - * @param string $data String to be prepared for use in an SQL statement - * @return string Quoted and escaped - * - * :TODO: To be implemented. - */ + * Returns a quoted and escaped string of $data for use in an SQL statement. + * + * @param string $data String to be prepared for use in an SQL statement + * @return string Quoted and escaped + * + * :TODO: To be implemented. + */ function prepareValue ($data) { return $this->_adodb->Quote($data); } /** - * Returns a formatted error message from previous database operation. - * - * @return string Error message - */ + * Returns a formatted error message from previous database operation. + * + * @return string Error message + */ function lastError () { return $this->_adodb->ErrorMsg(); } /** - * Returns number of affected rows in previous database operation. If no previous operation exists, this returns false. - * - * @return int Number of affected rows - */ + * Returns number of affected rows in previous database operation. If no previous operation exists, this returns false. + * + * @return int Number of affected rows + */ function lastAffected () { return $this->_adodb->Affected_Rows(); } /** - * Returns number of rows in previous resultset. If no previous resultset exists, - * this returns false. - * - * @return int Number of rows in resultset - */ + * Returns number of rows in previous resultset. If no previous resultset exists, + * this returns false. + * + * @return int Number of rows in resultset + */ function lastNumRows () { return $this->_result? $this->_result->RecordCount(): false; } /** - * Returns the ID generated from the previous INSERT operation. - * - * @return int - * - * :TODO: To be implemented. - */ + * Returns the ID generated from the previous INSERT operation. + * + * @return int + * + * :TODO: To be implemented. + */ function lastInsertId () { die('Please implement DBO::lastInsertId() first.'); } /** diff --git a/libs/dbo/dbo_generic.php b/libs/dbo/dbo_generic.php index d6c6b7339..9d753a571 100644 --- a/libs/dbo/dbo_generic.php +++ b/libs/dbo/dbo_generic.php @@ -1,42 +1,45 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Generic layer for DBO. - * - * @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.libs.dbo - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ - + * Generic layer for DBO. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.dbo + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** - * AdoDB layer for DBO. - * - * @package cake - * @subpackage cake.libs.dbo - * @since CakePHP v 0.2.9 - */ + * Short description for class. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs.dbo + * @since CakePHP v 0.2.9 + */ class DBO_generic extends DBO { diff --git a/libs/dbo/dbo_mysql.php b/libs/dbo/dbo_mysql.php index 1c7d2ad75..017a86644 100644 --- a/libs/dbo/dbo_mysql.php +++ b/libs/dbo/dbo_mysql.php @@ -1,33 +1,36 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * MySQL layer for DBO - * - * @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.libs.dbo - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ + * MySQL layer for DBO + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.dbo + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + /** * Include DBO. @@ -35,12 +38,14 @@ uses('dbo'); /** - * MySQL layer for DBO. - * - * @package cake - * @subpackage cake.libs.dbo - * @since CakePHP v 0.2.9 - */ + * Short description for class. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs.dbo + * @since CakePHP v 0.2.9 + */ class DBO_MySQL extends DBO { @@ -61,8 +66,9 @@ class DBO_MySQL extends DBO if($this->connected) return mysql_select_db($config['database'], $this->_conn); - else - die('Could not connect to DB.'); + else{ + //die('Could not connect to DB.'); + } } /** diff --git a/libs/dbo/dbo_pear.php b/libs/dbo/dbo_pear.php index 3778d3a68..10522f6b1 100644 --- a/libs/dbo/dbo_pear.php +++ b/libs/dbo/dbo_pear.php @@ -1,33 +1,35 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Pear::DB layer for DBO. - * - * @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.libs.dbo - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ + * Pear::DB layer for DBO. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.dbo + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Create an include path required Pear libraries. @@ -37,12 +39,14 @@ ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . PEAR); vendor('Pear/DB'); /** - * Pear::DB layer for DBO. - * - * @package cake - * @subpackage cake.libs.dbo - * @since CakePHP v 0.2.9 - */ + * Short description for class. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs.dbo + * @since CakePHP v 0.2.9 + */ class DBO_Pear extends DBO { @@ -71,8 +75,10 @@ class DBO_Pear extends DBO ); $this->_pear =& DB::connect($dsn, $options); + $this->connected = $this->_pear? true: false; return !(PEAR::isError($this->_pear)); + } /** diff --git a/libs/dbo/dbo_postgres.php b/libs/dbo/dbo_postgres.php index c160b1310..ab6152d41 100644 --- a/libs/dbo/dbo_postgres.php +++ b/libs/dbo/dbo_postgres.php @@ -1,33 +1,35 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * PostgreSQL layer for DBO. - * - * @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.libs.dbo - * @since CakePHP v 1.0.0.114 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ + * PostgreSQL layer for DBO. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.dbo + * @since CakePHP v 0.9.1.114 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Include DBO. @@ -35,12 +37,14 @@ uses('dbo'); /** - * PostgreSQL layer for DBO. - * - * @package cake - * @subpackage cake.libs.dbo - * @since CakePHP v 1.0.0.114 - */ + * Short description for class. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs.dbo + * @since CakePHP v 0.9.1.114 + */ class DBO_Postgres extends DBO { @@ -62,7 +66,9 @@ class DBO_Postgres extends DBO if($this->connected) return true; else - die('Could not connect to DB.'); + { + //die('Could not connect to DB.'); + } } /** diff --git a/libs/dbo/dbo_sqlite.php b/libs/dbo/dbo_sqlite.php index 8183c223c..1ffca2f5e 100644 --- a/libs/dbo/dbo_sqlite.php +++ b/libs/dbo/dbo_sqlite.php @@ -1,32 +1,34 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** * SQLite layer for DBO * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.dbo - * @since CakePHP v 0.9.0 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.dbo + * @since CakePHP v 0.9.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** @@ -35,11 +37,13 @@ uses('dbo'); /** - * SQLite layer for DBO. + * Short description for class. + * + * Long description for class * - * @package cake - * @subpackage cake.libs.dbo - * @since CakePHP v 0.9.0 + * @package cake + * @subpackage cake.libs.dbo + * @since CakePHP v 0.9.0 */ class DBO_SQLite extends DBO { @@ -65,7 +69,7 @@ class DBO_SQLite extends DBO } else { - die('Could not connect to DB.'); + //die('Could not connect to DB.'); } } diff --git a/libs/dbo_factory.php b/libs/dbo_factory.php index fc9554a34..af0b4d104 100644 --- a/libs/dbo_factory.php +++ b/libs/dbo_factory.php @@ -1,49 +1,55 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ + /** - * Purpose: DbFactory + * Short description for file. * - * Description: - * Creates DBO-descendant objects from a given db connection configuration + * Long description for file * - * @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.libs.dbo - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Enter description here... * */ uses('object'); -config('database'); - /** * Enter description here... * - * @package cake + */ +config('database'); + +/** + * DbFactory + * + * Creates DBO-descendant objects from a given db connection configuration + * + * @package cake * @subpackage cake.libs.dbo - * @since CakePHP v 1.0.0.0 + * @since CakePHP v 1.0.0.0 * */ class DboFactory extends Object @@ -56,9 +62,9 @@ class DboFactory extends Object */ function getInstance($config = null) { - static $instance; + static $instance = array(); - if (!isset($instance)) + if (!$instance) { if ($config == null) { @@ -67,6 +73,7 @@ class DboFactory extends Object $configs = get_class_vars('DATABASE_CONFIG'); $config = $configs[$config]; + // special case for AdoDB -- driver name in the form of 'adodb-drivername' if (preg_match('#^adodb[\-_](.*)$#i', $config['driver'], $res)) @@ -74,7 +81,7 @@ class DboFactory extends Object uses('dbo/dbo_adodb'); $config['driver'] = $res[1]; - $instance = array(DBO_AdoDB($config)); + $instance[0] =& new DBO_AdoDB($config); } // special case for PEAR:DB -- driver name in the form of 'pear-drivername' elseif (preg_match('#^pear[\-_](.*)$#i', $config['driver'], $res)) @@ -82,7 +89,7 @@ class DboFactory extends Object uses('dbo/dbo_pear'); $config['driver'] = $res[1]; - $instance = array(new DBO_Pear($config)); + $instance[0] =& new DBO_Pear($config); } // regular, Cake-native db drivers else @@ -93,11 +100,11 @@ class DboFactory extends Object if (file_exists($db_driver_fn)) { uses(strtolower('dbo'.DS.$db_driver_class)); - $instance = array(new $db_driver_class($config)); + $instance[0] =& new $db_driver_class($config); } else { - trigger_error(ERROR_UNKNOWN_DATABASE_DRIVER, E_USER_ERROR); + //trigger_error(ERROR_UNKNOWN_DATABASE_DRIVER, E_USER_ERROR); return false; } } diff --git a/libs/dispatcher.php b/libs/dispatcher.php index 77067aa41..6841cacb8 100644 --- a/libs/dispatcher.php +++ b/libs/dispatcher.php @@ -1,35 +1,38 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Dispatcher - * Dispatches the request, creating aproppriate models and controllers. + * Short description for file. * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ + + /** * Add Description */ @@ -45,11 +48,13 @@ define('DISPATCHER_UNKNOWN_VIEW', 'missingView'); uses('error_messages', 'object', 'router', 'controller', 'scaffold'); /** + * Short description for class. + * * Dispatches the request, creating appropriate models and controllers. * - * @package cake + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 */ class Dispatcher extends Object { @@ -370,23 +375,23 @@ class Dispatcher extends Object switch ($params['action']) { case 'index': - $scaffolding->showScaffoldIndex($params); + $scaffolding->scaffoldIndex($params); break; case 'show': - $scaffolding->showScaffoldShow($params); + $scaffolding->scaffoldShow($params); break; case 'list': - $scaffolding->showScaffoldList($params); + $scaffolding->scaffoldList($params); break; case 'new': - $scaffolding->showScaffoldNew($params); + $scaffolding->scaffoldNew($params); break; case 'edit': - $scaffolding->showScaffoldEdit($params); + $scaffolding->scaffoldEdit($params); break; case 'create': diff --git a/libs/error_messages.php b/libs/error_messages.php index d4362ee31..ab0211fa1 100644 --- a/libs/error_messages.php +++ b/libs/error_messages.php @@ -1,33 +1,35 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Error string for when the specified database driver can not be found. @@ -109,4 +111,9 @@ define ('ERROR_404', "The requested address /%s was not found on this server."); */ define ('ERROR_500', "Application error, sorry."); +/** + * Error string for attempted construction of an abstract class + */ +define ('ERROR_ABSTRACT_CONSTRUCTION', '[acl_base] The AclBase class constructor has been called, or the class was instantiated. This class must remain abstract. Please refer to the Cake docs for ACL configuration.'); + ?> \ No newline at end of file diff --git a/libs/file.php b/libs/file.php index 0aa0fbfca..1deea07b8 100644 --- a/libs/file.php +++ b/libs/file.php @@ -1,41 +1,45 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Dispatcher - * Dispatches the request, creating aproppriate models and controllers. + * Short description for file. * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ + /** - * Dispatches the request, creating appropriate models and controllers. + * Short description for class * - * @package cake + * Long description for class + * + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 */ class File { diff --git a/libs/flay.php b/libs/flay.php index a206a9776..23cce5deb 100644 --- a/libs/flay.php +++ b/libs/flay.php @@ -1,34 +1,35 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Enter description here... @@ -36,12 +37,14 @@ uses('object'); /** - * Text-to-html parser, similar to Textile or RedCloth, only with a little different syntax. - * - * @package cake - * @subpackage cake.libs - * @since CakePHP v 0.2.9 - */ + * Short description for class + * + * Text-to-html parser, similar to Textile or RedCloth, only with a little different syntax. + * + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + */ class Flay extends Object { diff --git a/libs/folder.php b/libs/folder.php index 279b22d5f..b35969e2b 100644 --- a/libs/folder.php +++ b/libs/folder.php @@ -1,44 +1,51 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Enter description here... + * + */ uses('object'); /** - * Folder structure browser, lists folders and files. - * - * @package cake - * @subpackage cake.libs - * @since CakePHP v 0.2.9 - */ + * Folder structure browser, lists folders and files. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + */ class Folder extends Object { /** diff --git a/libs/generator/base.php b/libs/generator/base.php new file mode 100644 index 000000000..e82d3f8b8 --- /dev/null +++ b/libs/generator/base.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/commands.php b/libs/generator/commands.php new file mode 100644 index 000000000..e82d3f8b8 --- /dev/null +++ b/libs/generator/commands.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/applications/app/app_generator.php b/libs/generator/generators/applications/app/app_generator.php new file mode 100644 index 000000000..3b161c617 --- /dev/null +++ b/libs/generator/generators/applications/app/app_generator.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.applications.app + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/controller/controller_generator.php b/libs/generator/generators/components/controller/controller_generator.php new file mode 100644 index 000000000..36383532b --- /dev/null +++ b/libs/generator/generators/components/controller/controller_generator.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.controller + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/controller/templates/controller.php b/libs/generator/generators/components/controller/templates/controller.php new file mode 100644 index 000000000..718906fd1 --- /dev/null +++ b/libs/generator/generators/components/controller/templates/controller.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.controller.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/controller/templates/functional_test.php b/libs/generator/generators/components/controller/templates/functional_test.php new file mode 100644 index 000000000..718906fd1 --- /dev/null +++ b/libs/generator/generators/components/controller/templates/functional_test.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.controller.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/controller/templates/helper.php b/libs/generator/generators/components/controller/templates/helper.php new file mode 100644 index 000000000..718906fd1 --- /dev/null +++ b/libs/generator/generators/components/controller/templates/helper.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.controller.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/controller/templates/view.thtml b/libs/generator/generators/components/controller/templates/view.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/generator/generators/components/model/model_generator.php b/libs/generator/generators/components/model/model_generator.php new file mode 100644 index 000000000..8e92a416a --- /dev/null +++ b/libs/generator/generators/components/model/model_generator.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.model + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/model/templates/fixtures.php b/libs/generator/generators/components/model/templates/fixtures.php new file mode 100644 index 000000000..a49b14e60 --- /dev/null +++ b/libs/generator/generators/components/model/templates/fixtures.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.model.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/model/templates/model.php b/libs/generator/generators/components/model/templates/model.php new file mode 100644 index 000000000..a49b14e60 --- /dev/null +++ b/libs/generator/generators/components/model/templates/model.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.model.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/model/templates/unit_test.php b/libs/generator/generators/components/model/templates/unit_test.php new file mode 100644 index 000000000..a49b14e60 --- /dev/null +++ b/libs/generator/generators/components/model/templates/unit_test.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.model.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/scaffold/scaffold_generator.php b/libs/generator/generators/components/scaffold/scaffold_generator.php new file mode 100644 index 000000000..d186dbaea --- /dev/null +++ b/libs/generator/generators/components/scaffold/scaffold_generator.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.scaffold + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/scaffold/templates/controller.php b/libs/generator/generators/components/scaffold/templates/controller.php new file mode 100644 index 000000000..6aa1cdcb7 --- /dev/null +++ b/libs/generator/generators/components/scaffold/templates/controller.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.scaffold.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/scaffold/templates/form.thtml b/libs/generator/generators/components/scaffold/templates/form.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/generator/generators/components/scaffold/templates/form_scaffolding.thtml b/libs/generator/generators/components/scaffold/templates/form_scaffolding.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/generator/generators/components/scaffold/templates/functional_test.php b/libs/generator/generators/components/scaffold/templates/functional_test.php new file mode 100644 index 000000000..6aa1cdcb7 --- /dev/null +++ b/libs/generator/generators/components/scaffold/templates/functional_test.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.scaffold.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/scaffold/templates/helper.php b/libs/generator/generators/components/scaffold/templates/helper.php new file mode 100644 index 000000000..6aa1cdcb7 --- /dev/null +++ b/libs/generator/generators/components/scaffold/templates/helper.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.scaffold.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/scaffold/templates/layout.thtml b/libs/generator/generators/components/scaffold/templates/layout.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/generator/generators/components/scaffold/templates/style.css b/libs/generator/generators/components/scaffold/templates/style.css new file mode 100644 index 000000000..e69de29bb diff --git a/libs/generator/generators/components/scaffold/templates/view_edit.thtml b/libs/generator/generators/components/scaffold/templates/view_edit.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/generator/generators/components/scaffold/templates/view_list.thtml b/libs/generator/generators/components/scaffold/templates/view_list.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/generator/generators/components/scaffold/templates/view_new.thtml b/libs/generator/generators/components/scaffold/templates/view_new.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/generator/generators/components/scaffold/templates/view_show.thtml b/libs/generator/generators/components/scaffold/templates/view_show.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/generator/generators/components/web/templates/api_definition.php b/libs/generator/generators/components/web/templates/api_definition.php new file mode 100644 index 000000000..117751044 --- /dev/null +++ b/libs/generator/generators/components/web/templates/api_definition.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.web.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/web/templates/controller.php b/libs/generator/generators/components/web/templates/controller.php new file mode 100644 index 000000000..117751044 --- /dev/null +++ b/libs/generator/generators/components/web/templates/controller.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.web.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/web/templates/functional_test.php b/libs/generator/generators/components/web/templates/functional_test.php new file mode 100644 index 000000000..117751044 --- /dev/null +++ b/libs/generator/generators/components/web/templates/functional_test.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.web.templates + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/generators/components/web/web_generator.php b/libs/generator/generators/components/web/web_generator.php new file mode 100644 index 000000000..90c7abaec --- /dev/null +++ b/libs/generator/generators/components/web/web_generator.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.generators.components.web + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/lookup.php b/libs/generator/lookup.php new file mode 100644 index 000000000..e82d3f8b8 --- /dev/null +++ b/libs/generator/lookup.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/manifest.php b/libs/generator/manifest.php new file mode 100644 index 000000000..e82d3f8b8 --- /dev/null +++ b/libs/generator/manifest.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/options.php b/libs/generator/options.php new file mode 100644 index 000000000..e82d3f8b8 --- /dev/null +++ b/libs/generator/options.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/scripts.php b/libs/generator/scripts.php new file mode 100644 index 000000000..e82d3f8b8 --- /dev/null +++ b/libs/generator/scripts.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/scripts/destroy.php b/libs/generator/scripts/destroy.php new file mode 100644 index 000000000..443823138 --- /dev/null +++ b/libs/generator/scripts/destroy.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.scripts + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/scripts/generate.php b/libs/generator/scripts/generate.php new file mode 100644 index 000000000..443823138 --- /dev/null +++ b/libs/generator/scripts/generate.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.scripts + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/scripts/update.php b/libs/generator/scripts/update.php new file mode 100644 index 000000000..443823138 --- /dev/null +++ b/libs/generator/scripts/update.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator.scripts + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/simple_logger.php b/libs/generator/simple_logger.php new file mode 100644 index 000000000..e82d3f8b8 --- /dev/null +++ b/libs/generator/simple_logger.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/generator/spec.php b/libs/generator/spec.php new file mode 100644 index 000000000..e82d3f8b8 --- /dev/null +++ b/libs/generator/spec.php @@ -0,0 +1,33 @@ + + // +// + Copyright: (c) 2005, Cake Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * + * + * + * @filesource + * @author Cake Authors/Developers + * @copyright Copyright (c) 2005, Cake Authors/Developers + * @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.generator + * @since Cake v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +?> \ No newline at end of file diff --git a/libs/helper.php b/libs/helper.php new file mode 100644 index 000000000..2ce1a1bc5 --- /dev/null +++ b/libs/helper.php @@ -0,0 +1,177 @@ + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Backend for helpers. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.9.2 + * + */ +class Helper extends Object +{ + /************************************************************************* + * Public variables + *************************************************************************/ + + /**#@+ + * @access public + */ + + + /** + * Holds tag templates. + * + * @access public + * @var array + */ + var $tags = array(); + + /**#@-*/ + + /************************************************************************* + * Public methods + *************************************************************************/ + + /**#@+ + * @access public + */ + + /** + * Constructor. + * + * Parses tag templates into $this->tags. + * + * @return void + */ + function Helper() + { + $this->tags = $this->readConfigFile(CONFIGS.'tags.ini.php'); + } + + /** + * Decides wheter to output or return a string. + * + * Based on AUTO_OUTPUT and $return's value, this method decides wheter to + * output a string, or return it. + * + * @param string $str String to be outputed or returned. + * @param boolean $return Wheter this method should return a value or + * output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function output($str, $return = false) + { + if (AUTO_OUTPUT && $return === false) + { + if (print $str) + { + return true; + } + else + { + return false; + } + } + else + { + return $str; + } + } + + /** + * Assigns values to tag templates. + * + * Finds a tag template by $keyName, and replaces $values's keys with + * $values's keys. + * + * @param string $keyName Name of the key in the tag array. + * @param array $values Values to be inserted into tag. + * @return string Tag with inserted values. + */ + function assign($keyName, $values) + { + return str_replace('%%'.array_keys($values).'%%', array_values($values), + $this->tags[$keyName]); + } + + function readConfigFile ($fileName) + { + $fileLineArray = file($fileName); + + foreach ($fileLineArray as $fileLine) + { + $dataLine = trim($fileLine); + $firstChar = substr($dataLine, 0, 1); + if ($firstChar != ';' && $dataLine != '') + { + if ($firstChar == '[' && substr($dataLine, -1, 1) == ']') + { + // [section block] we might use this later do not know for sure + // this could be used to add a key with the section block name + // but it adds another array level + } + else + { + $delimiter = strpos($dataLine, '='); + if ($delimiter > 0) + { + $key = strtolower(trim(substr($dataLine, 0, $delimiter))); + $value = trim(substr($dataLine, $delimiter + 1)); + if (substr($value, 0, 1) == '"' && substr($value, -1) == '"') + { + $value = substr($value, 1, -1); + } + $iniSetting[$key] = stripcslashes($value); + } + else + { + $iniSetting[strtolower(trim($dataLine))]=''; + } + } + } + else + { + } + } + return $iniSetting; + } + + /**#@-*/ +} + +?> \ No newline at end of file diff --git a/libs/helpers/acl.php b/libs/helpers/acl.php index b27e85430..0640777c2 100644 --- a/libs/helpers/acl.php +++ b/libs/helpers/acl.php @@ -1,41 +1,45 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Access Control List. + * Access Control List. * - * @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.libs.helpers - * @since CakePHP v 0.9.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * Long description for file * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.helpers + * @since CakePHP v 0.9.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ + /** * Access Control List helper library. + * + * Long description for class * - * @package cake + * @package cake * @subpackage cake.libs.helpers - * @since CakePHP v 0.9.2 + * @since CakePHP v 0.9.2 * */ class AclHelper @@ -50,4 +54,4 @@ { } } -?> \ No newline at end of file +?> diff --git a/libs/helpers/ajax.php b/libs/helpers/ajax.php index 759fbc069..f9640e880 100644 --- a/libs/helpers/ajax.php +++ b/libs/helpers/ajax.php @@ -1,45 +1,49 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Dispatcher - * Dispatches the request, creating aproppriate models and controllers. + * Short description for file. * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.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 + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.helpers + * @since CakePHP v 0.9.1 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ + /** * AjaxHelper helper library. + * + * Long description for class * - * @package cake + * @package cake * @subpackage cake.libs.helpers - * @since CakePHP v 0.9.1 + * @since CakePHP v 0.9.1 * */ class AjaxHelper { } -?> \ No newline at end of file +?> diff --git a/libs/helpers/form.php b/libs/helpers/form.php index a6890f222..c6009b47e 100644 --- a/libs/helpers/form.php +++ b/libs/helpers/form.php @@ -1,35 +1,40 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Dispatcher - * Dispatches the request, creating aproppriate models and controllers. + * Short description for file. * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.helpers - * @since CakePHP v 0.9.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.helpers + * @since CakePHP v 0.9.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ + +/** + * Enter description here... + */ uses( 'helpers/html' ); /** @@ -54,16 +59,18 @@ define('TAG_FIELDSET', '
    %s%s'); /** * Form helper library. + * + * Long description for class * - * @package cake + * @package cake * @subpackage cake.libs.helpers - * @since CakePHP v 0.9.1 + * @since CakePHP v 0.9.2 * */ class FormHelper { - /** +/** * Constructor which takes an instance of the HtmlHelper class. * * @param object $htmlHelper the HtmlHelper object to use as our helper. @@ -73,13 +80,13 @@ class FormHelper { } - /** +/** * Returns a formatted error message for given FORM field, NULL if no errors. * * @param string $field If field is to be used for CRUD, this should be modelName/fieldName * @return bool If there are errors this method returns true, else false. */ - function isFieldError(HtmlHelper $html, $field ) + function isFieldError($html, $field ) { $error = 1; $html->setFormTag( $field ); @@ -91,7 +98,7 @@ class FormHelper } } - /** +/** * Returns a formatted LABEL tag for HTML FORMs. * * @param string $tagName If field is to be used for CRUD, this should be modelName/fieldName @@ -103,7 +110,7 @@ class FormHelper return sprintf( TAG_LABEL, $tagName, $text ); } - /** +/** * Returns a formatted DIV tag for HTML FORMs. * * @param string $class If field is to be used for CRUD, this should be modelName/fieldName @@ -115,7 +122,7 @@ class FormHelper return sprintf( TAG_DIV, $class, $text ); } - /** +/** * Returns a formatted P tag with class for HTML FORMs. * * @param string $class If field is to be used for CRUD, this should be modelName/fieldName @@ -127,7 +134,7 @@ class FormHelper return sprintf( TAG_P_CLASS, $class, $text ); } - /** +/** * Returns a formatted INPUT tag for HTML FORMs. * * @param HtmlHelper $html The HtmlHelper object which is creating this form. @@ -139,7 +146,7 @@ class FormHelper * @param array $htmlOptions * @return string The formatted INPUT element */ - function generateInputDiv(HtmlHelper $html, $tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null ) + function generateInputDiv($html, $tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null ) { $str = $html->inputTag( $tagName, $size, $htmlOptions ); $strLabel = $this->labelTag( $tagName, $prompt ); @@ -163,7 +170,69 @@ class FormHelper } - function generateAreaDiv(HtmlHelper $html, $tagName, $prompt, $required=false, $errorMsg=null, $cols=60, $rows=10, $htmlOptions=null ) + function generateDate($html, $tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null ) + { + $str = $html->dateTimeOptionTag( $tagName, 'MDY' , 'NONE' ); + $strLabel = $this->labelTag( $tagName, $prompt ); + + $divClass = "optional"; + + if( $required ) + $divClass = "required"; + + $strError = ""; // initialize the error to empty. + + if( $this->isFieldError( $html, $tagName ) ) + { + // if it was an error that occured, then add the error message, and append " error" to the div tag. + $strError = $this->pTag( 'error', $errorMsg ); + $divClass = sprintf( "%s error", $divClass ); + } + $divTagInside = sprintf( "%s %s %s", $strError, $strLabel, $str ); + + $requiredDiv = $this->divTag( $divClass, $divTagInside ); + + return $this->divTag("date", $requiredDiv); + } + + function generateDateTime($html, $tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null ) + { + $str = $html->dateTimeOptionTag( $tagName, 'MDY' , '12' ); + $strLabel = $this->labelTag( $tagName, $prompt ); + + $divClass = "optional"; + + if( $required ) + $divClass = "required"; + + $strError = ""; // initialize the error to empty. + + if( $this->isFieldError( $html, $tagName ) ) + { + // if it was an error that occured, then add the error message, and append " error" to the div tag. + $strError = $this->pTag( 'error', $errorMsg ); + $divClass = sprintf( "%s error", $divClass ); + } + $divTagInside = sprintf( "%s %s %s", $strError, $strLabel, $str ); + + $requiredDiv = $this->divTag( $divClass, $divTagInside ); + + return $this->divTag("date", $requiredDiv); + } +/** + * Enter description here... + * + * @param HtmlHelper $html + * @param unknown_type $tagName + * @param unknown_type $prompt + * @param unknown_type $required + * @param unknown_type $errorMsg + * @param unknown_type $cols + * @param unknown_type $rows + * @param unknown_type $htmlOptions + * @return unknown + */ + function generateAreaDiv($html, $tagName, $prompt, $required=false, $errorMsg=null, $cols=60, $rows=10, $htmlOptions=null ) { $str = $html->areaTag( $tagName, $cols, $rows, $htmlOptions ); $strLabel = $this->labelTag( $tagName, $prompt ); @@ -186,7 +255,8 @@ class FormHelper return $this->divTag( $divClass, $divTagInside ); } - /** + +/** * Returns a formatted SELECT tag for HTML FORMs. * * @param HtmlHelper $html The HtmlHelper object which is creating this form. @@ -202,7 +272,7 @@ class FormHelper * @param array $optionAttr * @return string The formatted INPUT element */ - function generateSelectDiv(HtmlHelper $html, $tagName, $prompt, $options, $selected=null, $selectAttr=null, $optionAttr=null, $required=false, $errorMsg=null) + function generateSelectDiv($html, $tagName, $prompt, $options, $selected=null, $selectAttr=null, $optionAttr=null, $required=false, $errorMsg=null) { $str = $html->selectTag( $tagName, $options, $selected, $selectAttr, $optionAttr ); $strLabel = $this->labelTag( $tagName, $prompt ); @@ -224,6 +294,12 @@ class FormHelper return $this->divTag( $divClass, $divTagInside ); + } + + function generateSubmitDiv($html, $displayText, $htmlOptions = null) + { + return $this->divTag( 'submit', $html->submitTag( $displayText, $htmlOptions) ); + } /** @@ -233,41 +309,89 @@ class FormHelper * @param array $fields An array of form field definitions. * @return string The completed form specified by the $fields praameter. */ - function generateFields( $html, $fields ) + function generateFields( $html, $fields, $readOnly = false ) { $strFormFields = ''; foreach( $fields as $field ) { - switch( $field['type'] ) - { - case "input" : - $strFormFields = $strFormFields.$this->generateInputDiv( $html, $field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], $field['size'], $field['htmlOptions'] ); - break; - case "select"; - $strFormFields = $strFormFields.$this->generateSelectDiv( $html, $field['tagName'], $field['prompt'], $field['options'], $field['selected'], $field['selectAttr'], $field['optionsAttr'], $field['required'], $field['errorMsg'] ); - break; - case "area"; - $strFormFields = $strFormFields.$this->generateAreaDiv( $html, $field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], $field['cols'], $field['rows'], $field['htmlOptions'] ); - break; - case "fieldset"; - $strFieldsetFields = $this->generateFields( $html, $field['fields'] ); + if( isset( $field['type'] ) ) + { + // initialize some optional parameters to avoid the notices + if( !isset($field['required'] ) ) + $field['required'] = false; + if( !isset( $field['errorMsg'] ) ) + $field['errorMsg'] = null; + if( !isset( $field['htmlOptions'] ) ) + $field['htmlOptions'] = null; - $strFieldSet = sprintf( ' -
    - %s -
    -

    %s

    -

    %s

    -
    - %s -
    ', $field['legend'], $field['noteHeading'], $field['note'], $strFieldsetFields ); - return $strFieldSet; - break; - default: - //bugbug: i don't know how to put out a notice that an unknown type was entered. - break; - } + if( $readOnly ) + { + $field['htmlOptions']['READONLY'] = "readonly"; + } + switch( $field['type'] ) + { + case "input" : + // If the size has not been set, initialize it to 40. + if( !isset( $field['size'] ) ) + { + $field['size'] = 40; + } + $strFormFields = $strFormFields.$this->generateInputDiv( $html, $field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], $field['size'], $field['htmlOptions'] ); + break; + case "select"; + { + // If the selected attribute has not been set, initialize it to null. + if( !isset( $field['selected'] ) ) + $field['selected'] = null; + if( !isset( $field['selectAttr'] ) ) + $field['selectAttr'] = null; + if( !isset( $field['optionsAttr'] ) ) + $field['optionsAttr'] = null; + + if( $readOnly ) + $field['selectAttr']['DISABLED'] = true; + + $strFormFields = $strFormFields.$this->generateSelectDiv( $html, $field['tagName'], $field['prompt'], $field['options'], $field['selected'], $field['selectAttr'], $field['optionsAttr'], $field['required'], $field['errorMsg'] ); + } + break; + case "area"; + { + if( !isset( $field['rows'] ) ) + $field['rows'] = 10; + if( !isset( $field['cols'] ) ) + $field['cols'] = 60; + $strFormFields = $strFormFields.$this->generateAreaDiv( $html, $field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], $field['cols'], $field['rows'], $field['htmlOptions'] ); + } + break; + case "fieldset"; + $strFieldsetFields = $this->generateFields( $html, $field['fields'] ); + + $strFieldSet = sprintf( ' +
    + %s +
    +

    %s

    +

    %s

    +
    + %s +
    ', $field['legend'], $field['noteHeading'], $field['note'], $strFieldsetFields ); + $strFormFields = $strFormFields.$strFieldSet; + break; + case "hidden"; + $strFormFields = $strFormFields.$html->hiddenTag( $field['tagName']); + break; + case "date": + $strFormFields = $strFormFields.$this->generateDate( $html, $field['tagName'], $field['prompt'] ); + break; + case "datetime": + $strFormFields = $strFormFields.$this->generateDateTime( $html, $field['tagName'], $field['prompt'] ); + break; + default: + //bugbug: i don't know how to put out a notice that an unknown type was entered. + break; + } // end switch $field['type'] + } // end if isset $field['type'] } return $strFormFields; } diff --git a/libs/helpers/html.php b/libs/helpers/html.php index 967185639..9158cf324 100644 --- a/libs/helpers/html.php +++ b/libs/helpers/html.php @@ -1,107 +1,926 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Dispatcher - * Dispatches the request, creating aproppriate models and controllers. - * + * Html Helper class file. + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.helpers - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.helpers + * @since CakePHP v 0.9.1 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** - * Html helper library. + * Html Helper class for easy use of html widgets. * - * @package cake + * HtmlHelper encloses all methods needed while working with html pages. + * + * @package cake * @subpackage cake.libs.helpers - * @since CakePHP v 0.9.1 - * + * @since CakePHP v 0.9.1 */ -class HtmlHelper +class HtmlHelper extends Helper { -/** - * Breadcrumbs. + /************************************************************************* + * Public variables + *************************************************************************/ + + /**#@+ + * @access public + */ + + /** + * Enter description here... + * + * @var unknown_type + */ + var $base = null; + + /** + * Enter description here... + * + * @var unknown_type + */ + var $here = null; + /** + * Enter description here... + * + * @var unknown_type + */ + var $params = array(); + /** + * Enter description here... + * + * @var unknown_type + */ + var $action = null; + /** + * Enter description here... + * + * @var unknown_type + */ + var $data = null; + /** + * Enter description here... + * + * @var unknown_type + */ + var $model = null; + /** + * Enter description here... + * + * @var unknown_type + */ + var $field = null; + + /**#@-*/ + + /************************************************************************* + * Private variables + *************************************************************************/ + + /**#@+ + * @access private + */ + + /** + * Breadcrumbs. + * + * @var array + * @access private + */ + var $_crumbs = array(); + + + + /** + * Adds $name and $link to the breadcrumbs array. + * + * @param string $name Text for link + * @param string $link URL for link + */ + function addCrumb($name, $link) + { + $this->_crumbs[] = array($name, $link); + } + + /** + * Returns a charset meta-tag + * + * @param string $charset + * @param boolean $return Wheter this method should return a value or + * output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function charset($charset, $return) + { + return $this->output(sprintf($this->tags['charset'], $charset), $return); + } + + /** + * Finds URL for specified action. + * + * Returns an URL pointing to a combination of controller and action. Param + * $url can be: + * + Empty - the method will find adress to actuall controller/action. + * + '/' - the method will find base URL of application. + * + A combination of controller/action - the method will find url for it. + * + * @param string $url + * @param boolean $return Wheter this method should return a value or + * output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function url($url = null, $return = false) + { + if (empty($url)) + { + return $this->here; + } + elseif ($url{0} == '/') + { + $output = $this->base . $url; + } + else + { + $output = $this->base.'/'.strtolower($this->params['controller']).'/'.$url; + } + + return $this->output(ereg_replace('&([^a])', '&\1', $output), $return); + } + + /** + * Creates an HTML link. + * + * If $url starts with "http://" this is treated as an external link. Else, + * it is treated as a path to controller/action and parsed with the + * HtmlHelper::url() method. + * + * If the $url is empty, $title is used instead. + * + * @param string $title The content of the "a" tag. + * @param string $url + * @param array $htmlAttributes Array of HTML attributes. + * @param string $confirmMessage Confirmation message. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function link($title, $url = null, $htmlAttributes = null, $confirmMessage = false, + $return = false) + { + $url = $url? $url: $title; + + if ($confirmMessage) + { + $htmlAttributes['onclick'] = "return confirm('{$confirmMessage}');"; + } + + if (strpos($url, '://')) + { + $output = sprintf($this->tags['link'], $url, + $this->_parseAttributes($htmlAttributes), $title); + } + else + { + $output = sprintf($this->tags['link'], $this->url($url, true), + $this->_parseAttributes($htmlAttributes), $title); + } + + return $this->output($output, $return); + } + + /** + * Creates a submit widget. + * + * @param string $caption Text on submit button + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function submit($caption = 'Submit', $htmlAttributes = null, $return = false) + { + $htmlAttributes['value'] = $caption; + return $this->output(sprintf($this->tags['submit'], + $this->_parseAttributes($htmlAttributes, null, '', ' ')), $return); + } + + + + /** + * Creates a password input widget. + * + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function password($fieldName, $htmlAttributes = null, $return = false) + { + $this->setFormTag($fieldName); + $htmlAttributes['size'] = $size; + + if (empty($htmlAttributes['value'])) + { + $htmlAttributes['value'] = $this->tagValue($fieldName); + } + + return $this->output(sprintf($this->tags['password'], $this->model, $this->field, + $this->_parseAttributes($htmlAttributes, null, '', ' ')), $return); + } + + + + + + /** + * Creates a textarea widget. + * + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function textarea($fieldName, $htmlAttributes = null, $return = false) + { + $this->setFormTag($fieldName); + + if (empty($htmlAttributes['value'])) + { + $value = $this->tagValue($fieldName); + } + else + { + $value = empty($htmlAttributes['value']); + } + + if ($this->tagIsInvalid($this->model, $this->field)) + { + $htmlAttributes['class'] = 'form_error'; + } + + return $this->output(sprintf($this->tags['textarea'], $this->model,$this->field, + $this->_parseAttributes($htmlAttributes, null, ' '), $value), $return); + } + + /** + * Creates a checkbox widget. + * + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param string $title + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function checkbox($fieldName, $title = null, $htmlAttributes = null, + $return = false) + { + $this->setFormTag($fieldName); + $this->tagValue($fieldName)? $htmlAttributes['checked'] = 'checked': null; + $title = $title? $title: ucfirst($fieldName); + return $this->output(sprintf(TAG_CHECKBOX, $this->model, $this->field, + $this->field, $this->field, + $this->_parseAttributes($htmlAttributes, null, '', ' '), $title), $return); + } + + /** + * Creates a link element for CSS stylesheets. + * + * @param string $path Path to CSS file + * @param string $rel Rel attribute. Defaults to "stylesheet". + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function css($path, $rel = 'stylesheet', $htmlAttributes = null, $return = false) + { + $url = "{$this->base}/".(COMPRESS_CSS? 'c': '')."css/{$path}.css"; + return $this->output(sprintf($this->tags['css'], $rel, $url, + $this->parseHtmlOptions($htmlAttributes, null, '', ' ')), $return); + } + + /** + * Creates file input widget. + * + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function file($fieldName, $htmlAttributes = null, $return = false) + { + return $this->output(sprintf(TAG_FILE, $fieldName, + $this->_parseAttributes($htmlAttributes, null, '', ' ')), $return); + } + + /** + * Returns the breadcrumb trail as a sequence of »-separated links. + * + * @param string $separator Text to separate crumbs. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. If $this->_crumbs is empty, return null. + */ + function getCrumbs($separator = '»', $return = false) + { + if(count($this->_crumbs)) + { + + $out = array("base}\">START"); + foreach ($this->_crumbs as $crumb) + { + $out[] = "base}{$crumb[1]}\">{$crumb[0]}"; + } + + return $this->output(join($separator, $out), $return); + } + else + { + return null; + } + } + + /** + * Creates a hidden input tag. + * + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function hidden($fieldName, $htmlAttributes = null, $return = false) + { + $this->setFormTag($fieldName); + $htmlAttributes['value'] = $value? $value: $this->tagValue($fieldName); + return $this->output(sprintf($this->tags['hidden'], $this->model, $this->field, + $this->_parseAttributes($htmlAttributes, null, '', ' ')), $return); + } + + + /** + * Returns a formatted IMG element. + * + * @param string $path Path to the image file. + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function image($path, $htmlAttributes = null, $return = false) + { + $url = $this->base.IMAGES_URL.$path; + $alt = $htmlAttributes['alt']; + return $this->output(sprintf(TAG_IMAGE, $url, $alt, $this->parseHtmlOptions($htmlAttributes, null, '', ' ')), $return); + } + + /** + * Creates a text input widget. + * + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function input($fieldName, $htmlAttributes = null, $return = false) + { + $this->setFormTag($fieldName); + + if (!isset($htmlAttributes['value'])) + { + $htmlAttributes['value'] = $this->tagValue($fieldName); + } + + if ($this->tagIsInvalid($this->model, $this->field)) + { + $htmlAttributes['class'] = 'form_error'; + } + + return $this->output(sprintf($this->tags['input'], $this->model, $this->field, + $this->_parseAttributes($htmlAttributes, null, '', ' ')), $return); + } + + /** + * Creates a set of radio widgets. + * + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param array $options + * @param array $inbetween + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function radio($fieldName, $options, $inbetween = null, $htmlAttributes = null, + $return = false) + { + $this->setFormTag($fieldName); + $value = isset($htmlAttributes['value'])? $htmlAttributes['value']: $this->tagValue($fieldName); + $out = array(); + foreach ($options as $opt_value=>$opt_title) + { + $options_here = array('value' => $opt_value); + $opt_value==$value? $options_here['checked'] = 'checked': null; + $parsed_options = $this->parseHtmlOptions(array_merge($htmlAttributes, $options_here), null, '', ' '); + $individual_tag_name = "{$this->field}_{$opt_value}"; + $out[] = sprintf(TAG_RADIOS, $individual_tag_name, $this->model, $this->field, $individual_tag_name, $parsed_options, $opt_title); + } + + $out = join($inbetween, $out); + return $this->output($out? $out: null, $return); + } + + + + + + + + + + + + /** + * Returns a row of formatted and named TABLE headers. * - * @var array - * @access private - */ - var $_crumbs = array(); - - - var $base = null; - var $here = null; - var $params = array(); - var $action = null; - var $data = null; - var $model = null; - var $field = null; - -/** - * Returns given string trimmed to given length, adding an ending (default: "..") if necessary. - * - * @param string $string String to trim - * @param integer $length Length of returned string, excluding ellipsis - * @param string $ending Ending to be appended after trimmed string - * @return string Trimmed string - */ - function trim($string, $length, $ending='..') - { - return substr($string, 0, $length).(strlen($string)>$length? $ending: null); - } - -/** - * Returns an URL for a combination of controller and action. - * - * @param string $url - * @return string Full constructed URL as a string. - */ - function urlFor($url=null) - { - if (empty($url)) - { - return $this->here; - } - elseif ($url[0] == '/') - { - $out = $this->base . $url; - } - else - { - $out = $this->base . '/' . strtolower($this->params['controller']) . '/' . $url; - } - - return ereg_replace('&([^a])', '&\1', $out); - } - -/** - * Returns a space-separated string with items of the $options array. - * - * @param array $options Array of HTML options. - * @param string $insert_before - * @param unknown_type $insert_after + * @param array $names + * @param array $tr_options + * @param array $th_options * @return string */ + function tableHeaders($names, $tr_options=null, $th_options=null) + { + $out = array(); + foreach ($names as $arg) + { + $out[] = sprintf(TAG_TABLE_HEADER, $this->parseHtmlOptions($th_options), $arg); + } + + return sprintf(TAG_TABLE_HEADERS, $this->parseHtmlOptions($tr_options), join(' ', $out)); + } + + /** + * Returns a formatted string of table rows (TR's with TD's in them). + * + * @param array $data Array of table data + * @param array $tr_options HTML options for TR elements + * @param array $td_options HTML options for TD elements + * @return string + */ + function tableCells($data, $odd_tr_options=null, $even_tr_options=null) + { + if (empty($data[0]) || !is_array($data[0])) + { + $data = array($data); + } + + $count=0; + foreach ($data as $line) + { + $count++; + $cells_out = array(); + foreach ($line as $cell) + { + $cells_out[] = sprintf(TAG_TABLE_CELL, null, $cell); + } + + $options = $this->parseHtmlOptions($count%2? $odd_tr_options: $even_tr_options); + $out[] = sprintf(TAG_TABLE_ROW, $options, join(' ', $cells_out)); + } + + return join("\n", $out); + } + + + + + + + + /** + * Returns value of $fieldName. False is the tag does not exist. + * + * @param string $fieldName + * @return unknown Value of the named tag. + */ + function tagValue ($fieldName) + { + $this->setFormTag($fieldName); + return isset($this->params['data'][$this->model][$this->field])? $this->params['data'][$this->model][$this->field]: false; + } + + /** + * Returns false if given FORM field has no errors. Otherwise it returns the constant set in the array Model->validationErrors. + * + * @param unknown_type $field + * @return unknown + */ + function tagIsInvalid ($model, $field) + { + return empty($this->validationErrors[$model][$field])? 0: $this->validationErrors[$model][$field]; + } + + /** + * Returns number of errors in a submitted FORM. + * + * @return int Number of errors + */ + function validate () + { + $args = func_get_args(); + $errors = call_user_func_array(array(&$this, 'validateErrors'), $args); + + return count($errors); + } + + /** + * Validates a FORM according to the rules set up in the Model. + * + * @return int Number of errors + */ + function validateErrors () + { + $objects = func_get_args(); + if (!count($objects)) return false; + + $errors = array(); + foreach ($objects as $object) + { + $errors = array_merge($errors, $object->invalidFields($object->data)); + } + + return $this->validationErrors = (count($errors)? $errors: false); + } + + /** + * Returns a formatted error message for given FORM field, NULL if no errors. + * + * @param string $field If field is to be used for CRUD, this should be modelName/fieldName + * @param string $text + * @return string If there are errors this method returns an error message, else NULL. + */ + function tagErrorMsg ($field, $text) + { + $error = 1; + $this->setFormTag($field); + + if ($error == $this->tagIsInvalid($this->model, $this->field)) + { + return sprintf(SHORT_ERROR_MESSAGE, is_array($text)? (empty($text[$error-1])? 'Error in field': $text[$error-1]): $text); + } + else + { + return null; + } + } + + function setFormTag($tagValue) + { + return list($this->model, $this->field) = explode("/", $tagValue); + } + + /**#@-*/ + + /************************************************************************* + * Private methods + *************************************************************************/ + + /**#@+ + * @access private + */ + + /** + * Returns a space-separated string with items of the $options array. If a + * key of $options array happens to be one of: + * + 'compact' + * + 'checked' + * + 'declare' + * + 'readonly' + * + 'disabled' + * + 'selected' + * + 'defer' + * + 'ismap' + * + 'nohref' + * + 'noshade' + * + 'nowrap' + * + 'multiple' + * + 'noresize' + * + * And it's value is one of: + * + 1 + * + true + * + 'true' + * + * Then the value will be reset to be identical with key's name. + * If the value is not one of these 3, the parameeter is not outputed. + * + * @param array $options Array of options. + * @param array $exclude Array of options to be excluded. + * @param string $insertBefore String to be inserted before options. + * @param string $insertAfter String to be inserted ater options. + * @return string + */ + function _parseAttributes($options, $exclude = null, $insertBefore = ' ', + $insertAfter = null) + { + $minimizedAttributes = array( + 'compact', + 'checked', + 'declare', + 'readonly', + 'disabled', + 'selected', + 'defer', + 'ismap', + 'nohref', + 'noshade', + 'nowrap', + 'multiple', + 'noresize'); + + if (!is_array($exclude)) + { + $exclude = array(); + } + + if (is_array($options)) + { + $out = array(); + + foreach ($options as $key => $value) + { + if (!in_array($key, $exclude)) + { + if (in_array($key, $minimizedAttributes) && ($value === 1 || + $value === true || $value === 'true' || in_array($value, + $minimizedAttributes))) + { + $value = $key; + } + elseif (in_array($key, $minimizedAttributes)) + { + continue; + } + $out[] = "{$key}=\"{$value}\""; + } + } + $out = join(' ', $out); + return $out? $insertBefore.$out.$insertAfter: null; + } + else + { + return $options? $insertBefore.$options.$insertAfter: null; + } + } + + /**#@-*/ + + /************************************************************************* + * Renamed methods + *************************************************************************/ + + /** + * @deprecated Name changed to 'textarea'. Version 0.9.2. + * @see HtmlHelper::textarea() + * @param string $tagName + * @param integer $cols + * @param integer $rows + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function areaTag($tagName, $cols = 60, $rows = 10, $htmlAttributes = null, $return = false) + { + $htmlAttributes['cols'] = $cols; + $htmlAttributes['rows'] = $rows; + return $this->textarea($tagName, $htmlAttributes, $return); + } + + /** + * @deprecated Name changed to 'charset'. Version 0.9.2. + * @see HtmlHelper::charset() + * @param string $charset + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function charsetTag($charset, $return) + { + return $this->charset($charset, $return); + } + + /** + * @deprecated Name changed to 'checkbox'. Version 0.9.2. + * @see HtmlHelper::checkbox() + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param string $title + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function checkboxTag($fieldName, $title = null, $htmlAttributes = null, $return = false) + { + return $this->checkbox($fieldName, $title, $htmlAttributes, $return); + } + + /** + * @deprecated Name changed to 'css'. Version 0.9.2. + * @see HtmlHelper::css() + * @param string $path Path to CSS file + * @param string $rel Rel attribute. Defaults to "stylesheet". + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function cssTag($path, $rel = 'stylesheet', $htmlAttributes = null, $return = false) + { + return $this->css($path, $rel , $htmlAttributes , $return ); + } + + /** + * @deprecated Name changed to 'file'. Version 0.9.2. + * @see HtmlHelper::file() + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function fileTag($fieldName, $htmlAttributes = null, $return = false) + { + return $this->file($fieldName, $htmlAttributes, $return); + } + + /** + * @deprecated Name changed to 'hidden'. Version 0.9.2. + * @see HtmlHelper::hidden() + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param string $value + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + //function hiddenTag($fieldName, $value = null, $htmlAttributes = null, $return = false) + //{ + // $htmlAttributes['value'] = $value; + // return $this->hidden($fieldName, $htmlAttributes, $return); + //} + function hiddenTag($tagName, $value=null, $htmlOptions=null) + { + $this->setFormTag($tagName); + $htmlOptions['value'] = $value? $value: $this->tagValue($tagName); + return $this->output(sprintf($this->tags['hidden'], $this->model, $this->field, $this->parseHtmlOptions($htmlOptions, null, '', ' '))); + } + /** + * @deprecated Name changed to 'image'. Version 0.9.2. + * @see HtmlHelper::image() + * @param string $path Path to the image file. + * @param string $alt + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function imageTag($path, $alt = null, $htmlAttributes = null, $return = false) + { + $htmlAttributes['alt'] = $alt; + return $this->image($path, $htmlAttributes, $return); + } + + /** + * @deprecated Name changed to 'input'. Version 0.9.2. + * @see HtmlHelper::input() + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param string $value + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + //function inputTag($fieldName, $value = null, $htmlAttributes = null, $return = false) + //{ + // $htmlAttributes['value'] = $value; + // return $this->input($fieldName, $htmlAttributes, $return); + //} + + function inputTag($tagName, $size=20, $htmlOptions=null) + { + $this->setFormTag($tagName); + $htmlOptions['value'] = isset($htmlOptions['value'])? $htmlOptions['value']: $this->tagValue($tagName); + $this->tagIsInvalid($this->model,$this->field)? $htmlOptions['class'] = 'form_error': null; + return $this->output(sprintf($this->tags['input'], $this->model, $this->field, $this->parseHtmlOptions($htmlOptions, null, '', ' '))); + } + + /** + * @deprecated Unified with 'link'. Version 0.9.2. + * @see HtmlHelper::link() + * @param string $title The content of the "a" tag. + * @param string $url + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function linkOut($title, $url = null, $htmlAttributes = null, $return = false) + { + return $this->link($title, $url, $htmlAttributes, false, $return); + } + + /** + * @deprecated Unified with 'link'. Version 0.9.2. + * @see HtmlHelper::link() + * @param string $title The content of the "a" tag. + * @param string $url + * @param array $htmlAttributes Array of HTML attributes. + * @param string $confirmMessage Confirmation message. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function linkTo($title, $url, $htmlAttributes = null, $confirmMessage = false, $return = false) + { + return $this->link($title, $url, $htmlAttributes, $confirmMessage, $return); + } + + /** + * @deprecated Name changed to '_parseAttributes'. Version 0.9.2. + * @see HtmlHelper::_parseAttributes() + * @param array $options Array of options. + * @param array $exclude Array of options to be excluded. + * @param string $insertBefore String to be inserted before options. + * @param string $insertAfter String to be inserted ater options. + * @return string + */ + //function parseHtmlOptions($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) + // { + // $this->_parseAttributes($options, $exclude, $insertBefore, $insertAfter); + // } + function parseHtmlOptions($options, $exclude=null, $insert_before=' ', $insert_after=null) { if (!is_array($exclude)) $exclude = array(); @@ -124,565 +943,430 @@ class HtmlHelper return $options? $insert_before.$options.$insert_after: null; } } + + /** + * @deprecated Name changed to 'password'. Version 0.9.2. + * @see HtmlHelper::password() + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function passwordTag($fieldName, $size = 20, $htmlAttributes = null, $return = false) + { + $args = func_get_args(); + return call_user_func_array(array(&$this, "password"), $args); + } -/** - * Returns an HTML link to $url for given $title, optionally using $html_options and $confirm_message (for "flash"). - * - * @param string $title The content of the A tag. - * @param string $url - * @param array $html_options Array of HTML options. - * @param string $confirm_message Message to be shown in "flash". - * @return string - */ - function linkTo($title, $url, $html_options=null, $confirm_message=false) - { - $confirm_message? $html_options['onClick'] = "return confirm('{$confirm_message}')": null; - return sprintf(TAG_LINK, $this->urlFor($url), $this->parseHtmlOptions($html_options), $title); - } + /** + * @deprecated Name changed to 'radio'. Version 0.9.2. + * @see HtmlHelper::radio() + * @param string $fieldName If field is to be used for CRUD, this + * should be modelName/fieldName. + * @param array $options + * @param array $inbetween + * @param array $htmlAttributes Array of HTML attributes. + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. + */ + function radioTags($fieldName, $options, $inbetween = null, $htmlAttributes = null, + $return = false) + { + return $this->radio($fieldName, $options, $inbetween, $htmlAttributes, $return); + } -/** - * Returns an external HTML link to $url for given $title, optionally using $html_options. - * The ereg_replace is to replace the '&' in the URL into & for XHTML purity. - * - * @param string $title - * @param string $url - * @param array $html_options - * @return string - */ - function linkOut($title, $url=null, $html_options=null) - { - $url = $url? $url: $title; - return sprintf(TAG_LINK, ereg_replace('&([^a])', '&\1', $url), $this->parseHtmlOptions($html_options), $title); - } + /** + * Returns a SELECT element, + * + * @param string $fieldName Name attribute of the SELECT + * @param array $option_elements Array of the OPTION elements (as 'value'=>'Text' pairs) to be used in the SELECT element + * @param array $select_attr Array of HTML options for the opening SELECT element + * @param array $optionAttr Array of HTML options for the enclosed OPTION elements + * @return string Formatted SELECT element + */ + function selectTag($fieldName, $option_elements, $selected=null, $select_attr=null, $optionAttr=null) + { + $this->setFormTag($fieldName); + if (!is_array($option_elements) || !count($option_elements)) + return null; -/** - * Returns an HTML FORM element. - * - * @param string $target URL for the FORM's ACTION attribute. - * @param string $type FORM type (POST/GET). - * @param array $html_options - * @return string An formatted opening FORM tag. - */ - function formTag($target=null, $type='post', $html_options=null) - { - $html_options['action'] = $this->UrlFor($target); - $html_options['method'] = $type=='get'? 'get': 'post'; - $type == 'file'? $html_options['enctype'] = 'multipart/form-data': null; + $select[] = sprintf($this->tags['selectstart'], $this->model, $this->field, $this->parseHtmlOptions($select_attr)); + $select[] = sprintf($this->tags['selectempty'], $this->parseHtmlOptions($optionAttr)); - return sprintf(TAG_FORM, $this->parseHtmlOptions($html_options, null, '')); - } + foreach ($option_elements as $name=>$title) + { + $options_here = $optionAttr; -/** - * Returns a generic HTML tag (no content). - * - * Examples: - * * tag("br") =>
    - * * tag("input", array("type" => "text")) => - * - * @param string $name Name of HTML element - * @param array $options HTML options - * @param bool $open Is the tag open or closed? (defaults to closed "/>") - * @return string The formatted HTML tag - */ - function tag($name, $options=null, $open=false) - { - $tag = "<$name ". $this->parseHtmlOptions($options); - $tag .= $open? ">" : " />"; - return $tag; - } + if ($selected == $name) + $options_here['selected'] = 'selected'; -/** - * Returns a generic HTML tag with content. - * - * Examples: - * - * content_tag("p", "Hello world!") =>

    Hello world!

    - * content_tag("div", content_tag("p", "Hello world!"), array("class" => "strong")) =>

    Hello world!

    - *
    - * - * @param string $name Name of HTML element - * @param array $options HTML options - * @param bool $open Is the tag open or closed? (defaults to closed "/>") - * @return string The formatted HTML tag - */ - function contentTag($name, $content, $options=null) - { - return "<$name ". $this->parseHtmlOptions($options). ">$content"; - } + $select[] = sprintf($this->tags['selectoption'], $name, $this->parseHtmlOptions($options_here), $title); + } -/** - * Returns a formatted SUBMIT button for HTML FORMs. - * - * @param string $caption Text on SUBMIT button - * @param array $html_options HTML options - * @return string The formatted SUBMIT button - */ - function submitTag($caption='Submit', $html_options=null) - { - $html_options['value'] = $caption; - return sprintf(TAG_SUBMIT, $this->parseHtmlOptions($html_options, null, '', ' ')); - } + $select[] = sprintf($this->tags['selectend']); -/** - * Returns a formatted INPUT tag for HTML FORMs. - * - * @param string $tagName If field is to be used for CRUD, this should be modelName/fieldName - * @param int $size Size attribute for INPUT element - * @param array $htmlOptions - * @return string The formatted INPUT element - */ - function inputTag($tagName, $size=20, $htmlOptions=null) - { - $this->setFormTag($tagName); - $htmlOptions['value'] = isset($htmlOptions['value'])? $htmlOptions['value']: $this->tagValue($tagName); - $this->tagIsInvalid($this->model,$this->field)? $htmlOptions['class'] = 'form_error': null; - return sprintf(TAG_INPUT, $this->model, $this->field, $this->parseHtmlOptions($htmlOptions, null, '', ' ')); - } + return implode("\n", $select); + } -/** - * Returns an INPUT element with type="password". - * - * @param string $tagName - * @param int $size - * @param array $html_options - * @return string - */ - function passwordTag($tagName, $size=20, $html_options=null) - { - $this->setFormTag($tagName); - $html_options['size'] = $size; - empty($html_options['value'])? $html_options['value'] = $this->tagValue($tagName): null; - return sprintf(TAG_PASSWORD, $this->model, $this->field, $this->parseHtmlOptions($html_options, null, '', ' ')); - } -/** - * Returns an INPUT element with type="hidden". - * - * @param string $tagName - * @param string $value - * @param array $html_options - * @return string - */ - function hiddenTag($tagName, $value=null, $html_options=null) - { - $this->setFormTag($tagName); - $html_options['value'] = $value? $value: $this->tagValue($tagName); - return sprintf(TAG_HIDDEN, $this->model, $this->field, $this->parseHtmlOptions($html_options, null, '', ' ')); - } + /** + * @deprecated Name changed to 'url'. Version 0.9.2. + * @see HtmlHelper::url() + */ + function urlFor($url) + { + return $this->url($url); + } -/** - * Returns an INPUT element with type="file". - * - * @param string $tagName - * @param array $html_options - * @return string - */ - function fileTag($tagName, $html_options=null) - { - return sprintf(TAG_FILE, $tagName, $this->parseHtmlOptions($html_options, null, '', ' ')); - } -/** - * Returns a TEXTAREA element. - * - * @param string $tagName - * @param int $cols - * @param int $rows - * @param array $html_options - * @return string - */ - function areaTag($tagName, $cols=60, $rows=10, $html_options=null) - { - $this->setFormTag($tagName); - $value = empty($html_options['value'])? $this->tagValue($tagName): empty($html_options['value']); - $html_options['cols'] = $cols; - $html_options['rows'] = $rows; - $this->tagIsInvalid($this->model,$this->field)? $html_options['class'] = 'form_error': null; - return sprintf(TAG_AREA, $this->model,$this->field, $this->parseHtmlOptions($html_options, null, ' '), $value); - } -/** - * Returns an INPUT element with type="checkbox". Checkedness is to be passed as string "checked" with the key "checked" in the $html_options array. - * - * @param string $tagName - * @param string $title - * @param array $html_options - * @return string - */ - function checkboxTag($tagName, $title=null, $html_options=null) - { - $this->setFormTag($tagName); - $this->tagValue($tagName)? $html_options['checked'] = 'checked': null; - $title = $title? $title: ucfirst($tagName); - return sprintf(TAG_CHECKBOX, $this->model, $this->field, $this->field, $this->field, $this->parseHtmlOptions($html_options, null, '', ' '), $title); - } -/** - * Returns a set of radio buttons. - * - * @param string $tagName - * @param array $options Array of options to select from - * @param string $inbetween String to separate options. See PHP's implode() function - * @param array $html_options - * @return string - */ - function radioTags($tagName, $options, $inbetween=null, $html_options=null) - { - $this->setFormTag($tagName); - $value = isset($html_options['value'])? $html_options['value']: $this->tagValue($tagName); - $out = array(); - foreach ($options as $opt_value=>$opt_title) - { - $options_here = array('value' => $opt_value); - $opt_value==$value? $options_here['checked'] = 'checked': null; - $parsed_options = $this->parseHtmlOptions(array_merge($html_options, $options_here), null, '', ' '); - $individual_tag_name = "{$this->field}_{$opt_value}"; - $out[] = sprintf(TAG_RADIOS, $individual_tag_name, $this->model, $this->field, $individual_tag_name, $parsed_options, $opt_title); - } - $out = join($inbetween, $out); - return $out? $out: null; - } + /** + * @deprecated Name changed to 'submit'. Version 0.9.2. + * @see HtmlHelper::submit() + */ + function submitTag() + { + $args = func_get_args(); + return call_user_func_array(array(&$this, "submit"), $args); + } -/** - * Returns a SELECT element, - * - * @param string $tagName Name attribute of the SELECT - * @param array $option_elements Array of the OPTION elements (as 'value'=>'Text' pairs) to be used in the SELECT element - * @param array $select_attr Array of HTML options for the opening SELECT element - * @param array $option_attr Array of HTML options for the enclosed OPTION elements - * @return string Formatted SELECT element - */ - function selectTag($tagName, $option_elements, $selected=null, $select_attr=null, $option_attr=null) - { - $this->setFormTag($tagName); - if (!is_array($option_elements) || !count($option_elements)) - return null; + /************************************************************************* + * Moved methods + *************************************************************************/ - $select[] = sprintf(TAG_SELECT_START, $this->model, $this->field, $this->parseHtmlOptions($select_attr)); - $select[] = sprintf(TAG_SELECT_EMPTY, $this->parseHtmlOptions($option_attr)); + /** + * @deprecated Moved to TextHelper. Version 0.9.2. + */ + function trim() + { + die("Method HtmlHelper::trim() was moved to TextHelper::trim()."); + } - foreach ($option_elements as $name=>$title) - { - $options_here = $option_attr; + /** + * @deprecated Moved to JavascriptHelper. Version 0.9.2. + */ + function javascriptIncludeTag($url) + { + die("Method HtmlHelper::javascriptIncludeTag() was moved to JavascriptHelper::link()."); + } - if ($selected == $name) - $options_here['selected'] = 'selected'; + /** + * @deprecated Moved to JavascriptHelper. Version 0.9.2. + */ + function javascriptTag($script) + { + die("Method HtmlHelper::javascriptTag() was moved to JavascriptHelper::codeBlock()."); + } - $select[] = sprintf(TAG_SELECT_OPTION, $name, $this->parseHtmlOptions($options_here), $title); - } + /************************************************************************* + * Deprecated methods + *************************************************************************/ - $select[] = sprintf(TAG_SELECT_END); + /** + * Returns an HTML FORM element. + * + * @param string $target URL for the FORM's ACTION attribute. + * @param string $type FORM type (POST/GET). + * @param array $htmlAttributes + * @return string An formatted opening FORM tag. + * @deprecated This is very WYSIWYG unfriendly, use HtmlHelper::url() to get + * contents of "action" attribute. Version 0.9.2. + */ + function formTag($target=null, $type='post', $htmlAttributes=null) + { + $htmlAttributes['action'] = $this->UrlFor($target); + $htmlAttributes['method'] = $type=='get'? 'get': 'post'; + $type == 'file'? $htmlAttributes['enctype'] = 'multipart/form-data': null; - return implode("\n", $select); - } + return sprintf($this->tags['form'], $this->parseHtmlOptions($htmlAttributes, null, '')); + } -/** - * Returns a formatted IMG element. - * - * @param string $path Path to the image file - * @param string $alt ALT attribute for the IMG tag - * @param array $html_options - * @return string Formatted IMG tag - */ - function imageTag($path, $alt=null, $html_options=null) - { - $url = $this->base.IMAGES_URL.$path; - return sprintf(TAG_IMAGE, $url, $alt, $this->parseHtmlOptions($html_options, null, '', ' ')); - } + /** + * Generates a nested unordered list tree from an array. + * + * @param array $data + * @param array $htmlAttributes + * @param string $bodyKey + * @param string $childrenKey + * @param boolean $return Wheter this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return mixed Either string or boolean value, depends on AUTO_OUTPUT + * and $return. If $this->_crumbs is empty, return null. + * @deprecated This seems useless. Version 0.9.2. + */ + function guiListTree($data, $htmlAttributes = null, $bodyKey = 'body', $childrenKey='children', $return = false) + { + $out = "_parseAttributes($htmlAttributes).">\n"; -/** - * Returns a mailto: link. - * - * @param string $title Title of the link, or the e-mail address (if the same) - * @param string $email E-mail address if different from title - * @param array $options - * @return string Formatted A tag - */ - function linkEmail($title, $email=null, $options=null) - { - // if no $email, then title contains the email. - if (empty($email)) $email = $title; - - $match = array(); - - // does the address contain extra attributes? - preg_match('!^(.*)(\?.*)$!', $email, $match); - - // plaintext - if (empty($options['encode']) || !empty($match[2])) - { - return sprintf(TAG_MAILTO, $email, $this->parseHtmlOptions($options), $title); - } - // encoded to avoid spiders - else - { - $email_encoded = null; - for ($ii=0; $ii < strlen($email); $ii++) - { - if(preg_match('!\w!',$email[$ii])) + foreach ($data as $item) + { + $out .= "
  • {$item[$bodyKey]}
  • \n"; + if (isset($item[$childrenKey]) && is_array($item[$childrenKey]) && count($item[$childrenKey])) { - $email_encoded .= '%' . bin2hex($email[$ii]); + $out .= $this->guiListTree($item[$childrenKey], $htmlAttributes, $bodyKey, $childrenKey); } - else + } + + $out .= "\n"; + + return $this->output($out, $return); + } + + /** + * Returns a mailto: link. + * + * @param string $title Title of the link, or the e-mail address + * (if the same). + * @param string $email E-mail address if different from title. + * @param array $options + * @return string Formatted A tag + * @deprecated This should be done using a content filter. Version 0.9.2. + */ + function linkEmail($title, $email=null, $options=null) + { + // if no $email, then title contains the email. + if (empty($email)) $email = $title; + + $match = array(); + + // does the address contain extra attributes? + preg_match('!^(.*)(\?.*)$!', $email, $match); + + // plaintext + if (empty($options['encode']) || !empty($match[2])) + { + return sprintf(TAG_MAILTO, $email, $this->parseHtmlOptions($options), $title); + } + // encoded to avoid spiders + else + { + $email_encoded = null; + for ($ii=0; $ii < strlen($email); $ii++) { - $email_encoded .= $email[$ii]; + if(preg_match('!\w!',$email[$ii])) + { + $email_encoded .= '%' . bin2hex($email[$ii]); + } + else + { + $email_encoded .= $email[$ii]; + } } - } - $title_encoded = null; - for ($ii=0; $ii < strlen($title); $ii++) - { - $title_encoded .= preg_match('/^[A-Za-z0-9]$/', $title[$ii])? '&#x' . bin2hex($title[$ii]).';': $title[$ii]; - } + $title_encoded = null; + for ($ii=0; $ii < strlen($title); $ii++) + { + $title_encoded .= preg_match('/^[A-Za-z0-9]$/', $title[$ii])? '&#x' . bin2hex($title[$ii]).';': $title[$ii]; + } - return sprintf(TAG_MAILTO, $email_encoded, $this->parseHtmlOptions($options, array('encode')), $title_encoded); - } - } + return sprintf(TAG_MAILTO, $email_encoded, $this->parseHtmlOptions($options, array('encode')), $title_encoded); + } + } -/** - * Returns a LINK element for CSS stylesheets. - * - * @param string $path Path to CSS file - * @param string $rel Rel attribute. Defaults to "stylesheet". - * @param array $html_options - * @return string Formatted LINK element. - */ - function cssTag($path, $rel='stylesheet', $html_options=null) - { - $url = "{$this->base}/".(COMPRESS_CSS? 'c': '')."css/{$path}.css"; - return sprintf(TAG_CSS, $rel, $url, $this->parseHtmlOptions($html_options, null, '', ' ')); - } + /** + * Returns a generic HTML tag (no content). + * + * Examples: + * + tag("br") =>
    + * + tag("input", array("type" => "text")) => + * + * @param string $name Name of HTML element + * @param array $options HTML options + * @param bool $open Is the tag open or closed? (defaults to closed "/>") + * @return string The formatted HTML tag + * @deprecated This seems useless. Version 0.9.2. + */ + function tag($name, $options=null, $open=false) + { + $tag = "<$name ". $this->parseHtmlOptions($options); + $tag .= $open? ">" : " />"; + return $tag; + } -/** - * Returns a charset meta-tag - * - * @param string $charset - * @return string - */ - function charsetTag($charset) - { - return sprintf(TAG_CHARSET, $charset); - } + /** + * Returns a generic HTML tag with content. + * + * Examples: + * + * content_tag("p", "Hello world!") =>

    Hello world!

    + * content_tag("div", content_tag("p", "Hello world!"), + * array("class" => "strong")) =>

    Hello world!

    + *
    + * + * @param string $name Name of HTML element + * @param array $options HTML options + * @param bool $open Is the tag open or closed? (defaults to closed "/>") + * @return string The formatted HTML tag + * @deprecated This seems useless. Version 0.9.2. + */ + function contentTag($name, $content, $options=null) + { + return "<$name ". $this->parseHtmlOptions($options). ">$content"; + } + + function dayOptionTag( $tagName, $value=null, $selected=null, $optionAttr=null) + { + $value = isset($value)? $value : $this->tagValue($tagName); + $dayValue = empty($value) ? date('d') : date('d',strtotime( $value ) ); + $days=array('1'=>'1','2'=>'2','3'=>'3','4'=>'4', + '5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9', + '10'=>'10','11'=>'11','12'=>'12', + '13'=>'13','14'=>'14','15'=>'15', + '16'=>'16','17'=>'17','18'=>'18', + '19'=>'19','20'=>'20','21'=>'21', + '22'=>'22','23'=>'23','24'=>'24', + '25'=>'25','26'=>'26','27'=>'27', + '28'=>'28','29'=>'29','30'=>'30','31'=>'31'); + $option = $this->selectTag($tagName.'_day', $days, $dayValue, + $optionAttr); + return $option; + } -/** - * Returns a JavaScript script tag. - * - * @param string $script The JavaScript to be wrapped in SCRIPT tags. - * @return string The full SCRIPT element, with the JavaScript inside it. - */ - function javascriptTag($script) - { - return sprintf(TAG_JAVASCRIPT, $script); - } + function yearOptionTag( $tagName, $value=null, $minYear=null, $maxYear=null, $selected=null, $optionAttr=null) + { + $value = isset($value)? $value : $this->tagValue($tagName); -/** - * Returns a JavaScript include tag - * - * @param string $url URL to JavaScript file. - * @return string - */ - function javascriptIncludeTag($url) - { - return sprintf(TAG_JAVASCRIPT_INCLUDE, $this->base.$url); - } + $yearValue = empty($value) ? date('Y') : date('Y',strtotime( $value ) ); -/** - * Returns a row of formatted and named TABLE headers. - * - * @param array $names - * @param array $tr_options - * @param array $th_options - * @return string - */ - function tableHeaders($names, $tr_options=null, $th_options=null) - { - $out = array(); - foreach ($names as $arg) - { - $out[] = sprintf(TAG_TABLE_HEADER, $this->parseHtmlOptions($th_options), $arg); - } + $maxYear = is_null($maxYear) ? $yearValue + 10 : $maxYear; - return sprintf(TAG_TABLE_HEADERS, $this->parseHtmlOptions($tr_options), join(' ', $out)); - } + $minYear = is_null($minYear) ? $yearValue - 10 : $minYear; -/** - * Returns a formatted string of table rows (TR's with TD's in them). - * - * @param array $data Array of table data - * @param array $tr_options HTML options for TR elements - * @param array $td_options HTML options for TD elements - * @return string - */ - function tableCells($data, $odd_tr_options=null, $even_tr_options=null) - { - if (empty($data[0]) || !is_array($data[0])) - { - $data = array($data); - } + if ( $minYear>$minYear) + { + $tmpYear = $minYear; + $minYear = $maxYear; + $maxYear = $tmpYear; + }; + $minYear = $yearValue < $minYear ? $yearValue : $minYear; + $maxYear = $yearValue > $maxYear ? $yearValue : $maxYear; - $count=0; - foreach ($data as $line) - { - $count++; - $cells_out = array(); - foreach ($line as $cell) - { - $cells_out[] = sprintf(TAG_TABLE_CELL, null, $cell); - } + for ( $yearCounter=$minYear; $yearCounter<$maxYear; $yearCounter++) + { + $years[$yearCounter]=$yearCounter; + } - $options = $this->parseHtmlOptions($count%2? $odd_tr_options: $even_tr_options); - $out[] = sprintf(TAG_TABLE_ROW, $options, join(' ', $cells_out)); - } + $option = $this->selectTag($tagName.'_year', $years, $yearValue, + $optionAttr); + return $option; + } - return join("\n", $out); - } + function monthOptionTag( $tagName, $value=null, $selected=null, $optionAttr=null) + { + $value = isset($value)? $value : $this->tagValue($tagName); + $monthValue = empty($value) ? date('m') : date('m',strtotime( $value ) ); + $months=array('1'=>'January','2'=>'February','3'=>'March', + '4'=>'April','5'=>'May','6'=>'June','7'=>'July','8'=>'August', + '9'=>'September','10'=>'October','11'=>'November','12'=>'December'); + $option = $this->selectTag($tagName.'_month', $months, $monthValue, + $optionAttr); + return $option; + } -/** - * Generates a nested unordered list tree from an array. - * - * @param array $data - * @param array $htmlOptions - * @param string $bodyKey - * @param childrenKey $bodyKey - * @return string - */ - function guiListTree($data, $htmlOptions=null, $bodyKey='body', $childrenKey='children') - { - $out = "parseHtmlOptions($htmlOptions).">\n"; + function hourOptionTag( $tagName,$value=null, + $format24Hours = false, + $selected=null, + $optionAttr=null ) + { + $value = isset($value)? $value : $this->tagValue($tagName); + if ( $format24Hours ) + { + $hourValue = empty($value) ? date('H') : date('H',strtotime( $value ) ); + } + else + { + $hourValue = empty($value) ? date('g') : date('g',strtotime( $value ) ); + } + if ( $format24Hours ) + { $hours = array('0'=>'00','1'=>'01','2'=>'02','3'=>'03','4'=>'04', + '5'=>'05','6'=>'06','7'=>'07','8'=>'08','9'=>'09', + '10'=>'10','11'=>'11','12'=>'12', + '13'=>'13','14'=>'14','15'=>'15', + '16'=>'16','17'=>'17','18'=>'18', + '19'=>'19','20'=>'20','21'=>'21', + '22'=>'22','23'=>'23'); + } + else + { + $hours = array('1'=>'1','2'=>'2','3'=>'3','4'=>'4', + '5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9', + '10'=>'10','11'=>'11','12'=>'12'); + } - foreach ($data as $item) - { - $out .= "
  • {$item[$bodyKey]}
  • \n"; - if (isset($item[$childrenKey]) && is_array($item[$childrenKey]) && count($item[$childrenKey])) - { - $out .= $this->guiListTree($item[$childrenKey], $htmlOptions, $bodyKey, $childrenKey); - } - } + $option = $this->selectTag($tagName.'_hour', $hours, $hourValue, + $optionAttr); + return $option; + } - $out .= "\n"; + function minuteOptionTag( $tagName, $value=null, $selected=null, $optionAttr=null) + { + $value = isset($value)? $value : $this->tagValue($tagName); + $minValue = empty($value) ? date('i') : date('i',strtotime( $value ) ); + for( $minCount=0; $minCount<61; $minCount++) + { + $mins[$minCount] = sprintf('%02d', $minCount); + } - return $out; - } + $option = $this->selectTag($tagName.'_min', $mins, $minValue, + $optionAttr); + return $option; + } -/** - * Adds $name and $link to the breadcrumbs array. - * - * @param string $name Text for link - * @param string $link URL for link - */ - function addCrumb($name, $link) - { - $this->_crumbs[] = array ($name, $link); - } + function meridianOptionTag( $tagName, $value=null, $selected=null, $optionAttr=null) + { + $value = isset($value)? $value : $this->tagValue($tagName); + $merValue = empty($value) ? date('a') : date('a',strtotime( $value ) ); + $meridians = array('am'=>'am','pm'=>'pm'); -/** - * Returns the breadcrumb trail as a sequence of »-separated links. - * - * @param string $separator Text to separate crumbs. - * @return string Formatted -separated list of breadcrumb links. Returns NULL if $this->_crumbs is empty. - */ - function getCrumbs($separator = '»') - { + $option = $this->selectTag($tagName.'_meridian', $meridians, $merValue, + $optionAttr); + return $option; + } + + function dateTimeOptionTag( $tagName, $dateFormat = 'DMY', $timeFormat = '12',$selected=null, $optionAttr=null) + { + switch ( $dateFormat ) + { + case 'DMY' : + $opt = $this->dayOptionTag( $tagName ) . '-' . $this->monthOptionTag( $tagName ) . '-' . $this->yearOptionTag( $tagName ); + break; + case 'MDY' : + $opt = $this->monthOptionTag( $tagName ) .'-'.$this->dayOptionTag( $tagName ) . '-' . $this->yearOptionTag($tagName); + break; + case 'YMD' : + $opt = $this->yearOptionTag($tagName) . '-' . $this->monthOptionTag( $tagName ) . '-' . $this->dayOptionTag( $tagName ); + break; + case 'NONE': + $opt =''; + break; + default: + $opt = ''; + break; + } + switch ($timeFormat) + { + case '24': + $opt .= $this->hourOptionTag( $tagName, true ) . ':' . $this->minuteOptionTag( $tagName ); + break; + case '12': + $opt .= $this->hourOptionTag( $tagName ) . ':' . $this->minuteOptionTag( $tagName ) . ' ' . $this->meridianOptionTag($tagName); + break; + case 'NONE': + $opt .=''; + break; + default : - if (count($this->_crumbs)) - { - - $out = array("base}\">START"); - foreach ($this->_crumbs as $crumb) - { - $out[] = "base}{$crumb[1]}\">{$crumb[0]}"; - } - - return join($separator, $out); - } - else - { - return null; - } - } - -/** - * Returns value of $tagName. False is the tag does not exist. - * - * @param string $tagName - * @return unknown Value of the named tag. - */ - function tagValue ($tagName) - { - $this->setFormTag($tagName); - return isset($this->params['data'][$this->model][$this->field])? $this->params['data'][$this->model][$this->field]: false; - } - -/** - * Returns false if given FORM field has no errors. Otherwise it returns the constant set in the array Model->validationErrors. - * - * @param unknown_type $field - * @return unknown - */ - function tagIsInvalid ($model, $field) - { - return empty($this->validationErrors[$model][$field])? 0: $this->validationErrors[$model][$field]; - } - -/** - * Returns number of errors in a submitted FORM. - * - * @return int Number of errors - */ - function validate () - { - $args = func_get_args(); - $errors = call_user_func_array(array(&$this, 'validateErrors'), $args); - - return count($errors); - } - -/** - * Validates a FORM according to the rules set up in the Model. - * - * @return int Number of errors - */ - function validateErrors () - { - $objects = func_get_args(); - if (!count($objects)) return false; - - $errors = array(); - foreach ($objects as $object) - { - $errors = array_merge($errors, $object->invalidFields($object->data)); - } - - return $this->validationErrors = (count($errors)? $errors: false); - } - -/** - * Returns a formatted error message for given FORM field, NULL if no errors. - * - * @param string $field If field is to be used for CRUD, this should be modelName/fieldName - * @param string $text - * @return string If there are errors this method returns an error message, else NULL. - */ - function tagErrorMsg ($field, $text) - { - $error = 1; - $this->setFormTag($field); - - if ($error == $this->tagIsInvalid($this->model, $this->field)) - { - return sprintf(SHORT_ERROR_MESSAGE, is_array($text)? (empty($text[$error-1])? 'Error in field': $text[$error-1]): $text); - } - else - { - return null; - } - } - - function setFormTag($tagValue) - { - return list($this->model, $this->field) = explode("/", $tagValue); - } + break; + } + return $opt; + } } ?> \ No newline at end of file diff --git a/libs/helpers/javascript.php b/libs/helpers/javascript.php new file mode 100644 index 000000000..cbb2d939c --- /dev/null +++ b/libs/helpers/javascript.php @@ -0,0 +1,66 @@ + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.helpers + * @since CakePHP v 0.9.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Javascript Helper class for easy use of javascript. + * + * JavascriptHelper encloses all methods needed while working with javascripts. + * + * @package cake + * @subpackage cake.libs.helpers + * @since CakePHP v 0.9.2 + */ +class JavascriptHelper extends Helper +{ + /** + * Returns a JavaScript script tag. + * + * @param string $script The JavaScript to be wrapped in SCRIPT tags. + * @return string The full SCRIPT element, with the JavaScript inside it. + */ + function codeBlock($script) + { + return sprintf(TAG_JAVASCRIPT, $script); + } + + /** + * Returns a JavaScript include tag + * + * @param string $url URL to JavaScript file. + * @return string + */ + function link($url) + { + return sprintf(TAG_JAVASCRIPT_INCLUDE, $this->base.$url); + } +} + +?> \ No newline at end of file diff --git a/libs/helpers/number.php b/libs/helpers/number.php new file mode 100644 index 000000000..9e49e5fe7 --- /dev/null +++ b/libs/helpers/number.php @@ -0,0 +1,90 @@ + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Authors/Developers + * @author Christian Gillen aka kodos + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.helpers + * @since CakePHP v 0.9.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + + +/** + * Number helper library. + * + * @package cake + * @subpackage cake.libs.helpers + * @since CakePHP v 0.9.2 + * + */ +class NumberHelper extends Helper +{ + /** + * Formats a number with a level of precision. + * + * @param float $number A floating point number. + * @param integer $precision The precision of the returned number. + * @return float Enter description here... + */ + function precision($number, $precision = 3) + { + return sprintf("%01.{$precision}f", $number); + } + + /** + * Returns a formatted-for-humans file size. + * + * @param integer $length Size in bytes + * @return string Human readable size + */ + function toReadableSize($size) + { + switch ($size) + { + case 1: return '1 Byte'; + case $size < 1024: return $size . ' Bytes'; + case $size < 1024 * 1024: return $this->precision($size / 1024, 0) . ' KB'; + case $size < 1024 * 1024 * 1024: return $this->precision($size / 1024 / 1024, 2) . ' MB'; + case $size < 1024 * 1024 * 1024 * 1024: return $this->precision($size / 1024 / 1024 / 1024, 2) . ' GB'; + case $size < 1024 * 1024 * 1024 * 1024 * 1024: return $this->precision($size / 1024 / 1024 / 1024 / 1024, 2) . ' TB'; + } + } + + /** + * Formats a number into a percentage string. + * + * @param float $number A floating point number + * @param integer $precision The precision of the returned number + * @return string Percentage string + */ + function toPercentage($number, $precision = 2) + { + return $this->precision($number, $precision) . '%'; + } +} + +?> \ No newline at end of file diff --git a/libs/helpers/text.php b/libs/helpers/text.php new file mode 100644 index 000000000..fee5177c3 --- /dev/null +++ b/libs/helpers/text.php @@ -0,0 +1,240 @@ + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Authors/Developers + * @author Christian Gillen aka kodos + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs.helpers + * @since CakePHP v 0.9.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Enter description here... + */ +uses('flay', 'helpers/html'); + +/** + * Text helper library. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs.helpers + * @since CakePHP v 0.9.2 + * + */ +class TextHelper extends Helper +{ + /** + * Highlights a given phrase in a text + * + * @param string $text Text to search the phrase in + * @param string $phrase The phrase that will be searched + * @param string $highlighter The piece of html with that the phrase will be highlighted + * @return string The highlighted text + */ + function highlight($text, $phrase, $highlighter = '\1') + { + if (empty($phrase)) return $text; + if (is_array($phrase)) + { + $replace = array(); + $with = array(); + foreach ($phrase as $key => $value) + { + if (empty($key)) + { + $key = $value; + $value = $highlighter; + } + $replace[] = '|(' . $key . ')|'; + $with[] = empty($value) ? $highlighter : $value; + } + return preg_replace($replace, $with, $text); + } + else + { + return preg_replace("|({$phrase})|i", $highlighter, $text); + } + } + + /** + * Strips all links((.*)<\/a>|im', '\1', $text); + } + + /** + * Adds links( $value) + { + $options .= "'$option' => '$value', "; + } + $options .= ')'; + + $text = preg_replace_callback( + '#((?:http|https|ftp|nntp)://[^ ]+)#', + create_function( + '$matches', + '$Html = new HtmlHelper(); return $Html->linkOut($matches[0], $matches[0],' . $options . ');' + ), + $text + ); + return preg_replace_callback( + '#(?linkOut($matches[0], "http://" . $matches[0],' . $options . ');' + ), + $text + ); + } + + /** + * Adds email links( '$value', "; + } + $options .= ')'; + + return preg_replace_callback( + '#([_A-Za-z0-9+-+]+(?:\.[_A-Za-z0-9+-]+)*@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*)#', + create_function( + '$matches', + '$Html = new HtmlHelper(); return $Html->linkEmail($matches[0], $matches[0],' . $options . ');' + ), + $text + ); + } + + /** + * Convert all links and email adresses to Html links. + * + * @param string $text Text + * @param array $htmlOptions Array of HTML options. + * @return string The text with links + */ + function autoLink($text, $htmlOptions = array()) + { + return $this->autoLinkEmails($this->autoLinkUrls($text, $htmlOptions), $htmlOptions); + } + + /** + * Truncates text. + * + * Cuts a string to the length of $length and replaces the last characters + * with the ending if the text is longer than length. + * + * @param string $text String to truncate. + * @param integer $length Length of returned string, including ellipsis. + * @param string $ending Ending to be appended to the trimmed string. + * @return string Trimmed string. + */ + function truncate($text, $length, $ending='...') + { + if (strlen($text) <= $length) + return $text; + else + return substr($text, 0, $length - strlen($ending)) . $ending; + } + + + /** + * Alias for truncate(). + * + * @see TextHelper::truncate() + */ + function trim() + { + $args = func_get_args(); + return call_user_func_array(array(&$this, "truncate"), $args); + } + + /** + * Extracts an excerpt from the text surrounding the phrase with a number of characters on each side determined by radius. + * + * @param string $text String to search the phrase in + * @param string $phrase Phrase that will be searched for + * @param integer $radius The amount of characters that will be returned on each side of the founded phrase + * @param string $ending Ending that will be appended + * @return string Enter description here... + */ + function excerpt($text, $phrase, $radius = 100, $ending = "...") + { + if (empty($text) or empty($phrase)) return $this->truncate($text, $radius * 2, $ending); + if ($radius < strlen($phrase)) $radius = strlen($phrase); + + $pos = strpos($text, $phrase); + $startPos = $pos <= $radius ? 0 : $pos - $radius; + $endPos = $pos + strlen($phrase) + $radius >= strlen($text) ? strlen($text) : $pos + strlen($phrase) + $radius; + + $excerpt = substr($text, $startPos, $endPos - $startPos); + + if ($startPos != 0) $excerpt = substr_replace($excerpt, $ending, 0, strlen($phrase)); + if ($endPos != strlen($text)) $excerpt = substr_replace($excerpt, $ending, -strlen($phrase)); + + return $excerpt; + } + + /** + * Text-to-html parser, similar to Textile or RedCloth, only with a little different syntax. + * + * @param string $text String to "flay" + * @param boolean $allowHtml Set to true if if html is allowed + * @return string "Flayed" text + * @todo Change this. We need a real Textile parser. + */ + function flay($text, $allowHtml=false) + { + return Flay::toHtml($text, false, $allowHtml); + } + +} + +?> \ No newline at end of file diff --git a/libs/helpers/time.php b/libs/helpers/time.php new file mode 100644 index 000000000..48c5b2579 --- /dev/null +++ b/libs/helpers/time.php @@ -0,0 +1,422 @@ + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs.helpers + * @since CakePHP v 0.9.1 + * @version $Revision: 578 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2005-08-11 22:09:07 -0600 (Thu, 11 Aug 2005) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Html Helper class for easy use of html widgets. + * + * HtmlHelper encloses all methods needed while working with html pages. + * + * @package cake + * @subpackage cake.libs.helpers + * @since CakePHP v 0.9.2 + */ +class TimeHelper extends Helper +{ + /** + * Returns given string trimmed to given length, adding an ending (default: "..") if necessary. + * + * @param string $string String to trim + * @param integer $length Length of returned string, excluding ellipsis + * @param string $ending Ending to be appended after trimmed string + * @return string Trimmed string + */ + function trim($string, $length, $ending='..') + { + return substr($string, 0, $length).(strlen($string)>$length? $ending: null); + } + + + /** + * Returns a unix timestamp, given either a unix timestamp or a valid strtotime() date string. + * + * @param string $date_string Datetime string + * @return string Formatted date string + */ + function fromString ($date_string) { + return is_integer($date_string) + ? $date_string + : strtotime($date_string); + + } + + + /** + * Returns a nicely formatted date string for given Datetime string. + * + * @param string $date_string Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return string Formatted date string + */ + function nice ($date_string=null,$return = false) { + $date = $date_string? strtotime($date_string): time(); + $date = $date_string? $this->fromString($date_string): time(); + $ret = date("D, M jS Y, H:i", $date); + + return $this->output($ret, $return); + } + + + /** + * Returns a formatted descriptive date string for given datetime string. + * If the given date is today, the returned string could be "Today, 16:54". + * If the given date was yesterday, the returned string could be "Yesterday, 16:54". + * If $date_string's year is the current year, the returned string does not + * include mention of the year. + * + * @param string $date_string Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return string Described, relative date string + */ + function niceShort ($date_string=null,$return = false) + { + $date = $date_string? $this->fromString($date_string): time(); + + $y = $this->isThisYear($date)? '': ' Y'; + + if ($this->isToday($date)) + $ret = "Today, ".date("H:i", $date); + elseif ($this->wasYesterday($date)) + $ret = "Yesterday, ".date("H:i", $date); + else + $ret = date("M jS{$y}, H:i", $date); + + return $this->output($ret, $return); + } + + + /** + * Returns true if given datetime string is today. + * + * @param string $date_string Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return boolean True if datetime string is today + */ + function isToday ($date_string) + { + $date = $this->fromString($date_string, $return = false); + $ret = date('Y-m-d', $date) == date('Y-m-d', time()); + + return $this->output($ret, $return); + } + + + /** + * Returns a partial SQL string to search for all records between two dates. + * + * @param string $date_string Datetime string or Unix timestamp + * @param string $end Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return string Partial SQL string. + */ + function daysAsSql ($begin, $end, $field_name, $return = false) + { + $begin = $this->fromString($begin); + $end = $this->fromString($end); + $begin = date('Y-m-d', $begin).' 00:00:00'; + $end = date('Y-m-d', $end). ' 23:59:59'; + + $ret = "($field_name >= '$begin') AND ($field_name <= '$end')"; + + return $this->output($ret, $return); + } + + + /** + * Returns a partial SQL string to search for all records between two times + * occurring on the same day. + * + * @param string $date_string Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return string Partial SQL string. + */ + function dayAsSql ($date_string, $field_name, $return = false) + { + $date = $this->fromString($date_string); + $ret = $this->daysAsSql($date_string, $date_string, $field_name); + + return $this->output($ret, $return); + } + + + /** + * Returns true if given datetime string is within current year. + * + * @param string $date_string Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return boolean True if datetime string is within current year + */ + function isThisYear ($date_string, $return = false) { + $date = $this->fromString($date_string); + $ret = date('Y', $date) == date('Y', time()); + + return $this->output($ret, $return); + } + + + /** + * Returns true if given datetime string was yesterday. + * + * @param string $date_string Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return boolean True if datetime string was yesterday + */ + function wasYesterday ($date_string, $return = false) { + $date = $this->fromString($date_string); + $ret = date('Y-m-d', $date) == date('Y-m-d', strtotime('yesterday')); + + return $this->output($ret, $return); + } + + + /** + * Returns a Unix timestamp from a textual datetime description. Wrapper for PHP function strtotime(). + * + * @param string $date_string Datetime string to be represented as a Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return int Unix timestamp + */ + function toUnix ($date_string, $return = false) { + $ret = strtotime($date_string); + + return $this->output($ret, $return); + } + + /** + * Returns a date formatted for Atom RSS feeds. + * + * @param string $date_string Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return string Formatted date string + */ + function toAtom ($date_string, $return = false) { + $date = $this->fromString($date_string); + $ret = date('Y-m-d\TH:i:s\Z', $date); + + return $this->output($ret, $return); + } + + /** + * Formats date for RSS feeds + * + * @param string $date_string Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return string Formatted date string + */ + function toRSS ($date_string, $return = false) { + $date = TimeHelper::fromString($date_string); + $ret = date("r", $date); + + return $this->output($ret, $return); + } + + + /** + * Returns either a relative date or a formatted date depending + * on the difference between the current time and given datetime. + * $datetime should be in a strtotime-parsable format like MySQL datetime. + * + * Relative dates look something like this: + * 3 weeks, 4 days ago + * 15 seconds ago + * Formatted dates look like this: + * on 02/18/2004 + * + * The returned string includes 'ago' or 'on' and assumes you'll properly add a word + * like 'Posted ' before the function output. + * + * @param string $date_string Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return string Relative time string. + */ + function timeAgoInWords ($datetime_string, $return = false) + { + $datetime = $this->fromString($datetime_string); + + $in_seconds = $datetime; + $diff = time()-$in_seconds; + $months = floor($diff/2419200); + $diff -= $months*2419200; + $weeks = floor($diff/604800); + $diff -= $weeks*604800; + $days = floor($diff/86400); + $diff -= $days*86400; + $hours = floor($diff/3600); + $diff -= $hours*3600; + $minutes = floor($diff/60); + $diff -= $minutes*60; + $seconds = $diff; + + if ($months>0) { + // over a month old, just show date (mm/dd/yyyy format) + $ret = 'on '.date("j/n/Y", $in_seconds); + } else { + $relative_date=''; + if ($weeks>0) { + // weeks and days + $relative_date .= ($relative_date?', ':'').$weeks.' week'.($weeks>1?'s':''); + $relative_date .= $days>0?($relative_date?', ':'').$days.' day'.($days>1?'s':''):''; + } elseif ($days>0) { + // days and hours + $relative_date .= ($relative_date?', ':'').$days.' day'.($days>1?'s':''); + $relative_date .= $hours>0?($relative_date?', ':'').$hours.' hour'.($hours>1?'s':''):''; + } elseif ($hours>0) { + // hours and minutes + $relative_date .= ($relative_date?', ':'').$hours.' hour'.($hours>1?'s':''); + $relative_date .= $minutes>0?($relative_date?', ':'').$minutes.' minute'.($minutes>1?'s':''):''; + } elseif ($minutes>0) { + // minutes only + $relative_date .= ($relative_date?', ':'').$minutes.' minute'.($minutes>1?'s':''); + } else { + // seconds only + $relative_date .= ($relative_date?', ':'').$seconds.' second'.($seconds>1?'s':''); + } + } + // show relative date and add proper verbiage + $ret = $relative_date.' ago'; + + return $this->output($ret, $return); + } + + + /** + * Alias for timeAgoInWords + * @param string $date_string Datetime string or Unix timestamp + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return string Relative time string. + */ + function relativeTime ($datetime_string, $return = false) + { + $ret = $this->timeAgoInWords ($datetime_string); + + return $this->output($ret, $return); + } + + /** + * Returns true if specified datetime was within the interval specified, else false. + * + * @param mixed $timeInterval the numeric value with space then time + * type. Example of valid types: 6 hours, 2 days, 1 minute. + * @param mixed $date the datestring or unix timestamp to compare + * @param boolean $return Whether this method should return a value + * or output it. This overrides AUTO_OUTPUT. + * @return boolean + */ + function wasWithinLast($timeInterval, $date_string, $return = false) + { + $date = $this->fromString($date_string); + + $result = preg_split('/\\s/', $timeInterval); + + $numInterval = $result[0]; + $textInterval = $result[1]; + $currentTime = floor(time()); + $seconds = ($currentTime - floor($date)); + + switch($textInterval) { + + case "seconds": + case "second": + $timePeriod = $seconds; + $ret = $return; + break; + + case "minutes": + case "minute": + $minutes = floor($seconds / 60); + $timePeriod = $minutes; + break; + + + case "hours": + case "hour": + $hours = floor($seconds / 3600); + $timePeriod = $hours; + break; + + case "days": + case "day": + $days = floor($seconds / 86400); + $timePeriod = $days; + break; + + case "weeks": + case "week": + $weeks = floor($seconds / 604800); + $timePeriod = $weeks; + break; + + + case "months": + case "month": + $months = floor($seconds / 2629743.83); + $timePeriod = $months; + break; + + + case "years": + case "year": + $years = floor($seconds / 31556926); + $timePeriod = $years; + break; + + + default: + $days = floor($seconds / 86400); + $timePeriod = $days; + break; + } + + if ($timePeriod <= $numInterval) { + $ret = true; + } else { + $ret = false; + } + + return $this->output($ret, $return); + + } + + +} + +?> \ No newline at end of file diff --git a/libs/inflector.php b/libs/inflector.php index 71814e47e..18fa7be57 100644 --- a/libs/inflector.php +++ b/libs/inflector.php @@ -1,46 +1,46 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Inflector - * I'm trying to port RoR Inflector class here. - * Inflector pluralizes and singularizes English nouns. - * Test with $i = new Inflector(); $i->test(); - * - * @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.libs - * @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 file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** - * This is a port of Ruby on Rails' Inflector class. - * Inflector pluralizes and singularizes English nouns. - * Test with $i = new Inflector(); $i->test(); - * - * @package cake - * @subpackage cake.libs - * @since CakePHP v 0.2.9 - */ + * Short description for class + * + * Inflector pluralizes and singularizes English nouns. + * Test with $i = new Inflector(); $i->test(); + * + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + */ class Inflector extends Object { @@ -62,20 +62,28 @@ class Inflector extends Object function pluralize ($word) { $plural_rules = array( - '/(x|ch|ss|sh)$/' => '\1es', # search, switch, fix, box, process, address - '/series$/' => '\1series', - '/([^aeiouy]|qu)ies$/' => '\1y', - '/([^aeiouy]|qu)y$/' => '\1ies', # query, ability, agency - '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', # half, safe, wife - '/sis$/' => 'ses', # basis, diagnosis - '/([ti])um$/' => '\1a', # datum, medium - '/person$/' => 'people', # person, salesperson - '/man$/' => 'men', # man, woman, spokesman - '/child$/' => 'children', # child - '/s$/' => 's', # no change (compatibility) - '/$/' => 's' + '/^(ox)$/' => '\1\2en', # ox + '/([m|l])ouse$/' => '\1ice', # mouse, louse + '/(matr|vert|ind)ix|ex$/' => '\1ices', # matrix, vertex, index + '/(x|ch|ss|sh)$/' => '\1es', # search, switch, fix, box, process, address + '/([^aeiouy]|qu)ies$/' => '\1y', + '/([^aeiouy]|qu)y$/' => '\1ies', # query, ability, agency + '/(hive)$/' => '\1s', # archive, hive + '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', # half, safe, wife + '/sis$/' => 'ses', # basis, diagnosis + '/([ti])um$/' => '\1a', # datum, medium + '/(p)erson$/' => '\1eople', # person, salesperson + '/(m)an$/' => '\1en', # man, woman, spokesman + '/(c)hild$/' => '\1hildren', # child + '/(buffal|tomat)o$/' => '\1\2oes', # buffalo, tomato + '/(bu)s$/' => '\1\2ses', # bus + '/(alias)/' => '\1es', # alias + '/(octop|vir)us$/' => '\1i', # octopus, virus - virus has no defined plural (according to Latin/dictionary.com), but viri is better than viruses/viruss + '/(ax|cri|test)is$/' => '\1es', # axis, crisis + '/s$/' => 's', # no change (compatibility) + '/$/' => 's' ); - + foreach ($plural_rules as $rule => $replacement) { if (preg_match($rule, $word)) @@ -84,7 +92,7 @@ class Inflector extends Object } } - return false; + return $word;//false; } /** @@ -96,20 +104,33 @@ class Inflector extends Object function singularize ($word) { $singular_rules = array( - '/(x|ch|ss)es$/' => '\1', - '/movies$/' => 'movie', - '/series$/' => 'series', - '/([^aeiouy]|qu)ies$/' => '\1y', - '/([lr])ves$/' => '\1f', - '/([^f])ves$/' => '\1fe', - '/(analy|ba|diagno|parenthe|progno|synop|the)ses$/' => '\1sis', - '/([ti])a$/' => '\1um', - '/people$/' => 'person', - '/men$/' => 'man', - '/status$/' => 'status', - '/children$/' => 'child', - '/news$/' => 'news', - '/s$/' => '' + '/(matr)ices$/' =>'\1ix', + '/(vert|ind)ices$/' => '\1ex', + '/^(ox)en/' => '\1', + '/(alias)es$/' => '\1', + '/([octop|vir])i$/' => '\1us', + '/(cris|ax|test)es$/' => '\1is', + '/(shoe)s$/' => '\1', + '/(o)es$/' => '\1', + '/(bus)es$/' => '\1', + '/([m|l])ice$/' => '\1ouse', + '/(x|ch|ss|sh)es$/' => '\1', + '/(m)ovies$/' => '\1\2ovie', + '/(s)eries$/' => '\1\2eries', + '/([^aeiouy]|qu)ies$/' => '\1y', + '/([lr])ves$/' => '\1f', + '/(tive)s$/' => '\1', + '/(hive)s$/' => '\1', + '/([^f])ves$/' => '\1fe', + '/(^analy)ses$/' => '\1sis', + '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/' => '\1\2sis', + '/([ti])a$/' => '\1um', + '/(p)eople$/' => '\1\2erson', + '/(m)en$/' => '\1an', + '/(s)tatus$/' => '\1\2tatus', + '/(c)hildren$/' => '\1\2hild', + '/(n)ews$/' => '\1\2ews', + '/s$/' => '' ); foreach ($singular_rules as $rule => $replacement) diff --git a/libs/legacy.php b/libs/legacy.php index e8cd3f3a4..130a1cdaa 100644 --- a/libs/legacy.php +++ b/libs/legacy.php @@ -1,39 +1,38 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * with this hack you can use clone() in PHP4 code - * use "clone($object)" not "clone $object"! the former works in both PHP4 and PHP5 - * - * - * @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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ - -/** - * Enter description here... + * Short description for file. + * + * With this hack you can use clone() in PHP4 code + * use "clone($object)" not "clone $object"! the former works in both PHP4 and PHP5 + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ + + if (version_compare(phpversion(), '5.0') < 0) { eval(' @@ -55,7 +54,7 @@ if (!function_exists('file_get_contents')) * @author Aidan Lister * @internal resource_context is not supported * @since PHP 5 - * require PHP 4.0.0 (user_error) + * require PHP 4.0.0 (user_error) * * @param unknown_type $filename * @param unknown_type $incpath diff --git a/libs/log.php b/libs/log.php index cd4f06a60..863f58d14 100644 --- a/libs/log.php +++ b/libs/log.php @@ -1,42 +1,49 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Log - * Logs messages to text files. - * - * @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.libs - * @since CakePHP v 1.0.0.0 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Enter description here... */ uses('file'); /** - * Enter description here... + * Logs messages to text files * - * @package cake + * Long description for class + * + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 */ class Log { diff --git a/libs/model.php b/libs/model.php index 6a8e83212..1daf6f29e 100644 --- a/libs/model.php +++ b/libs/model.php @@ -1,57 +1,54 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// + table 'users'; class 'Man' => table 'men') - * The table is required to have at least 'id auto_increment', 'created datetime', - * and 'modified datetime' fields + * Short description for file. + * + * Long description for file * - * To do: - * - schema-related cross-table ($has_one, $has_many, $belongs_to) + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** * Enter description here... */ -uses('object', 'validators', 'inflector'); +uses('object', 'class_registry', 'validators', 'inflector'); + /** + * Short description for class + * * DBO-backed object data model, loosely based on RoR concepts (www.rubyonrails.com). * Automatically selects a database table name based on a pluralized lowercase object class name * (i.e. class 'User' => table 'users'; class 'Man' => table 'men') * The table is required to have at least 'id auto_increment', 'created datetime', * and 'modified datetime' fields. * - * @package cake + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 * */ class Model extends Object @@ -104,34 +101,31 @@ class Model extends Object * @access private */ var $_table_info = null; + +/** + * Enter description here... + * + * @var unknown_type + */ + var $_belongsTo = array(); /** - * Enter description here... - * - * @var unknown_type - * @access private - */ - var $_hasOne = array(); - -/** - * Enter description here... - * - * @var unknown_type - * @access private - */ - var $_belongsTo = array(); - - -/** - * Array of other Models this Model references in a one-to-many relationship. + * Array of other Models this Model references in a belongsTo (one-to-one) relationship. * * @var array * @access private */ - var $_oneToMany = array(); + var $_belongsToOther = array(); /** - * Array of other Models this Model references in a one-to-one relationship. + * Enter description here... + * + * @var unknown_type + */ + var $_hasOne = array(); + +/** + * Array of other Models this Model references in a hasOne (one-to-one) relationship. * * @var array * @access private @@ -139,12 +133,33 @@ class Model extends Object var $_oneToOne = array(); /** - * Array of other Models this Model references in a has-many relationship. + * Enter description here... + * + * @var unknown_type + */ + var $_hasMany = array(); + +/** + * Array of other Models this Model references in a hasMany (one-to-many) relationship. * * @var array * @access private */ - var $_hasMany = array(); + var $_oneToMany = array(); + +/** + * Enter description here... + * + * @var unknown_type + */ + var $_hasAndBelongsToMany = array(); +/** + * Array of other Models this Model references in a hasAndBelongsToMany (many-to-many) relationship. + * + * @var array + * @access private + */ + var $_manyToMany = array(); /** * Enter description here... @@ -162,13 +177,28 @@ class Model extends Object */ var $validationErrors = null; -/** - * - * @var unknown_type - * @access private - */ - var $_count; +/** + * Enter description here... + * + * @var unknown_type + */ + var $classRegistry; + +/** + * Enter description here... + * + * @var unknown_type + */ + var $persistent = null; + +/** + * Prefix for tables in model. + * + * @var string + */ + var $tablePrefix = null; + /** * Constructor. Binds the Model's database table to the object. * @@ -179,6 +209,8 @@ class Model extends Object function __construct ($id=false, $table=null, $db=null) { $this->db = $db? $db: DboFactory::getInstance(); + $this->classRegistry = ClassRegistry::getInstance(); + $this->classRegistry->addObject(get_class($this), $this); if ($id) { @@ -186,7 +218,11 @@ class Model extends Object } $table_name = $table? $table: ($this->use_table? $this->use_table: Inflector::tableize(get_class($this))); - $this->useTable ($table_name); + //Table Prefix Hack - Check to see if the function exists. + if (in_array('settableprefix', get_class_methods(get_class($this)))) $this->setTablePrefix(); + // Table Prefix Hack - Get the prefix for this view. + $this->tablePrefix? $this->useTable($this->tablePrefix.$table_name): $this->useTable ($table_name); + //$this->useTable ($table_name); parent::__construct(); $this->createLinks(); } @@ -197,22 +233,22 @@ class Model extends Object */ function createLinks() { - if (!empty($this->belongsTo)) - { - return $this->_belongsToLink(); - } - if (!empty($this->hasOne)) - { - $this->_hasOneLink(); - } - if (!empty($this->hasMany)) - { - return $this->_hasManyLinks(); - } - if (!empty($this->hasAndBelongsToMany)) - { - return $this->_hasAndBelongsToManyLinks(); - } + if (!empty($this->belongsTo)) + { + $this->_belongsToLink(); + } + if (!empty($this->hasOne)) + { + $this->_hasOneLink(); + } + if (!empty($this->hasMany)) + { + $this->_hasManyLinks(); + } + if (!empty($this->hasAndBelongsToMany)) + { + $this->_hasAndBelongsToManyLinks(); + } } /** @@ -224,15 +260,7 @@ class Model extends Object { if(is_array($this->belongsTo)) { - if (count($this->id) > 1) - { - $this->_count++; - } - else - { - $this->_count = false; - } - + foreach ($this->belongsTo as $association => $associationValue) { $className = $association; @@ -247,9 +275,8 @@ class Model extends Object if ($classCreated === false) { - $this->$className = &new $className(); + $this->_constructAssociatedModels($className , 'Belongs'); $classCreated = true; - $this->_belongsTo = array($association,$className); } switch($option) @@ -283,35 +310,24 @@ class Model extends Object break; } } - - $this->_constructAssociatedModels($className , 'Belongs'); + //$this->_belongsTo = array($className,$association); + $this->linkAssociation('Belongs', $className, $this->id); + $this->relink('Belongs'); unset($className); - - if (!count($this->id) > 1) - { - $this->_resetCount(); - } } } else { - $this->_resetCount(); - if (count($this->id) > 1) - { - $this->_count++; - } - else - { - $this->_count = false; - } - - $association = explode(',', $this->belongsTo); - foreach ($association as $modelName) - { - $this->_constructAssociatedModels($modelName , 'Belongs'); - } - } - } + $association = explode(',', $this->belongsTo); + foreach ($association as $modelName) + { + // $this->_belongsTo = array($modelName,$modelName); + $this->_constructAssociatedModels($modelName , 'Belongs'); + $this->linkAssociation('Belongs', $modelName, $this->id); + $this->relink('Belongs'); + } + } + } /** * Enter description here... @@ -321,16 +337,7 @@ class Model extends Object function _hasOneLink() { if(is_array($this->hasOne)) - { - if (count($this->id) > 1) - { - $this->_count++; - } - else - { - $this->_count = false; - } - + { foreach ($this->hasOne as $association => $associationValue) { $className = $association; @@ -345,9 +352,8 @@ class Model extends Object if ($classCreated === false) { - $this->$className = new $className(); + $this->_constructAssociatedModels($className , 'One'); $classCreated = true; - $this->_hasOne = array($association,$className); } switch($option) @@ -381,35 +387,24 @@ class Model extends Object break; } } - - $this->_constructAssociatedModels($className , 'One'); + // $this->_hasOne = array($className,$association); + $this->linkAssociation('One', $className, $this->id); + $this->relink('One'); unset($className); - - if (!count($this->id) > 1) - { - $this->_resetCount(); - } } } else { - $this->_resetCount(); - if (count($this->id) > 1) - { - $this->_count++; - } - else - { - $this->_count = false; - } - - $association = explode(',', $this->hasOne); - foreach ($association as $modelName) - { - $this->_constructAssociatedModels($modelName , 'One'); - } - } - } + $association = explode(',', $this->hasOne); + foreach ($association as $modelName) + { + // $this->_hasOne = array($modelName,$modelName); + $this->_constructAssociatedModels($modelName , 'One'); + $this->linkAssociation('One', $modelName, $this->id); + $this->relink('One'); + } + } + } /** @@ -420,22 +415,25 @@ class Model extends Object { if(is_array($this->hasMany)) { - $this->_resetCount(); - foreach ($this->hasMany as $association => $associationValue) { - $className = $association; - $this->_hasMany = array($association,$className); - + $className = $association; + $classCreated = false; + foreach ($associationValue as $option => $optionValue) { + if (($option === 'className') && ($classCreated === false)) + { + $className = $optionValue; + } + + if ($classCreated === false) + { + $this->_constructAssociatedModels($className , 'Many'); + $classCreated = true; + } switch ($option) { - case 'className': - //$this->__joinedHasMany[$count][$this->table]['className'] = $optionValue; - //$this->__joinedHasMany[$count][$this->table]['association'] = $association; - break; - case 'conditions': //$this->__joinedHasMany[$count][$this->table]['conditions'] = $optionValue; break; @@ -468,29 +466,29 @@ class Model extends Object break; } } - $this->linkAssociation('Many', $className, $this->id[$this->_count]); + // $this->_hasMany = array($className,$association); + $this->linkAssociation('Many', $className, $this->id); + $this->relink('Many'); + unset($className); } } else - { - $this->_resetCount(); - if (count($this->id) > 1) - { - $this->_count++; - } - else - { - $this->_count = false; - } - - $association = explode(',', $this->hasMany); - foreach ($association as $modelName) - { - $this->linkAssociation('Many', $modelName, $this->id[$this->_count]);; - } - } + { + $association = explode(',', $this->hasMany); + foreach ($association as $modelName) + { + // $this->_hasMany = array($modelName,$modelName); + $this->_constructAssociatedModels($modelName , 'Many'); + $this->linkAssociation('Many', $modelName, $this->id); + $this->relink('Many'); + } + } } +/** + * Enter description here... + * + */ function _hasAndBelongsToManyLinks() { if(is_array($this->hasAndBelongsToMany)) @@ -498,19 +496,19 @@ class Model extends Object } else { - $this->_hasAndBelongsToMany = explode(',', $this->hasAndBelongsToMany); + //$this->_hasAndBelongsToMany = explode(',', $this->hasAndBelongsToMany); + + $association = explode(',', $this->hasAndBelongsToMany); + foreach ($association as $modelName) + { + // $this->_hasAndBelongsToMany = array($modelName,$modelName); + $this->_constructAssociatedModels($modelName , 'ManyTo'); + $this->linkAssociation('ManyTo', $modelName, $this->id); + $this->relink('ManyTo'); + } } } -/** - * Enter description here... - * - * @return unknown - */ - function _resetCount() - { - return $this->_count = 0; - } - + /** * Enter description here... * @@ -519,9 +517,10 @@ class Model extends Object * @param unknown_type $settings * @access private */ - function _constructAssociatedModels($className, $type, $settings = false) + function _constructAssociatedModels($modelName, $type, $settings = false) { - $modelName = Inflector::singularize($className); + $modelName = Inflector::singularize($modelName); + $collectionKey = strtolower($modelName); switch($type) { @@ -545,17 +544,18 @@ class Model extends Object //nothing break; } - $this->linkAssociation($type, $modelName, $this->id[$this->_count]); - if(!isset($this->$className)) + if(!$this->classRegistry->isKeySet($collectionKey)) { - $this->$className = new $className(); + $this->$modelName =& new $modelName(); } - $this->{$joined}[] = $this->$className; - $this->relink($type); + else + { + $this->$modelName =& $this->classRegistry->getObject($collectionKey); + } + + $this->{$joined}[] =& $this->$modelName; } - - /** * Updates this model's association links, by emptying the links list, and then link"*Association Type" again. @@ -564,87 +564,80 @@ class Model extends Object */ function relink ($type) { - switch ($type) + if(!empty($this->_belongsTo)) { - case 'Belongs': - foreach ($this->_belongsTo as $table) - { - if(is_array($table)) - { - $names[] = explode(',', $table); - } - else - { - $names[0] = $table; - $names[1] = $table; - } - $className = $names[1]; - $tableName = Inflector::singularize($names[0]); - $this->$className->clearLinks($type); - $this->$className->linkAssociation($type, $tableName, $this->id); - } - break; - - case 'One': - foreach ($this->_hasOne as $table) - { - if(is_array($table)) - { - $names[] = explode(',', $table); - } - else - { - $names[0] = $table; - $names[1] = $table; - } - $className = $names[1]; - $tableName = Inflector::singularize($names[0]); - $this->$className->clearLinks($type); - $this->$className->linkAssociation($type, $tableName, $this->id); - } - break; - - case 'Many': - foreach ($this->_hasMany as $table) - { - if(is_array($table)) - { - $names[] = explode(',', $table); - } - else - { - $names[0] = $table; - $names[1] = $table; - } - $className = $names[1]; + foreach ($this->_belongsTo as $table) + { + if(is_array($table)) + { + $names[0] = $table[0]; + } + else + { + $names[0] = $table; + } + $tableName = Inflector::singularize($names[0]); + $this->clearLinks($type); + $this->linkAssociation($type, $tableName, $this->id); + } + } + + if(!empty($this->_hasOne)) + { + foreach ($this->_hasOne as $table) + { + if(is_array($table)) + { + $names[0] = $table[0]; + } + else + { + $names[0] = $table; + } + $tableName = Inflector::singularize($names[0]); + $this->clearLinks($type); + $this->linkAssociation($type, $tableName, $this->id); + } + } + + if(!empty($this->_hasMany)) + { + foreach ($this->_hasMany as $table) + { + if(is_array($table)) + { + $names[0] = $table[0]; + } + else + { + $names[0] = $table; + } $tableName = Inflector::singularize($names[0]); $this->clearLinks($type); - $this->linkAssociation($type, $tableName, $this->id[0]); - } - break; - - case 'ManyTo': - foreach ($this->_manyToMany as $table) - { - if(is_array($table)) - { - $names[] = explode(',', $table); - } - else + $this->linkAssociation($type, $tableName, $this->id); + } + } + + if(!empty($this->_hasAndBelongsToMany)) + { + foreach ($this->_hasAndBelongsToMany as $table) + { + if(is_array($table)) + { + $names[0] = $table[0]; + } + else { $names[0] = $table; - $names[1] = $table; } - $className = $names[1]; $tableName = Inflector::singularize($names[0]); $this->clearLinks($type); - $this->linkAssociation($type, $tableName, $this->id[0]); - } - break; + $this->linkAssociation($type, $tableName, $this->id); + } } } + - /** * Enter description here... * @@ -663,16 +656,22 @@ class Model extends Object } else { - if ($type === 'Belongs' || $type === 'One') + if ($type === 'Belongs') { $field_name = Inflector::singularize($tableName).'_id'; } + elseif ($type === 'One') + { + $field_name = Inflector::singularize($this->table).'_id'; + } else { $field_name = Inflector::singularize($this->table).'_id'; } } + + switch ($type) { case 'Belongs': @@ -688,7 +687,22 @@ class Model extends Object break; case 'ManyTo': - $this->_manyToMany = array(); + + //$joinKey = $this->table .'To'. Inflector::singularize($tableName) . 'joinTable'; + //if(!empty($this->$joinKey)) + //{ + // $joinTable = $this->$joinKey; + //} + //else + //{ + $tableSort[0] = $this->table; + $tableSort[1] = $tableName; + sort($tableSort); + $joinTable = $tableSort[0] . '_' . $tableSort[1]; + $key1 = Inflector::singularize($this->table) . '_id'; + $key2 = Inflector::singularize($tableName) . '_id'; + // } + $this->_manyToMany[] = array($tableName, $field_name, $value, $joinTable, $key1, $key2); break; } } @@ -699,24 +713,24 @@ class Model extends Object */ function clearLinks($type) { - switch ($type) - { - case 'Belongs': + //switch ($type) + //{ + // case 'Belongs': $this->_belongsToOther = array(); - break; + // break; - case 'One': + // case 'One': $this->_oneToOne = array(); - break; + // break; - case 'Many': + // case 'Many': $this->_oneToMany = array(); - break; + // break; - case 'ManyTo': + // case 'ManyTo': $this->_manyToMany = array(); - break; - } + // break; + // } } @@ -898,7 +912,7 @@ class Model extends Object */ function saveField($name, $value) { - return $this->save(array($name=>$value), false); + return Model::save(array($name=>$value), false); } /** @@ -1065,7 +1079,7 @@ class Model extends Object */ function find ($conditions = null, $fields = null, $order = null) { - $data = $this->findAll($conditions, $fields, $order, 1); + $data = Model::findAll($conditions, $fields, $order, 1); return empty($data[0])? false: $data[0]; } @@ -1106,41 +1120,44 @@ class Model extends Object */ function findAll ($conditions = null, $fields = null, $order = null, $limit=50, $page=1) { - $conditions = $this->parseConditions($conditions); + $conditions = $this->parseConditions($conditions); + + if (is_array($fields)) + { + $f = $fields; + } + elseif ($fields) + { + $f = array($fields); + } + else + { + $f = array('*'); + } + + $joins = $whers = array(); + + if(!empty($this->_oneToOne)) + { + + foreach ($this->_oneToOne as $rule) + { + list($table, $field, $value) = $rule; + $joins[] = "JOIN {$table} ON {$table}.{$field} = {$this->table}.id"; + + } + } + + if(!empty($this->_belongsToOther)) + { - if (is_array($fields)) - { - $f = $fields; - } - elseif ($fields) - { - $f = array($fields); - } - else - { - $f = array('*'); - } - - $joins = $whers = array(); - - if(!empty($this->_oneToOne)) - { - foreach ($this->_oneToOne as $rule) - { - list($table, $field, $value) = $rule; - $joins[] = "LEFT JOIN {$table} ON {$this->table}.{$field} = {$table}.id"; - } - } - - if(!empty($this->_belongsToOther)) - { - foreach ($this->_belongsToOther as $rule) - { - list($table, $field, $value) = $rule; - $joins[] = "LEFT JOIN {$table} ON {$this->table}.{$field} = {$table}.id"; - } - } - + foreach ($this->_belongsToOther as $rule) + { + list($table, $field, $value) = $rule; + $joins[] = "LEFT JOIN {$table} ON {$this->table}.{$field} = {$table}.id"; + } + } + $joins = count($joins)? join(' ', $joins): null; $whers = count($whers)? '('.join(' AND ', $whers).')': null; $conditions .= ($conditions && $whers? ' AND ': null).$whers; @@ -1160,29 +1177,101 @@ class Model extends Object .$limit_str; $data = $this->db->all($sql); - - if(!empty($this->_oneToMany)) - { - $datacheck = $data; - foreach ($this->_oneToMany as $rule) - { - $count = 0; - list($table, $field, $value) = $rule; - foreach ($datacheck as $key => $value1) - { - foreach ($value1 as $key2 => $value2) + + + if(!empty($this->_oneToMany)) + { + + $datacheck = $data; + $original = $data; + foreach ($this->_oneToMany as $rule) + { + $count = 0; + list($table, $field, $value) = $rule; + + foreach ($datacheck as $key => $value1) { - $select = $this->db->all("SELECT * FROM {$table} WHERE ($field) = {$value2['id']}"); - $data2 = array_merge_recursive($data[$count],$select); - $data1[$count] = $data2; + foreach ($value1 as $key2 => $value2) + { + $select[$table] = $this->db->all("SELECT * FROM {$table} WHERE ($field) = '{$value2['id']}'"); + if( is_array($select[$table]) && ($select[$table] != null)) + { + $newKey = Inflector::singularize($table); + foreach ($select[$table] as $key => $value) + { + $select1[$table][$key] = $value[$newKey]; + } + + $merged = array_merge_recursive($data[$count],$select1); + $newdata[$count] = $merged; + unset ($select1); + } + + if(!empty($newdata[$count])) + { + $original[$count] = $newdata[$count]; + } + } + $count++; } - $count++; - } - $data = $data1; - $this->joinedHasMany[] = new NeatArray($this->db->fields($table)); - } - } - return $data; + $this->joinedHasMany[] = new NeatArray($this->db->fields($table)); + } + + if(!empty($original)) + { + $data = $original; + } + } + + if(!empty($this->_manyToMany)) + { + $datacheck = $data; + $original = $data; + foreach ($this->_manyToMany as $rule) + { + $count = 0; + list($table, $field, $value, $joineTable, $joinKey1, $JoinKey2) = $rule; + + foreach ($datacheck as $key => $value1) + { + foreach ($value1 as $key2 => $value2) + { + if(!empty ($value2['id'])) + { + $select[$table] = $this->db->all("SELECT * FROM {$table} + JOIN {$joineTable} ON {$joineTable}.{$joinKey1} = '$value2[id]' + AND {$joineTable}.{$JoinKey2} = {$table} .id"); + } + if( is_array($select[$table]) && ($select[$table] != null)) + { + $newKey = Inflector::singularize($table); + foreach ($select[$table] as $key => $value) + { + $select1[$table][$key] = $value[$newKey]; + } + + $merged = array_merge_recursive($data[$count],$select1); + $newdata[$count] = $merged; + unset ($select1); + } + + if(!empty($newdata[$count])) + { + $original[$count] = $newdata[$count]; + } + } + $count++; + } + $this->joinedHasAndBelongs[] = new NeatArray($this->db->fields($table)); + } + + if(!empty($original)) + { + $data = $original; + } + } + + return $data; } /** @@ -1204,7 +1293,7 @@ class Model extends Object */ function findCount ($conditions) { - list($data) = $this->findAll($conditions, 'COUNT(*) AS count'); + list($data) = Model::findAll($conditions, 'COUNT(*) AS count'); return isset($data['count'])? $data['count']: false; } @@ -1217,7 +1306,7 @@ class Model extends Object */ function findAllThreaded ($conditions=null, $fields=null, $sort=null) { - return $this->_doThread($this->findAll($conditions, $fields, $sort), null); + return $this->_doThread(Model::findAll($conditions, $fields, $sort), null); } /** @@ -1256,8 +1345,8 @@ class Model extends Object */ function findNeighbours ($conditions, $field, $value) { - list($prev) = $this->findAll($conditions." AND {$field} < '{$value}'", $field, "{$field} DESC", 1); - list($next) = $this->findAll($conditions." AND {$field} > '{$value}'", $field, "{$field} ASC", 1); + list($prev) = Model::findAll($conditions." AND {$field} < '{$value}'", $field, "{$field} DESC", 1); + list($next) = Model::findAll($conditions." AND {$field} > '{$value}'", $field, "{$field} ASC", 1); return array('prev'=>$prev['id'], 'next'=>$next['id']); } @@ -1331,7 +1420,41 @@ class Model extends Object return $errors; } } + + +/** + * This function determines whether or not a string is a foreign key + * + * @param string $field Returns true if the input string ends in "_id" + * @return True if the input string ends in "_id", else false. + */ + function isForeignKey( $field ) { + // get the length of the field. + $length = strlen( $field ); + + // if a reverse search for the string _id reveals that this string appears three characters from the end, then this is a foreign key. + if( strrpos( $field, "_id" ) == $length - 3 ) { + return true; + } + return false; + } + + function getDisplayField() + { + // $displayField defaults to 'name' + $dispField = 'name'; + // If the $displayField variable is set in this model, use it. + if( isset( $this->displayField ) ) { + $dispField = $this->displayField; + } + + // And if the display field does not exist in the table info structure, use the ID field. + if( false == $this->hasField( $dispField ) ) + $dispField = 'id'; + + return $dispField; + } } ?> \ No newline at end of file diff --git a/libs/neat_array.php b/libs/neat_array.php index 9d70739d0..7404f7d43 100644 --- a/libs/neat_array.php +++ b/libs/neat_array.php @@ -1,328 +1,332 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Enter description here... - * - * @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.libs - * @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 file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Class used for internal manipulation of multiarrays (arrays of arrays). * - * @package cake + * Long description for class + * + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 - */ -class NeatArray { -/** - * Value of NeatArray. - * - * @var array - * @access public + * @since CakePHP v 0.2.9 */ +class NeatArray +{ + /** + * Value of NeatArray. + * + * @var array + * @access public + */ var $value; - -/** - * Constructor. Defaults to an empty array. - * - * @param array $value - * @access public - * @uses NeatArray::value - */ - function NeatArray ($value=array()) - { - $this->value = $value; - } -/** - * Finds and returns records with $fieldName equal $value from this NeatArray. - * - * @param string $fieldName - * @param string $value - * @return mixed - * @access public - * @uses NeatArray::value - */ - function findIn ($fieldName, $value) - { - if (!is_array($this->value)) - { - return false; - } - - $out = false; - foreach ($this->value as $k=>$v) - { - if (isset($v[$fieldName]) && ($v[$fieldName] == $value)) - { - $out[$k] = $v; - } - } - - return $out; - } - -/** - * Checks if $this->value is array, and removes all empty elements. - * - * @access public - * @uses NeatArray::value - */ - function cleanup () - { - $out = is_array($this->value)? array(): null; - foreach ($this->value as $k=>$v) - { - if ($v) - { - $out[$k] = $v; - } - } - $this->value = $out; - } - -/** - * Adds elements from the supplied array to itself. - * - * @param string $value - * @return bool - * @access public - * @uses NeatArray::value - */ - function add ($value) + /** + * Constructor. Defaults to an empty array. + * + * @param array $value + * @access public + * @uses NeatArray::value + */ + function NeatArray ($value=array()) { - return ($this->value = $this->plus($value))? true: false; + $this->value = $value; } -/** - * Returns itself merged with given array. - * - * @param array $value Array to add to NeatArray. - * @return array - * @access public - * @uses NeatArray::value - */ - function plus ($value) + /** + * Finds and returns records with $fieldName equal $value from this NeatArray. + * + * @param string $fieldName + * @param string $value + * @return mixed + * @access public + * @uses NeatArray::value + */ + function findIn ($fieldName, $value) { - return array_merge($this->value, (is_array($value)? $value: array($value))); + if (!is_array($this->value)) + { + return false; + } + + $out = false; + foreach ($this->value as $k=>$v) + { + if (isset($v[$fieldName]) && ($v[$fieldName] == $value)) + { + $out[$k] = $v; + } + } + + return $out; } -/** - * Counts repeating strings and returns an array of totals. - * - * @param int $sortedBy A value of 1 sorts by values, a value of 2 sorts by keys. Defaults to null (no sorting). - * @return array - * @access public - * @uses NeatArray::value - */ - function totals ($sortedBy=1,$reverse=true) - { - $out = array(); - foreach ($this->value as $val) - { - isset($out[$val])? $out[$val]++: $out[$val] = 1; - } + /** + * Checks if $this->value is array, and removes all empty elements. + * + * @access public + * @uses NeatArray::value + */ + function cleanup () + { + $out = is_array($this->value)? array(): null; + foreach ($this->value as $k=>$v) + { + if ($v) + { + $out[$k] = $v; + } + } + $this->value = $out; + } - if ($sortedBy == 1) - { - $reverse? arsort($out, SORT_NUMERIC): asort($out, SORT_NUMERIC); - } - - if ($sortedBy == 2) - { - $reverse? krsort($out, SORT_STRING): ksort($out, SORT_STRING); - } + /** + * Adds elements from the supplied array to itself. + * + * @param string $value + * @return bool + * @access public + * @uses NeatArray::value + */ + function add ($value) + { + return ($this->value = $this->plus($value))? true: false; + } - return $out; - } + /** + * Returns itself merged with given array. + * + * @param array $value Array to add to NeatArray. + * @return array + * @access public + * @uses NeatArray::value + */ + function plus ($value) + { + return array_merge($this->value, (is_array($value)? $value: array($value))); + } -/** - * Performs an array_filter() on the contents. - * - * @param unknown_type $with - * @return unknown - */ - function filter ($with) - { - return $this->value = array_filter($this->value, $with); - } + /** + * Counts repeating strings and returns an array of totals. + * + * @param int $sortedBy A value of 1 sorts by values, a value of 2 sorts by keys. Defaults to null (no sorting). + * @return array + * @access public + * @uses NeatArray::value + */ + function totals ($sortedBy=1,$reverse=true) + { + $out = array(); + foreach ($this->value as $val) + { + isset($out[$val])? $out[$val]++: $out[$val] = 1; + } -/** - * Passes each of its values through a specified function or method. Think of PHP's array_walk. - * - * @return array - * @access public - * @uses NeatArray::value - */ - function walk ($with) - { - array_walk($this->value, $with); - return $this->value; - } - -/** - * Enter description here... - * - * @param unknown_type $template - * @return unknown - */ - function sprintf($template) - { - for ($ii=0; $iivalue); $ii++) - { - $this->value[$ii] = sprintf($template, $this->value[$ii]); - } - - return $this->value; - } + if ($sortedBy == 1) + { + $reverse? arsort($out, SORT_NUMERIC): asort($out, SORT_NUMERIC); + } -/** - * Extracts a value from all array items. - * - * @return array - * @access public - * @uses NeatArray::value - */ - function extract ($name) - { - $out = array(); - foreach ($this->value as $val) - { - if (isset($val[$name])) + if ($sortedBy == 2) + { + $reverse? krsort($out, SORT_STRING): ksort($out, SORT_STRING); + } + + return $out; + } + + /** + * Performs an array_filter() on the contents. + * + * @param unknown_type $with + * @return unknown + */ + function filter ($with) + { + return $this->value = array_filter($this->value, $with); + } + + /** + * Passes each of its values through a specified function or method. Think of PHP's array_walk. + * + * @return array + * @access public + * @uses NeatArray::value + */ + function walk ($with) + { + array_walk($this->value, $with); + return $this->value; + } + + /** + * Enter description here... + * + * @param unknown_type $template + * @return unknown + */ + function sprintf($template) + { + for ($ii=0; $iivalue); $ii++) + { + $this->value[$ii] = sprintf($template, $this->value[$ii]); + } + + return $this->value; + } + + /** + * Extracts a value from all array items. + * + * @return array + * @access public + * @uses NeatArray::value + */ + function extract ($name) + { + $out = array(); + foreach ($this->value as $val) + { + if (isset($val[$name])) $out[] = $val[$name]; - } - return $out; - } + } + return $out; + } -/** - * Returns a list of unique elements. - * - * @return array - */ - function unique () - { - return array_unique($this->value); - } + /** + * Returns a list of unique elements. + * + * @return array + */ + function unique () + { + return array_unique($this->value); + } -/** - * Removes duplicate elements from the value and returns it. - * - * @return array - */ - function makeUnique () - { - return $this->value = array_unique($this->value); - } + /** + * Removes duplicate elements from the value and returns it. + * + * @return array + */ + function makeUnique () + { + return $this->value = array_unique($this->value); + } -/** - * Joins an array with myself using a key (like a join between database tables). - * - * Example: - * - * $alice = array('id'=>'1', 'name'=>'Alice'); - * $bob = array('id'=>'2', 'name'=>'Bob'); - * - * $users = new NeatArray(array($alice, $bob)); - * - * $born = array - * ( - * array('user_id'=>'1', 'born'=>'1980'), - * array('user_id'=>'2', 'born'=>'1976') - * ); - * - * $users->joinWith($born, 'id', 'user_id'); - * - * Result: - * - * $users->value == array - * ( - * array('id'=>'1', 'name'=>'Alice', 'born'=>'1980'), - * array('id'=>'2', 'name'=>'Bob', 'born'=>'1976') - * ); - * - * - * @param array $his The array to join with myself. - * @param string $onMine Key to use on myself. - * @param string $onHis Key to use on him. - * @return array - */ + /** + * Joins an array with myself using a key (like a join between database tables). + * + * Example: + * + * $alice = array('id'=>'1', 'name'=>'Alice'); + * $bob = array('id'=>'2', 'name'=>'Bob'); + * + * $users = new NeatArray(array($alice, $bob)); + * + * $born = array + * ( + * array('user_id'=>'1', 'born'=>'1980'), + * array('user_id'=>'2', 'born'=>'1976') + * ); + * + * $users->joinWith($born, 'id', 'user_id'); + * + * Result: + * + * $users->value == array + * ( + * array('id'=>'1', 'name'=>'Alice', 'born'=>'1980'), + * array('id'=>'2', 'name'=>'Bob', 'born'=>'1976') + * ); + * + * + * @param array $his The array to join with myself. + * @param string $onMine Key to use on myself. + * @param string $onHis Key to use on him. + * @return array + */ + function joinWith ($his, $onMine, $onHis=null) + { + if (empty($onHis)) + { + $onHis = $onMine; + } - function joinWith ($his, $onMine, $onHis=null) - { - if (empty($onHis)) - { - $onHis = $onMine; - } + $his = new NeatArray($his); - $his = new NeatArray($his); + $out = array(); + foreach ($this->value as $key=>$val) + { + if ($fromHis = $his->findIn($onHis, $val[$onMine])) + { + list($fromHis) = array_values($fromHis); + $out[$key] = array_merge($val, $fromHis); + } + else + { + $out[$key] = $val; + } + } - $out = array(); - foreach ($this->value as $key=>$val) - { - if ($fromHis = $his->findIn($onHis, $val[$onMine])) - { - list($fromHis) = array_values($fromHis); - $out[$key] = array_merge($val, $fromHis); - } - else - { - $out[$key] = $val; - } - } + return $this->value = $out; + } - return $this->value = $out; - } + /** + * Enter description here... + * + * @param unknown_type $root + * @param unknown_type $idKey + * @param unknown_type $parentIdKey + * @param unknown_type $childrenKey + * @return unknown + */ + function threaded ($root=null, $idKey='id', $parentIdKey='parent_id', $childrenKey='children') + { + $out = array(); -/** - * Enter description here... - * - * @param unknown_type $root - * @param unknown_type $idKey - * @param unknown_type $parentIdKey - * @param unknown_type $childrenKey - * @return unknown - */ - function threaded ($root=null, $idKey='id', $parentIdKey='parent_id', $childrenKey='children') - { - $out = array(); + for ($ii=0; $iivalue); $ii++) + { + if ($this->value[$ii][$parentIdKey] == $root) + { + $tmp = $this->value[$ii]; + $tmp[$childrenKey] = isset($this->value[$ii][$idKey])? + $this->threaded($this->value[$ii][$idKey], $idKey, $parentIdKey, $childrenKey): + null; + $out[] = $tmp; + } + } - for ($ii=0; $iivalue); $ii++) - { - if ($this->value[$ii][$parentIdKey] == $root) - { - $tmp = $this->value[$ii]; - $tmp[$childrenKey] = isset($this->value[$ii][$idKey])? - $this->threaded($this->value[$ii][$idKey], $idKey, $parentIdKey, $childrenKey): - null; - $out[] = $tmp; - } - } - - return $out; - } + return $out; + } } diff --git a/libs/neat_string.php b/libs/neat_string.php index 6e061d116..c0f94e1dc 100644 --- a/libs/neat_string.php +++ b/libs/neat_string.php @@ -1,102 +1,106 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: - * - * @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.libs - * @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 file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** - * Enter description here... - * @package cake + * Short description for class + * + * Long description for class + * + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 * @static */ -class NeatString{ - -/** - * Enter description here... - * - * @param unknown_type $string - * @return unknown - */ - function toArray ($string) - { - return preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY); - } - -/** - * Enter description here... - * - * @param unknown_type $string - * @return unknown - */ - function toRoman ($string) - { - $pl = array('Ä…','ć','Ä™','Å‚','Å„','ó','Å›','ź','ż','Ä„','Ć','Ę','Å?','Ń','Ó','Åš','Ź','Å»'); - $ro = array('a','c','e','l','n','o','s','z','z','A','C','E','L','N','O','S','Z','Z'); +class NeatString +{ + /** + * Enter description here... + * + * @param unknown_type $string + * @return unknown + */ + function toArray ($string) + { + return preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY); + } - return str_replace($pl, $ro, $string); - } + /** + * Enter description here... + * + * @param unknown_type $string + * @return unknown + */ + function toRoman ($string) + { + $pl = array('Ä…','ć','Ä™','Å‚','Å„','ó','Å›','ź','ż','Ä„','Ć','Ę','�?','Ń','Ó','Åš','Ź','Å»'); + $ro = array('a','c','e','l','n','o','s','z','z','A','C','E','L','N','O','S','Z','Z'); -/** - * Enter description here... - * - * @param unknown_type $string - * @return unknown - */ - function toCompressed ($string) - { - $whitespace = array("\n", "\t", "\r", "\0", "\x0B", " "); - return strtolower(str_replace($whitespace, '', $string)); - } + return str_replace($pl, $ro, $string); + } -/** - * Enter description here... - * - * @param unknown_type $length - * @param unknown_type $available_chars - * @return unknown - */ - function randomPassword ($length, $available_chars = 'ABDEFHKMNPRTWXYABDEFHKMNPRTWXY23456789') - { - $chars = preg_split('//', $available_chars, -1, PREG_SPLIT_NO_EMPTY); - $char_count = count($chars); - - $out = ''; - for ($ii=0; $ii<$length; $ii++) - { - $out .= $chars[rand(1, $char_count)-1]; - } - - return $out; - } + /** + * Enter description here... + * + * @param unknown_type $string + * @return unknown + */ + function toCompressed ($string) + { + $whitespace = array("\n", " ", "\r", "\0", "\x0B", " "); + return strtolower(str_replace($whitespace, '', $string)); + } + + /** + * Enter description here... + * + * @param unknown_type $length + * @param unknown_type $available_chars + * @return unknown + */ + function randomPassword ($length, $available_chars = 'ABDEFHKMNPRTWXYABDEFHKMNPRTWXY23456789') + { + $chars = preg_split('//', $available_chars, -1, PREG_SPLIT_NO_EMPTY); + $char_count = count($chars); + + $out = ''; + for ($ii=0; $ii<$length; $ii++) + { + $out .= $chars[rand(1, $char_count)-1]; + } + + return $out; + } } - + ?> \ No newline at end of file diff --git a/libs/object.php b/libs/object.php index 6eea2f6c2..9ad1c60b0 100644 --- a/libs/object.php +++ b/libs/object.php @@ -1,43 +1,49 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Object - * Allows for __construct to be used in PHP4. + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ +/** + * Enter description here... + */ uses('log'); /** * Object class, allowing __construct and __destruct in PHP4. * - * @package cake + * Long description for class + * + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 */ class Object { @@ -58,7 +64,7 @@ class Object */ function Object() { - $this->db =& DboFactory::getInstance(); + $this->db = DboFactory::getInstance(); $args = func_get_args(); register_shutdown_function(array(&$this, '__destruct')); call_user_func_array(array(&$this, '__construct'), $args); diff --git a/libs/router.php b/libs/router.php index 006ec31f6..aeb2becee 100644 --- a/libs/router.php +++ b/libs/router.php @@ -1,43 +1,47 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Enter description here... + */ uses('object', 'neat_array'); /** * Parses the request URL into controller, action, and parameters. * - * @package cake + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 * */ class Router extends Object { diff --git a/libs/sanitize.php b/libs/sanitize.php index cd92b8d60..71f2603c9 100644 --- a/libs/sanitize.php +++ b/libs/sanitize.php @@ -1,53 +1,198 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.9.2 + * @version $Revision: 491 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2005-07-31 13:31:45 -0500 (Sun, 31 Jul 2005) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Data Sanitization. * - * @package cake + * Long description for class + * + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.9.2 + * @since CakePHP v 0.9.2 * */ - class Sanitize +class Sanitize +{ + +/** + * Removes any non-alphanumeric characters. + * + * @param string $string + * @return string + */ + function paranoid($string) + { + return preg_replace("/[^a-zA-Z0-9]/", "", $string); + } + +/** + * Makes a string SQL-safe by adding slashes (if needed). + * + * @param string $string + * @return string + */ + function sql($string) { + if (!ini_get('magic_quotes_gpc')) + { + $string = addslashes($string); + } + return $string; + } + /** - * Enter description here... + * Makes the string safe for display as HTML. Renders entities and converts newlines to
    . + * + * @param string $string + * @param boolean $remove + * @return string + */ + function html($string, $remove = false) + { + if ($remove) + { + $string = strip_tags($string); + } + else + { + $patterns = array("/\&/", "/%/", "//", '/"/', "/'/", "/\(/", "/\)/", "/\+/", "/-/", "/\n/"); + $replacements = array("&", "%", "<", ">", """, "'", "(", ")", "+", "-", "
    "); + $string = preg_replace($patterns, $replacements, $string); + } + + return $string; + } + +/** + * Recursively sanitizes an array of data for safe input. * - * @return Sanitize + * @param mixed $toClean + * @return mixed */ - function Sanitize() + function cleanArray(&$toClean) + { + return $this->cleanArrayR($toClean); + } + +/** + * Private method used for recursion (see cleanArray()). + * + * @param array $toClean + * @return array + */ + function cleanArrayR(&$toClean) + { + if (is_array($toClean)) + { + while(list($k, $v) = each($toClean)) + { + if ( is_array($toClean[$k]) ) + { + $this->cleanArray($toClean[$k]); + } + else + { + $toClean[$k] = $this->cleanValue($v); + } + } + } + else + { + return null; + } + } + +/** + * Do we really need to sanitize array keys? If so, we can use this code... + + function cleanKey($key) + { + if ($key == "") { + return ""; } + + //URL decode and convert chars to HTML entities + $key = htmlspecialchars(urldecode($key)); + //Remove .. + $key = preg_replace( "/\.\./", "", $key ); + //Remove __FILE__, etc. + $key = preg_replace( "/\_\_(.+?)\_\_/", "", $key ); + //Trim word chars, '.', '-', '_' + $key = preg_replace( "/^([\w\.\-\_]+)$/", "$1", $key ); + + return $key; } + */ + +/** + * Method used by cleanArray() to sanitized array nodes. + * + * @param string $val + * @return string + */ + function cleanValue($val) + { + if ($val == "") + { + return ""; + } + + //Replace odd spaces with safe ones + $val = str_replace(" ", " ", $val); + $val = str_replace(chr(0xCA), "", $val); + + //Encode any HTML to entities (including \n -->
    ) + $val = $this->html($val); + + //Double-check special chars and remove carriage returns + //For increased SQL security + $val = preg_replace( "/\\\$/" ,"$" ,$val); + $val = preg_replace( "/\r/" ,"" ,$val); + $val = str_replace ( "!" ,"!" ,$val); + $val = str_replace ( "'" , "'" ,$val); + + //Allow unicode (?) + $val = preg_replace("/&#([0-9]+);/s", "&#\\1;", $val ); + + //Add slashes for SQL + $val = $this->sql($val); + + //Swap user-inputted backslashes (?) + $val = preg_replace( "/\\\(?!&#|\?#)/", "\\", $val ); + + return $val; + } +} ?> \ No newline at end of file diff --git a/libs/scaffold.php b/libs/scaffold.php index 4324496fd..324f4f366 100644 --- a/libs/scaffold.php +++ b/libs/scaffold.php @@ -1,35 +1,35 @@ - + // -// + Copyright: (c) 2005, Cake Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since Cake v 1.0.0.172 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Enter description here... @@ -37,14 +37,14 @@ uses('model', 'template', 'inflector', 'object'); /** - * Enter description here... - * - * - * @package cake - * @subpackage cake.libs - * @since Cake v 1.0.0.172 - * - */ + * Short description for class + * + * Long description for class + * + * @package cake + * @subpackage cake.libs + * @since Cake v 1.0.0.172 + */ class Scaffold extends Object { /** @@ -100,103 +100,201 @@ class Scaffold extends Object { * Enter description here... * * @param unknown_type $controller_class - * @param unknown_type $action + * @param unknown_type $params */ - function __construct($controller_class, $params){ - $this->clazz = $controller_class; - $this->actionView = $params['action']; - - $r = null; - if (!preg_match('/(.*)Controller/i', $this->clazz, $r)) - die("Scaffold::__construct() : Can't get or parse class name."); - $this->model = strtolower(Inflector::singularize($r[1])); - $this->scaffoldTitle = Inflector::toString($this) . ' ' . $r[1]; - } - - function constructClasses($params){ - - $this->controllerClass = new $this->clazz(); - $this->controllerClass->base = $this->base; - $this->controllerClass->params = $params; - $this->controllerClass->contructClasses(); - $this->controllerClass->layout = 'scaffold'; - $this->controllerClass->pageTitle = $this->scaffoldTitle; + function __construct($controller_class, $params) + { + $this->clazz = $controller_class; + $this->actionView = $params['action']; + + $r = null; + if (!preg_match('/(.*)Controller/i', $this->clazz, $r)) + { + die("Scaffold::__construct() : Can't get or parse class name."); + } + $this->model = strtolower(Inflector::singularize($r[1])); + $this->scaffoldTitle = $r[1]; } /** * Enter description here... * + * @param unknown_type $params + */ + function constructClasses($params) + { + $this->controllerClass = new $this->clazz(); + $this->controllerClass->base = $this->base; + $this->controllerClass->params = $params; + $this->controllerClass->contructClasses(); + $this->controllerClass->layout = 'scaffold'; + $this->controllerClass->pageTitle = $this->scaffoldTitle; + } + + /** + * Enter description here... + * + * @param unknown_type $params * @return unknown */ - function showScaffoldIndex($params){ - return $this->showScaffoldList($params); + function scaffoldIndex($params) + { + return $this->scaffoldList($params); } /** * Enter description here... * + * @param unknown_type $params */ - function showScaffoldShow($params){ - $model = $this->model; - $this->controllerClass->set('data', $this->controllerClass->models[$model]->read()); - $this->controllerClass->render($this->actionView, '', LIBS.'controllers'.DS.'templates'.DS.'scaffolds'.DS.'show.thtml'); + function scaffoldShow($params) + { + $this->controllerClass->params['data'] = $this->controllerClass->models[$this->model]->read(); + $this->controllerClass->set('data', $this->controllerClass->params['data'] ); + $this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames( $this->controllerClass->params['data'], false ) ); + $this->controllerClass->render($this->actionView, '', LIBS.'controllers'.DS.'templates'.DS.'scaffolds'.DS.'show.thtml'); } /** * Enter description here... * + * @param unknown_type $params */ - function showScaffoldList($params){ - $this->controllerClass->render($this->actionView, '', LIBS.'controllers'.DS.'templates'.DS.'scaffolds'.DS.'list.thtml'); - + function scaffoldList($params) + { + $model = $this->model; + $this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames(null,false) ); + $registry = ClassRegistry::getInstance(); + $objModel = $registry->getObject( $model ); + $this->controllerClass->set('data', $objModel->findAll()); + $this->controllerClass->render($this->actionView, '', LIBS.'controllers'.DS.'templates'.DS.'scaffolds'.DS.'list.thtml'); } /** * Enter description here... * + * @param unknown_type $params */ - function showScaffoldNew($params){ - - $this->controllerClass->render($this->actionView, '', LIBS.'controllers'.DS.'templates'.DS.'scaffolds'.DS.'new.thtml'); + function scaffoldNew($params) + { + $this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames() ); + $this->controllerClass->render($this->actionView, '', LIBS.'controllers'.DS.'templates'.DS.'scaffolds'.DS.'new.thtml'); } /** * Enter description here... * + * @param unknown_type $params */ - function showScaffoldEdit($params){ - $model = $this->model; - $this->controllerClass->set('data', $this->controllerClass->models[$model]->read()); - $this->controllerClass->render($this->actionView, '', LIBS.'controllers'.DS.'templates'.DS.'scaffolds'.DS.'edit.thtml'); + function scaffoldEdit($params) + { + $this->controllerClass->params['data'] = $this->controllerClass->models[$this->model]->read(); + // generate the field names. + $this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames($this->controllerClass->params['data']) ); + $this->controllerClass->set('data', $this->controllerClass->params['data']); + $this->controllerClass->render($this->actionView, '', LIBS.'controllers'.DS.'templates'.DS.'scaffolds'.DS.'edit.thtml'); + } + + +/** + * Enter description here... + * + * @param unknown_type $params + */ + function scaffoldCreate($params) + { + $this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames() ); + $this->cleanUpDateFields(); + + if ($this->controllerClass->models[$this->model]->save($this->controllerClass->params['data'])) + { + $this->controllerClass->flash('Your '.$this->model.' has been saved.', '/'.$this->controllerClass->viewPath ); + } + else + { + $this->controllerClass->set('data', $this->controllerClass->params['data']); + $this->controllerClass->validateErrors($this->controllerClass->models[$this->model]); + $this->controllerClass->render($this->actionView, '', LIBS.'controllers'.DS.'templates'.DS.'scaffolds'.DS.'new.thtml'); + } } /** * Enter description here... * + * @param unknown_type $params */ - function scaffoldCreate($params){ - - $this->controllerClass->flash('Scaffold::scaffoldCreate not implemented yet', '/'.$this->controllerClass->viewPath, 1); + function scaffoldUpdate($params=array()) + { + // clean up the date fields + $this->cleanUpDateFields(); + + $this->controllerClass->models[$this->model]->set($this->controllerClass->params['data']); + if ( $this->controllerClass->models[$this->model]->save()) + { + $this->controllerClass->flash('The '.$this->model.' has been updated.','/'.$this->controllerClass->name); + } + else + { + $this->controllerClass->flash('There was an error updating the '.$this->model,'/'.$this->controllerClass->name); + } } /** * Enter description here... * + * @param unknown_type $params */ - function scaffoldUpdate($params=array()){ - - $this->controllerClass->flash('Scaffold::scaffoldUpdate not implemented yet', '/'.$this->controllerClass->viewPath, 1); + function scaffoldDestroy($params=array()) + { + $id = $params['pass'][0]; + // figure out what model and table we are working with + $controllerName = $this->controllerClass->name; + $table = Inflector::singularize($controllerName); + if ($this->controllerClass->models[$table]->del($id)) + { + $this->controllerClass->flash('The '.$table.' with id: '.$id.' has been deleted.', '/'.$controllerName); + } + else + { + $this->controllerClass->flash('There was an error deleting the '.$table.' with the id '.$id, '/'.$controllerName); + } } - /** - * Enter description here... - * - */ - function scaffoldDestroy($params=array()){ - - $this->controllerClass->flash('Scaffold::scaffoldDestroy not implemented yet', '/'.$this->controllerClass->viewPath, 1); + function cleanUpDateFields() + { + // clean up the date fields + foreach( $this->controllerClass->models[$this->model]->_table_info as $table ) + { + foreach ($table as $field) + { + if( 'date' == $field['type'] && isset($this->controllerClass->params['data'][$this->model][$field['name'].'_year'] ) ) + { + $newDate = mktime( 0,0,0, + $this->controllerClass->params['data'][$this->model][$field['name'].'_month'], + $this->controllerClass->params['data'][$this->model][$field['name'].'_day'], + $this->controllerClass->params['data'][$this->model][$field['name'].'_year'] ); + $newDate = date( 'Y-m-d', $newDate ); + $this->controllerClass->params['data'][$this->model][$field['name']] = $newDate; + } + else if( 'datetime' == $field['type'] && isset($this->controllerClass->params['data'][$this->model][$field['name'].'_year'] ) ) + { + $hour = $this->controllerClass->params['data'][$this->model][$field['name'].'_hour']; + if( $hour != 12 && 'pm' == $this->controllerClass->params['data'][$this->model][$field['name'].'_meridian'] ) + { + $hour = $hour + 12; + } + $newDate = mktime( $hour, + $this->controllerClass->params['data'][$this->model][$field['name'].'_min'], + 0, + $this->controllerClass->params['data'][$this->model][$field['name'].'_month'], + $this->controllerClass->params['data'][$this->model][$field['name'].'_day'], + $this->controllerClass->params['data'][$this->model][$field['name'].'_year'] ); + $newDate = date( 'Y-m-d', $newDate ); + $this->controllerClass->params['data'][$this->model][$field['name']] = $newDate; + } + } + } } - } ?> \ No newline at end of file diff --git a/libs/template.php b/libs/template.php index af0136af0..7670b8803 100644 --- a/libs/template.php +++ b/libs/template.php @@ -1,43 +1,49 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Renderer - * Templating for Controller class. + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ +/** + * Enter description here... + */ uses('object'); /** * Templating for Controller class. Takes care of rendering views. * - * @package cake + * Long description for class + * + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.2.9 + * @since CakePHP v 0.2.9 */ class Template extends Object { diff --git a/libs/time.php b/libs/time.php index 114b1a240..d2237c787 100644 --- a/libs/time.php +++ b/libs/time.php @@ -1,45 +1,50 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Enter description here... + */ uses ('object'); /** - * Time related functions, formatting for dates etc. - * - * @package cake - * @subpackage cake.libs - * @since CakePHP v 0.2.9 - * - */ + * Time related functions, formatting for dates etc. + * + * Long description for class + * + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 + */ class Time extends Object { diff --git a/libs/validators.php b/libs/validators.php index 50d6e3d4b..2e69672a8 100644 --- a/libs/validators.php +++ b/libs/validators.php @@ -1,34 +1,35 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// + + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Not empty. diff --git a/libs/view.php b/libs/view.php index 4acdb43c1..ea45434c2 100644 --- a/libs/view.php +++ b/libs/view.php @@ -1,43 +1,49 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: View - * - * - * @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.libs - * @since CakePHP v 0.9.1 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.libs + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Enter description here... + */ uses('object'); /** - * + * Short description for class * - * @package cake + * Long description for class + * + * @package cake * @subpackage cake.libs - * @since CakePHP v 0.9.1 + * @since CakePHP v 0.9.1 */ class View extends Object { diff --git a/libs/web/templates/scaffolds/layout.thtml b/libs/web/templates/scaffolds/layout.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/web/templates/scaffolds/methods.thtml b/libs/web/templates/scaffolds/methods.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/web/templates/scaffolds/parameters.thtml b/libs/web/templates/scaffolds/parameters.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/libs/web/templates/scaffolds/result.thtml b/libs/web/templates/scaffolds/result.thtml new file mode 100644 index 000000000..e69de29bb diff --git a/public/css.php b/public/css.php index 4daf5f3b1..c10d4a79a 100644 --- a/public/css.php +++ b/public/css.php @@ -1,33 +1,34 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** + * Short description for file. * - * - * @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.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * Long description for file * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.public + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** diff --git a/public/css/default.css b/public/css/default.css index 5091dace2..3b7badc32 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -1,113 +1,116 @@ -BODY { -font-size: 76%; +body +{ + font:small "Trebuchet MS",Verdana,Arial,Sans-serif; + background: #E5EDEC url(../img/bg_fade.gif) bottom left fixed repeat-x; } -BODY, INPUT, TEXTAREA { -font-family:sans-serif; +ul{} +li{} + +h1 +{ + color: #71300F; + font-size: 30px; } -H1 { -font-size:2.1em; -color: #69c; -/* This causes some big problems in FF. -color: #fff; -text-align: left; -position: absolute; -padding-left: 15%; -top: 0.35em; -left: 0; -height: 4em;*/ +h1 em { + color: #DBA941; + font-style: normal; + font-weight: normal; + font-variant: normal; } -H2 { -font-size:1.7em; -color: #383; +h2 +{ + color: #71300F; } -H3 { -font-size:1.4em; -color: #553; +h2 em { + color: #DBA941; + font-style: normal; + font-weight: normal; + font-variant: normal; } -H4 { -font-size:1.15em; -color: #338; +hr +{ + border-top: 1px dotted #FF96F3; + height: 0px; } -P { -font-size:1em; -margin-bottom:.5em; +ul +{ + list-style-image: url(../img/red_box.gif); } -A { -white-space:nowrap; -text-decoration:underline; +#main +{ + position: absolute; + width: 605px; + margin-left: -302.5px; + left: 50%; + top: 0px; + background-color: #fff; + border-left: 1px solid #516067; + border-right: 1px solid #516067; + border-bottom: 1px solid #516067; + padding: 15px; } -A:HOVER { -background-color:#EEE; +#header +{ + position: relative; + top: -15px; + left: -15px; + width: 635px; + height: 131px; + background: #fff url(../img/bg_header.gif) repeat-x; + margin-bottom: -20px; } -CODE, PRE { -font-family:monospace; -font-size:1.1em !important; -font-size:.95em; -color:#44A; -margin:0; +#headerLogo +{ + position: absolute; + top: 0px; + left: -30px; } -CODE { -color:#227; -white-space:nowrap; -margin:0 .2em; +#headerNav +{ + position: absolute; + right: 15px; + top: 63px; } -PRE { -margin-left:1em; +#headerNav a { + padding: 10px; } -ACRONYM { -border-bottom:1px dotted; +a +{ + color: #A20B10; + text-decoration: none; } -HR { -height:0; -border-top:1px solid #AAA; +a:hover +{ + color: #D33C47; + text-decoration: underline; + } - -#container { -margin: 0 auto; -/* This causes some big problems in FF. -border-top: solid 5em #69c;*/ -color: #333; -font: normal 1.1em Verdana; -padding: 0 15%; +#footer +{ + position: relative; + bottom: -15px; + left: -15px; + width: 615px; + background-color: #71300F; + color: #fff; + font-size: 75%; + padding: 10px; } -#content { -padding-top: 1em; -width: 100%; -text-align: left; -line-height: 170%; -} - -.notice { -padding: 1em; -background: #ffd; -border: solid 2px #eeb; -display: block; -font-family: Verdana; -} - -.tip { -background: #efe; -padding: 1em; -border: solid 2px #cdc; -} - -.error { -background: #fee; -padding: 1em; -border: solid 2px #dcc; -} +.navActive { + background-color: #D2D7D8; +} \ No newline at end of file diff --git a/public/css/forms.css b/public/css/forms.css index 710bbaa09..dba3867cb 100644 --- a/public/css/forms.css +++ b/public/css/forms.css @@ -205,6 +205,21 @@ form div.submit { padding: 0px 0px 0px 140px; } +div.submit input { + align:center; + text-align:center; + font-weight: bold; + color: #fff; + background-color:#3297FC; + display:block; + float:left; + text-decoration: none; + border: 1px; + width: 215px; + padding:6px; + margin: 5px; + +} form div.submit div { display: inline; float: left; @@ -307,3 +322,7 @@ form div.notes p, form div small { form div.wide small { margin: 0px 0px 5px 0px; } + +div.date select { + width:auto; +} \ No newline at end of file diff --git a/public/css/scaffold.css b/public/css/scaffold.css index 2d387feaf..0a7afc5c2 100644 --- a/public/css/scaffold.css +++ b/public/css/scaffold.css @@ -1,95 +1,158 @@ -BODY { -font-size:.9em; +/* CSS Document */ +* { + margin: 0; + padding: 0; } - -BODY, INPUT, TEXTAREA { -font-family:sans-serif; +body { + font: 76% Verdana, Arial, Helvetica, sans-serif; + color: #333; } - -H1 { +h1 { font-size:2.1em; -text-align:center; +color: #69c; } - -H2 { -font-size:1.8em; +h2 { +font-size:1.7em; +color: #383; +clear: both; } - -H3 { -font-size:1.5em; +h3 { +font-size:1.4em; +color: #553; } - -P { -font-size:1em; -margin-bottom:.5em; +h4 { +font-size:1.15em; +color: #338; } - -A { +a { white-space:nowrap; text-decoration:underline; } - -CODE, PRE { -font-family:monospace; -font-size:1.1em !important; -font-size:.95em; -color:#44A; -margin:0; +a:hover { +background-color:#EEE; } - -CODE { +code, pre { +font-family:monospace; +font-size:1.15em; +color:#44A; +} +code { color:#227; white-space:nowrap; margin:0 .2em; } - -PRE { +pre { margin-left:1em; } - -ACRONYM { -border-bottom:1px dotted; +acronym { +border-bottom:1px dotted #666; +} +ul { +margin-top:1em; +list-style:none; +} +li { +margin-left:2em; +} +#container { +margin: 2em auto; +color: #333; +width:80%; +} +.notice { +padding: 1em; +background: #ffd; +border: solid 2px #eeb; +display: block; +font-family: Verdana; } -HR { -height:0; -border-top:1px solid #AAA; +.tip { +background: #efe; +padding: 1em; +border: solid 2px #cdc; +} +.error { +background: #fee; +padding: 1em; +border: solid 2px #dcc; +} +ul.actions { + list-style: none; + text-align:right; + margin:2em 0; + float:left; } - -/*table code */ -table.inav { - width: 100%; - border: 1px solid #686E74; - margin: 1em 0 2em 0; - background-color: #fff; -} -table.inav th { - background-color: #ccc; - text-align: left; - border-top: 1px solid #fff; - border-right: 1px solid #666; - border-bottom: 1px solid #666; - padding:3px; -} -table.inav tr td { - padding:2px 0; - border-right: 1px solid #ccc; -} -table.inav tr td { - background: #fff; - padding:2px 0; - border-right: 1px solid #ccc; -} -table.inav tr.or td { - background: #EBF4FD; -} -/* lists */ ul.actions li { -display:inline; -border-right:1px solid #333; + border: 1px solid #333; + width:10em; + float:left; + margin-left:1em; } -ul.actions li a { - color: #FF0000; - padding:0 5px; + +ul.actions li a, ul.actions li input { + text-align:center; + font-weight: bold; + color: #fff; + background-color:#3297FC; + display:block; + clear: both; + text-decoration: none; + border:1px solid #3297FC; } + +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 { + width: 100%; + border: 1px solid #686E74; + margin: 1em 0 2em 0; + background-color: #fff; +} +th { + background-color: #ccc; + text-align: left; + border-top: 1px solid #fff; + border-right: 1px solid #666; + border-bottom: 1px solid #666; + padding:3px; +} +table tr td { + padding:2px 0; + border-right: 1px solid #ccc; + vertical-align:top; +} +table tr.altRow td { + background: #EBF4FD; +} + +dl { +line-height:2em; +margin:1em; +} +dt { +font-weight: bold; +vertical-align:top; +} +dd { +margin-left:10em; +margin-top:-2em; +vertical-align:top; +} \ No newline at end of file diff --git a/public/index.php b/public/index.php index 291680df3..87094c743 100644 --- a/public/index.php +++ b/public/index.php @@ -1,35 +1,40 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Purpose: Dispatch * The main "loop" * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.public - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.public + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ + +/** + * Enter description here... + */ $url = empty($_GET['url'])? null: $_GET['url']; session_start(); @@ -41,7 +46,6 @@ if (!defined('DS')) { /** * Enter description here... - * */ define('DS', DIRECTORY_SEPARATOR); } @@ -78,11 +82,10 @@ $TIME_START = getMicrotime(); uses('folder', 'dispatcher', 'dbo_factory'); -config('tags', 'database'); +config('database'); if (class_exists('DATABASE_CONFIG')) { - $DB = DboFactory::getInstance('default'); loadModels(); } @@ -96,4 +99,4 @@ if (class_exists('DATABASE_CONFIG')) //CLEANUP if (DEBUG) echo ""; -?> \ No newline at end of file +?> diff --git a/public/js/vendors.php b/public/js/vendors.php index 12c9a737d..0ece98bfa 100644 --- a/public/js/vendors.php +++ b/public/js/vendors.php @@ -1,34 +1,40 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** + * Short description for file. + * * This file includes js vendor-files from /vendor/ directory if they need to * be accessible to the public. - * + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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 - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.public.js + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ +/** + * Enter description here... + */ if(is_file('../../vendors/javascript/'.$_GET['file']) && (preg_match('/(.+)\\.js/', $_GET['file']))) { readfile('../../vendors/javascript/'.$_GET['file']); diff --git a/scripts/bake.php b/scripts/bake.php index b3d3a9980..b3444e25a 100644 --- a/scripts/bake.php +++ b/scripts/bake.php @@ -1,34 +1,36 @@ #!/usr/local/bin/php + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Enter description here... - * - * @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.scripts - * @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 file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.scripts + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * START-UP diff --git a/scripts/test.php b/scripts/test.php index 4e3212e8e..c26061e38 100644 --- a/scripts/test.php +++ b/scripts/test.php @@ -1,36 +1,39 @@ + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// +/* SVN FILE: $Id$ */ /** - * Enter description here... - * - * @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.scripts - * @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 file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework + * Copyright (c) 2005, CakePHP Authors/Developers + * + * Author(s): Michal Tatarynowicz aka Pies + * Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * 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.scripts + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Helper function for outputing data. Should be moved somevhere else. + * * @param mixed $data Data to be dumped * @return string Dumped data */ @@ -55,7 +58,7 @@ if (!defined('ROOT')) } require_once ROOT.'config'.DS.'paths.php'; require_once CONFIGS.'core.php'; -require_once CONFIGS.'tags.php'; +require_once CONFIGS.'tags.ini.php'; require_once LIBS.'basics.php'; if (file_exists(CONFIGS.'database.php')) diff --git a/tests/LICENSE.txt b/tests/LICENSE.txt new file mode 100644 index 000000000..8c0225646 --- /dev/null +++ b/tests/LICENSE.txt @@ -0,0 +1,49 @@ +The Open Group Test Suite License + +Preamble + +The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. + +Testing is essential for proper development and maintenance of standards-based products. + +For buyers: adequate conformance testing leads to reduced integration costs and protection of investments in applications, software and people. + +For software developers: conformance testing of platforms and middleware greatly reduces the cost of developing and maintaining multi-platform application software. + +For suppliers: In-depth testing increases customer satisfaction and keeps development and support costs in check. API conformance is highly measurable and suppliers who claim it must be able to substantiate that claim. + +As such, since these are benchmark measures of conformance, we feel the integrity of test tools is of importance. In order to preserve the integrity of the existing conformance modes of this test package and to permit recipients of modified versions of this package to run the original test modes, this license requires that the original test modes be preserved. + +If you find a bug in one of the standards mode test cases, please let us know so we can feed this back into the original, and also raise any specification issues with the appropriate bodies (for example the POSIX committees). + +Definitions: + + * "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. + * "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. + * "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. + * "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) +* "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. + +1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least the following: + +rename any non-standard executables and testcases so the names do not conflict with standard executables and testcases, which must also be provided, and provide a separate manual page for each non-standard executable and testcase that clearly documents how it differs from the Standard Version. + +4. You may distribute the programs of this Package in object code or executable form, provided that you do at least the following: + +accompany any non-standard executables and testcases with their corresponding Standard Version executables and testcases, giving the non-standard executables and testcases non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. + +5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. + +6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. + +7.Subroutines supplied by you and linked into this Package shall not be considered part of this Package. + +8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. + +9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The End \ No newline at end of file diff --git a/tests/README.txt b/tests/README.txt new file mode 100644 index 000000000..e25e27a63 --- /dev/null +++ b/tests/README.txt @@ -0,0 +1,30 @@ +-------------------------------------------------------------------------------- + +Cake Unit Test Suite + +-------------------------------------------------------------------------------- + +$Id$ +$Date$ +$LastChangedBy$ + +-------------------------------------------------------------------------------- + +RUNNING THE TESTS + +Some paths need to be set up for the unit test suite to run correctly. The paths +should be set in the caketest.config.ini file. The values that may need to be changed are: + + * TEST_CASES = + * TEST_GROUPS = + * SIMPLE_TEST_DEFAULT = + * TEST_HTTP_PATH = + * CAKE_EXAMPLES_HTTP_PATH = + * library_path = + + +All test cases should have the file suffix '.test.php'. + Example: controller.test.php + +All group tests should have the file suffix '.group.php'. + Example: controller.group.php \ No newline at end of file diff --git a/tests/caketest.config.ini b/tests/caketest.config.ini new file mode 100644 index 000000000..992765b42 --- /dev/null +++ b/tests/caketest.config.ini @@ -0,0 +1,27 @@ +;========================================================================= +; Cake Test Suite configuration file +; +; License http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License +; +; $Id$ +; $Date$ +; $LastChangedBy$ +;========================================================================= + + +[paths] +TEST_CASES = cases +TEST_GROUPS = groups + +; Modify these values +TEST_HTTP_PATH = http://somedomain/tests/cases/ +CAKE_EXAMPLES_HTTP_PATH = http://somedomain/examples + +; For remote tests +REMOTE_TEST_HTTP_PATH = http://somedomain/tests/index.php + +; This is set for subversion repository layout currently +; each developers sandbox should resolve to path below properly + +[simpletest] +library_path = ../../../../vendor/simpletest/ diff --git a/tests/caketest.config.php b/tests/caketest.config.php new file mode 100644 index 000000000..11834f83d --- /dev/null +++ b/tests/caketest.config.php @@ -0,0 +1,45 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** Cake SimpleTest config file + * + * Set the path to the simpletest package. + * The default define: + * ('SIMPLE_TEST', '../../../../vendor/simpletest/'); + * links SimpleTest to each developers sandbox. + * + * This must be changed by endusers wishing to run test suite + * + */ + +define('SIMPLE_TEST', '../../../../vendor/simpletest/'); + +?> \ No newline at end of file diff --git a/tests/cases/app/apis/apis.test.php b/tests/cases/app/apis/apis.test.php new file mode 100644 index 000000000..aac21a5b8 --- /dev/null +++ b/tests/cases/app/apis/apis.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.apis + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.apis + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ApisTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/app_controller.test.php b/tests/cases/app/app_controller.test.php new file mode 100644 index 000000000..94d881ac3 --- /dev/null +++ b/tests/cases/app/app_controller.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app + * @since CakePHP Test Suite v 1.0.0.0 + */ +class AppControllerAppTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/app_model.test.php b/tests/cases/app/app_model.test.php new file mode 100644 index 000000000..bc0d676cc --- /dev/null +++ b/tests/cases/app/app_model.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app + * @since CakePHP Test Suite v 1.0.0.0 + */ +class AppModelAppTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/controllers/pages_controller.test..php b/tests/cases/app/controllers/pages_controller.test..php new file mode 100644 index 000000000..8dad40fa3 --- /dev/null +++ b/tests/cases/app/controllers/pages_controller.test..php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.controllers + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.controllers + * @since CakePHP Test Suite v 1.0.0.0 + */ +class PagesControllerTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/helpers/pages_helper.test.php b/tests/cases/app/helpers/pages_helper.test.php new file mode 100644 index 000000000..6586c4a8f --- /dev/null +++ b/tests/cases/app/helpers/pages_helper.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.helpers + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.helpers + * @since CakePHP Test Suite v 1.0.0.0 + */ +class PagesHelperTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/models/models.test.php b/tests/cases/app/models/models.test.php new file mode 100644 index 000000000..1445fd054 --- /dev/null +++ b/tests/cases/app/models/models.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.models + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.models + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ModelsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/views/errors/missing_action.test.php b/tests/cases/app/views/errors/missing_action.test.php new file mode 100644 index 000000000..b47807a43 --- /dev/null +++ b/tests/cases/app/views/errors/missing_action.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.views.errors + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.views.errors + * @since CakePHP Test Suite v 1.0.0.0 + */ +class MissingActionViewsErrorsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/views/errors/missing_controller.test.php b/tests/cases/app/views/errors/missing_controller.test.php new file mode 100644 index 000000000..8e9e91438 --- /dev/null +++ b/tests/cases/app/views/errors/missing_controller.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.views.errors + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.views.errors + * @since CakePHP Test Suite v 1.0.0.0 + */ +class MissingControllerViewsErrorsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/views/errors/missing_view.test.php b/tests/cases/app/views/errors/missing_view.test.php new file mode 100644 index 000000000..8ecc6c354 --- /dev/null +++ b/tests/cases/app/views/errors/missing_view.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.views.errors + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.views.errors + * @since CakePHP Test Suite v 1.0.0.0 + */ +class MissingViewViewsErrorsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/views/layouts/ajax.test.php b/tests/cases/app/views/layouts/ajax.test.php new file mode 100644 index 000000000..b40731463 --- /dev/null +++ b/tests/cases/app/views/layouts/ajax.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.views.layouts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.views.layouts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class AjaxViewsLayoutsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/views/layouts/default.test.php b/tests/cases/app/views/layouts/default.test.php new file mode 100644 index 000000000..9c0e20081 --- /dev/null +++ b/tests/cases/app/views/layouts/default.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.views.layouts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.views.layouts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DefaultViewsLayoutsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/views/layouts/error.test.php b/tests/cases/app/views/layouts/error.test.php new file mode 100644 index 000000000..87a80c565 --- /dev/null +++ b/tests/cases/app/views/layouts/error.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.views.layouts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.views.layouts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ErrorViewsLayoutsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/views/layouts/flash.test.php b/tests/cases/app/views/layouts/flash.test.php new file mode 100644 index 000000000..96c017057 --- /dev/null +++ b/tests/cases/app/views/layouts/flash.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.views.layouts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.views.layouts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FlashViewsLayoutsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/views/pages/home.test.php b/tests/cases/app/views/pages/home.test.php new file mode 100644 index 000000000..5d04f45c0 --- /dev/null +++ b/tests/cases/app/views/pages/home.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.views.pages + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.views.pages + * @since CakePHP Test Suite v 1.0.0.0 + */ +class HomeViewsLayoutsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/app/views/views.test.php b/tests/cases/app/views/views.test.php new file mode 100644 index 000000000..9324bd176 --- /dev/null +++ b/tests/cases/app/views/views.test.php @@ -0,0 +1,45 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.app.views + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.app.views + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ViewsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/config/core.test.php b/tests/cases/config/core.test.php new file mode 100644 index 000000000..d91607f62 --- /dev/null +++ b/tests/cases/config/core.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.config + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.config + * @since CakePHP Test Suite v 1.0.0.0 + */ +class CoreConfigTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/config/paths.test.php b/tests/cases/config/paths.test.php new file mode 100644 index 000000000..1f4c471ea --- /dev/null +++ b/tests/cases/config/paths.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.config + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.config + * @since CakePHP Test Suite v 1.0.0.0 + */ +class PathsConfigTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/config/routes.test.php b/tests/cases/config/routes.test.php new file mode 100644 index 000000000..05bb0a000 --- /dev/null +++ b/tests/cases/config/routes.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.config + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.config + * @since CakePHP Test Suite v 1.0.0.0 + */ +class RoutesConfigTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/config/tags.test.php b/tests/cases/config/tags.test.php new file mode 100644 index 000000000..20dcff9b9 --- /dev/null +++ b/tests/cases/config/tags.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.config + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.config + * @since CakePHP Test Suite v 1.0.0.0 + */ +class TagsConfigTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/bake.test.php b/tests/cases/libs/bake.test.php new file mode 100644 index 000000000..7e2525d9a --- /dev/null +++ b/tests/cases/libs/bake.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class BakeTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/basics.test.php b/tests/cases/libs/basics.test.php new file mode 100644 index 000000000..6452c97e4 --- /dev/null +++ b/tests/cases/libs/basics.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class BasicsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/cache.test.php b/tests/cases/libs/cache.test.php new file mode 100644 index 000000000..45bd46232 --- /dev/null +++ b/tests/cases/libs/cache.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class CacheTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controller.test.php b/tests/cases/libs/controller.test.php new file mode 100644 index 000000000..d4506f822 --- /dev/null +++ b/tests/cases/libs/controller.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ControllerTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/rescues/_request_and_response.test.php b/tests/cases/libs/controllers/templates/rescues/_request_and_response.test.php new file mode 100644 index 000000000..5bf9efb73 --- /dev/null +++ b/tests/cases/libs/controllers/templates/rescues/_request_and_response.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + */ +class RequestAndResponseLibsCtrlTplRescuesTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/rescues/diagnostics.test.php b/tests/cases/libs/controllers/templates/rescues/diagnostics.test.php new file mode 100644 index 000000000..58eff42e3 --- /dev/null +++ b/tests/cases/libs/controllers/templates/rescues/diagnostics.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DiagnosticsLibsCtrlTplRescuesTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/rescues/layout.test.php b/tests/cases/libs/controllers/templates/rescues/layout.test.php new file mode 100644 index 000000000..181a0edd1 --- /dev/null +++ b/tests/cases/libs/controllers/templates/rescues/layout.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + */ +class LayoutLibsCtrlTplRescuesTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/rescues/missing_template.test.php b/tests/cases/libs/controllers/templates/rescues/missing_template.test.php new file mode 100644 index 000000000..262667474 --- /dev/null +++ b/tests/cases/libs/controllers/templates/rescues/missing_template.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + */ +class MissingTemplateLibsCtrlTplRescuesTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/rescues/routing_error.test.php b/tests/cases/libs/controllers/templates/rescues/routing_error.test.php new file mode 100644 index 000000000..d7745aa0a --- /dev/null +++ b/tests/cases/libs/controllers/templates/rescues/routing_error.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + */ +class RouterErrorLibsCtrlTplRescuesTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/rescues/template_error.test.php b/tests/cases/libs/controllers/templates/rescues/template_error.test.php new file mode 100644 index 000000000..a4ec3c6b6 --- /dev/null +++ b/tests/cases/libs/controllers/templates/rescues/template_error.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + */ +class TemplateErrorLibsCtrlTplRescuesTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/rescues/unknown_action.test.php b/tests/cases/libs/controllers/templates/rescues/unknown_action.test.php new file mode 100644 index 000000000..d7eb80afd --- /dev/null +++ b/tests/cases/libs/controllers/templates/rescues/unknown_action.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.rescues + * @since CakePHP Test Suite v 1.0.0.0 + */ +class UnknownActionLibsCtrlTplRescuesTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/scaffolds/edit.test.php b/tests/cases/libs/controllers/templates/scaffolds/edit.test.php new file mode 100644 index 000000000..0b97c028e --- /dev/null +++ b/tests/cases/libs/controllers/templates/scaffolds/edit.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + */ +class EditLibsCtrlTplScaffoldTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/scaffolds/list.test.php b/tests/cases/libs/controllers/templates/scaffolds/list.test.php new file mode 100644 index 000000000..6177062de --- /dev/null +++ b/tests/cases/libs/controllers/templates/scaffolds/list.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ListLibsCtrlTplScaffoldTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/scaffolds/new.test.php b/tests/cases/libs/controllers/templates/scaffolds/new.test.php new file mode 100644 index 000000000..072e8592a --- /dev/null +++ b/tests/cases/libs/controllers/templates/scaffolds/new.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + */ +class NewLibsCtrlTplScaffoldTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/scaffolds/scaffold.test.php b/tests/cases/libs/controllers/templates/scaffolds/scaffold.test.php new file mode 100644 index 000000000..8a848e103 --- /dev/null +++ b/tests/cases/libs/controllers/templates/scaffolds/scaffold.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ScaffoldLibsCtrlTplScaffoldTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/controllers/templates/scaffolds/show.test.php b/tests/cases/libs/controllers/templates/scaffolds/show.test.php new file mode 100644 index 000000000..6d32d382c --- /dev/null +++ b/tests/cases/libs/controllers/templates/scaffolds/show.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.controllers.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ShowLibsCtrlTplScaffoldTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/dbo.test.php b/tests/cases/libs/dbo.test.php new file mode 100644 index 000000000..3500cd4d2 --- /dev/null +++ b/tests/cases/libs/dbo.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DboTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/dbo/dbo_adodb.test.php b/tests/cases/libs/dbo/dbo_adodb.test.php new file mode 100644 index 000000000..eac94274e --- /dev/null +++ b/tests/cases/libs/dbo/dbo_adodb.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DboAdodbTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/dbo/dbo_generic.test.php b/tests/cases/libs/dbo/dbo_generic.test.php new file mode 100644 index 000000000..22b0c5528 --- /dev/null +++ b/tests/cases/libs/dbo/dbo_generic.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DboGenericTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/dbo/dbo_mysql.test.php b/tests/cases/libs/dbo/dbo_mysql.test.php new file mode 100644 index 000000000..af45ad322 --- /dev/null +++ b/tests/cases/libs/dbo/dbo_mysql.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DboMysqlTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/dbo/dbo_pear.test.php b/tests/cases/libs/dbo/dbo_pear.test.php new file mode 100644 index 000000000..6bebfcbdb --- /dev/null +++ b/tests/cases/libs/dbo/dbo_pear.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DboPearTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/dbo/dbo_postgres.test.php b/tests/cases/libs/dbo/dbo_postgres.test.php new file mode 100644 index 000000000..3f4e3185d --- /dev/null +++ b/tests/cases/libs/dbo/dbo_postgres.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DboPostgresTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/dbo/dbo_sqlite.test.php b/tests/cases/libs/dbo/dbo_sqlite.test.php new file mode 100644 index 000000000..a3f086f86 --- /dev/null +++ b/tests/cases/libs/dbo/dbo_sqlite.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.dbo + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DboSqliteTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/dbo_factory.test.php b/tests/cases/libs/dbo_factory.test.php new file mode 100644 index 000000000..c01935e14 --- /dev/null +++ b/tests/cases/libs/dbo_factory.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DboFactoryTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/dispatcher.test.php b/tests/cases/libs/dispatcher.test.php new file mode 100644 index 000000000..7f33463b4 --- /dev/null +++ b/tests/cases/libs/dispatcher.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DispatcherTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/error_messages.test.php b/tests/cases/libs/error_messages.test.php new file mode 100644 index 000000000..f74ef0b6b --- /dev/null +++ b/tests/cases/libs/error_messages.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ErrorMessagesTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/file.test.php b/tests/cases/libs/file.test.php new file mode 100644 index 000000000..2e4bf55a0 --- /dev/null +++ b/tests/cases/libs/file.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FileTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/flay.test.php b/tests/cases/libs/flay.test.php new file mode 100644 index 000000000..85e635a30 --- /dev/null +++ b/tests/cases/libs/flay.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FlayTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/folder.test.php b/tests/cases/libs/folder.test.php new file mode 100644 index 000000000..bf1afd92c --- /dev/null +++ b/tests/cases/libs/folder.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FolderTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/base.test.php b/tests/cases/libs/generator/base.test.php new file mode 100644 index 000000000..6b15cc9f6 --- /dev/null +++ b/tests/cases/libs/generator/base.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + */ +class BaseGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/commands.test.php b/tests/cases/libs/generator/commands.test.php new file mode 100644 index 000000000..7ae003604 --- /dev/null +++ b/tests/cases/libs/generator/commands.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + */ +class CommandsGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/applications/app/app_generator.php b/tests/cases/libs/generator/generators/applications/app/app_generator.php new file mode 100644 index 000000000..706d2c422 --- /dev/null +++ b/tests/cases/libs/generator/generators/applications/app/app_generator.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.applications.app + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.applications.app + * @since CakePHP Test Suite v 1.0.0.0 + */ +class AppGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/controller/controller_generator.test.php b/tests/cases/libs/generator/generators/components/controller/controller_generator.test.php new file mode 100644 index 000000000..ddc6dd23c --- /dev/null +++ b/tests/cases/libs/generator/generators/components/controller/controller_generator.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.controller + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.controller + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ControllerGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/controller/templates/controller.test.php b/tests/cases/libs/generator/generators/components/controller/templates/controller.test.php new file mode 100644 index 000000000..5e2b58e5b --- /dev/null +++ b/tests/cases/libs/generator/generators/components/controller/templates/controller.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.controller.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.controller.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ControllerComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/controller/templates/functional_test.test.php b/tests/cases/libs/generator/generators/components/controller/templates/functional_test.test.php new file mode 100644 index 000000000..3fe5b6138 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/controller/templates/functional_test.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.controller.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.controller.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FunctionalTestComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/controller/templates/helper.test.php b/tests/cases/libs/generator/generators/components/controller/templates/helper.test.php new file mode 100644 index 000000000..a52a7c63d --- /dev/null +++ b/tests/cases/libs/generator/generators/components/controller/templates/helper.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.controller.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.controller.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class HelperComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/controller/templates/view.test.php b/tests/cases/libs/generator/generators/components/controller/templates/view.test.php new file mode 100644 index 000000000..9c98ef188 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/controller/templates/view.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.controller.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.controller.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ViewComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/model/model_generator.test.php b/tests/cases/libs/generator/generators/components/model/model_generator.test.php new file mode 100644 index 000000000..1a688a9d6 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/model/model_generator.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.model + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.model + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ModelGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/model/templates/fixtures.test.php b/tests/cases/libs/generator/generators/components/model/templates/fixtures.test.php new file mode 100644 index 000000000..e65c6b579 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/model/templates/fixtures.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.model.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.model.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FixturesComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/model/templates/model.test.php b/tests/cases/libs/generator/generators/components/model/templates/model.test.php new file mode 100644 index 000000000..2936575cd --- /dev/null +++ b/tests/cases/libs/generator/generators/components/model/templates/model.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.model.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.model.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ModelComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/model/templates/unit_test.test.php b/tests/cases/libs/generator/generators/components/model/templates/unit_test.test.php new file mode 100644 index 000000000..a16da4fa0 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/model/templates/unit_test.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.model.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.model.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class UnitTestComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/scaffold_generator.test.php b/tests/cases/libs/generator/generators/components/scaffold/scaffold_generator.test.php new file mode 100644 index 000000000..d8c985407 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/scaffold_generator.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ScaffoldGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/templates/controller.test.php b/tests/cases/libs/generator/generators/components/scaffold/templates/controller.test.php new file mode 100644 index 000000000..70b1097a0 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/templates/controller.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ControllerScaffoldComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/templates/form.test.php b/tests/cases/libs/generator/generators/components/scaffold/templates/form.test.php new file mode 100644 index 000000000..a58cfc8be --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/templates/form.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FormScaffoldComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/templates/form_scaffolding.test.php b/tests/cases/libs/generator/generators/components/scaffold/templates/form_scaffolding.test.php new file mode 100644 index 000000000..06c77532c --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/templates/form_scaffolding.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FormScaffoldingScaffoldComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/templates/functional_test.test.php b/tests/cases/libs/generator/generators/components/scaffold/templates/functional_test.test.php new file mode 100644 index 000000000..aa7da6c06 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/templates/functional_test.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FunctionalTestScaffoldComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/templates/helper.test.php b/tests/cases/libs/generator/generators/components/scaffold/templates/helper.test.php new file mode 100644 index 000000000..484da4df4 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/templates/helper.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class HelperScaffoldComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/templates/layout.test.php b/tests/cases/libs/generator/generators/components/scaffold/templates/layout.test.php new file mode 100644 index 000000000..317ca180d --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/templates/layout.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class LayoutScaffoldComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/templates/view_edit.test.php b/tests/cases/libs/generator/generators/components/scaffold/templates/view_edit.test.php new file mode 100644 index 000000000..33bbe5171 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/templates/view_edit.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ViewEditScaffoldComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/templates/view_list.test.php b/tests/cases/libs/generator/generators/components/scaffold/templates/view_list.test.php new file mode 100644 index 000000000..79ac3ddd2 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/templates/view_list.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ViewListScaffoldComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/templates/view_new.test.php b/tests/cases/libs/generator/generators/components/scaffold/templates/view_new.test.php new file mode 100644 index 000000000..ffa3125fa --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/templates/view_new.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ViewNewScaffoldComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/scaffold/templates/view_show.test.php b/tests/cases/libs/generator/generators/components/scaffold/templates/view_show.test.php new file mode 100644 index 000000000..15cc06d88 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/scaffold/templates/view_show.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.scaffold.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ViewShowScaffoldComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/web/templates/api_definition.test.php b/tests/cases/libs/generator/generators/components/web/templates/api_definition.test.php new file mode 100644 index 000000000..ad8d724ec --- /dev/null +++ b/tests/cases/libs/generator/generators/components/web/templates/api_definition.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.web.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.web.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ApiDefinitionWebComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/web/templates/controller.test.php b/tests/cases/libs/generator/generators/components/web/templates/controller.test.php new file mode 100644 index 000000000..b247691ab --- /dev/null +++ b/tests/cases/libs/generator/generators/components/web/templates/controller.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.web.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.web.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ControllerWebComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/web/templates/functional_test.test.php b/tests/cases/libs/generator/generators/components/web/templates/functional_test.test.php new file mode 100644 index 000000000..4a924ac11 --- /dev/null +++ b/tests/cases/libs/generator/generators/components/web/templates/functional_test.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.web.templates + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.web.templates + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FunctionalTestWebComponenetsTplTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/generators/components/web/web_generator.test.php b/tests/cases/libs/generator/generators/components/web/web_generator.test.php new file mode 100644 index 000000000..be54d9ddc --- /dev/null +++ b/tests/cases/libs/generator/generators/components/web/web_generator.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.web + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.generators.componenets.web + * @since CakePHP Test Suite v 1.0.0.0 + */ +class WebGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/lookup.test.php b/tests/cases/libs/generator/lookup.test.php new file mode 100644 index 000000000..d8e6b70fb --- /dev/null +++ b/tests/cases/libs/generator/lookup.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + */ +class LookupGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/manifest.test.php b/tests/cases/libs/generator/manifest.test.php new file mode 100644 index 000000000..82bac0dbc --- /dev/null +++ b/tests/cases/libs/generator/manifest.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ManifestGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/options.test.php b/tests/cases/libs/generator/options.test.php new file mode 100644 index 000000000..19ebec6cb --- /dev/null +++ b/tests/cases/libs/generator/options.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + */ +class OptionsGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/scripts.test.php b/tests/cases/libs/generator/scripts.test.php new file mode 100644 index 000000000..ca9dfedb5 --- /dev/null +++ b/tests/cases/libs/generator/scripts.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ScriptsGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/scripts/destroy.test.php b/tests/cases/libs/generator/scripts/destroy.test.php new file mode 100644 index 000000000..6ba088eb2 --- /dev/null +++ b/tests/cases/libs/generator/scripts/destroy.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.scripts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.scripts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class DestroyScriptsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/scripts/generate.test.php b/tests/cases/libs/generator/scripts/generate.test.php new file mode 100644 index 000000000..95a950375 --- /dev/null +++ b/tests/cases/libs/generator/scripts/generate.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.scripts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.scripts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class GenerateScriptsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/scripts/update.test.php b/tests/cases/libs/generator/scripts/update.test.php new file mode 100644 index 000000000..23c67d15b --- /dev/null +++ b/tests/cases/libs/generator/scripts/update.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator.scripts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator.scripts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class UpdateScriptsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/simple_logger.test.php b/tests/cases/libs/generator/simple_logger.test.php new file mode 100644 index 000000000..d4c06cbec --- /dev/null +++ b/tests/cases/libs/generator/simple_logger.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + */ +class SimpleLoggerGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/generator/spec.test.php b/tests/cases/libs/generator/spec.test.php new file mode 100644 index 000000000..35f094aec --- /dev/null +++ b/tests/cases/libs/generator/spec.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.generator + * @since CakePHP Test Suite v 1.0.0.0 + */ +class SpecGeneratorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/helper.test.php b/tests/cases/libs/helper.test.php new file mode 100644 index 000000000..d1d333784 --- /dev/null +++ b/tests/cases/libs/helper.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class HelperTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/helpers/acl.test.php b/tests/cases/libs/helpers/acl.test.php new file mode 100644 index 000000000..f9ccd9a80 --- /dev/null +++ b/tests/cases/libs/helpers/acl.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + */ +class AclHelpersTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/helpers/ajax.test.php b/tests/cases/libs/helpers/ajax.test.php new file mode 100644 index 000000000..5c1f864bd --- /dev/null +++ b/tests/cases/libs/helpers/ajax.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + */ +class AjaxHelpersTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/helpers/form.test.php b/tests/cases/libs/helpers/form.test.php new file mode 100644 index 000000000..86ffc04c7 --- /dev/null +++ b/tests/cases/libs/helpers/form.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + */ +class FormHelpersTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/helpers/html.test.php b/tests/cases/libs/helpers/html.test.php new file mode 100644 index 000000000..0529573d6 --- /dev/null +++ b/tests/cases/libs/helpers/html.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + */ +class HtmlHelpersTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/helpers/number.test.php b/tests/cases/libs/helpers/number.test.php new file mode 100644 index 000000000..6f6789abd --- /dev/null +++ b/tests/cases/libs/helpers/number.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + */ +class NumberHelpersTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/helpers/text.test.php b/tests/cases/libs/helpers/text.test.php new file mode 100644 index 000000000..c30435fc1 --- /dev/null +++ b/tests/cases/libs/helpers/text.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.helpers + * @since CakePHP Test Suite v 1.0.0.0 + */ +class TextHelpersTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/inflector.test.php b/tests/cases/libs/inflector.test.php new file mode 100644 index 000000000..8bd5b45c9 --- /dev/null +++ b/tests/cases/libs/inflector.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class InflectorTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/legacy.test.php b/tests/cases/libs/legacy.test.php new file mode 100644 index 000000000..4ce2a5e2b --- /dev/null +++ b/tests/cases/libs/legacy.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class LegacyTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/log.test.php b/tests/cases/libs/log.test.php new file mode 100644 index 000000000..fa286725d --- /dev/null +++ b/tests/cases/libs/log.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class LogTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/model.test.php b/tests/cases/libs/model.test.php new file mode 100644 index 000000000..c34d42125 --- /dev/null +++ b/tests/cases/libs/model.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ModelTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/model_collection.test.php b/tests/cases/libs/model_collection.test.php new file mode 100644 index 000000000..ccf606868 --- /dev/null +++ b/tests/cases/libs/model_collection.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ModelCollectionTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/neat_array.test.php b/tests/cases/libs/neat_array.test.php new file mode 100644 index 000000000..2deb78468 --- /dev/null +++ b/tests/cases/libs/neat_array.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class NeatArrayTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/neat_string.test.php b/tests/cases/libs/neat_string.test.php new file mode 100644 index 000000000..c1c47f569 --- /dev/null +++ b/tests/cases/libs/neat_string.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class NeatStringTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/object.test.php b/tests/cases/libs/object.test.php new file mode 100644 index 000000000..b490d9e6d --- /dev/null +++ b/tests/cases/libs/object.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ObjectTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/router.test.php b/tests/cases/libs/router.test.php new file mode 100644 index 000000000..9972dd238 --- /dev/null +++ b/tests/cases/libs/router.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class RouterTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/sanitize.test.php b/tests/cases/libs/sanitize.test.php new file mode 100644 index 000000000..caff81217 --- /dev/null +++ b/tests/cases/libs/sanitize.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class SanitizeTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/scaffold.test.php b/tests/cases/libs/scaffold.test.php new file mode 100644 index 000000000..9a1dd9553 --- /dev/null +++ b/tests/cases/libs/scaffold.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ScaffoldTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/template.test.php b/tests/cases/libs/template.test.php new file mode 100644 index 000000000..08f8a88ff --- /dev/null +++ b/tests/cases/libs/template.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class TemplateTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/time.test.php b/tests/cases/libs/time.test.php new file mode 100644 index 000000000..9d50cb4f8 --- /dev/null +++ b/tests/cases/libs/time.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class TimeTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/validators.test.php b/tests/cases/libs/validators.test.php new file mode 100644 index 000000000..a99788fab --- /dev/null +++ b/tests/cases/libs/validators.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ValidatorsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/view.test.php b/tests/cases/libs/view.test.php new file mode 100644 index 000000000..c755f11e5 --- /dev/null +++ b/tests/cases/libs/view.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ViewTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/web/templates/scaffolds/layout.test.php b/tests/cases/libs/web/templates/scaffolds/layout.test.php new file mode 100644 index 000000000..48559a306 --- /dev/null +++ b/tests/cases/libs/web/templates/scaffolds/layout.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.web.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.web.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + */ +class LayoutWebTplScaffoldTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/web/templates/scaffolds/methods.test.php b/tests/cases/libs/web/templates/scaffolds/methods.test.php new file mode 100644 index 000000000..b7514451b --- /dev/null +++ b/tests/cases/libs/web/templates/scaffolds/methods.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.web.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.web.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + */ +class MethodsWebTplScaffoldTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/web/templates/scaffolds/parameters.test.php b/tests/cases/libs/web/templates/scaffolds/parameters.test.php new file mode 100644 index 000000000..178f18798 --- /dev/null +++ b/tests/cases/libs/web/templates/scaffolds/parameters.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.web.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.web.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ParametersWebTplScaffoldTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/libs/web/templates/scaffolds/result.test.php b/tests/cases/libs/web/templates/scaffolds/result.test.php new file mode 100644 index 000000000..a7bbfcecd --- /dev/null +++ b/tests/cases/libs/web/templates/scaffolds/result.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.libs.web.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.libs.web.templates.scaffold + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ResultsWebTplScaffoldTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/logs/logs.test.php b/tests/cases/logs/logs.test.php new file mode 100644 index 000000000..e6e1af99c --- /dev/null +++ b/tests/cases/logs/logs.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.logs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.logs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class LogsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/modules/modules.test.php b/tests/cases/modules/modules.test.php new file mode 100644 index 000000000..acad1c044 --- /dev/null +++ b/tests/cases/modules/modules.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.modules + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.modules + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ModulesTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/public/css/css.test.php b/tests/cases/public/css/css.test.php new file mode 100644 index 000000000..4f0b85922 --- /dev/null +++ b/tests/cases/public/css/css.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.public.css + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.public.css + * @since CakePHP Test Suite v 1.0.0.0 + */ +class PublicCssTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/public/files/files.test.php b/tests/cases/public/files/files.test.php new file mode 100644 index 000000000..f01206fa4 --- /dev/null +++ b/tests/cases/public/files/files.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.public.files + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.public.files + * @since CakePHP Test Suite v 1.0.0.0 + */ +class PublicFilesTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/public/img/img.test.php b/tests/cases/public/img/img.test.php new file mode 100644 index 000000000..42c3e4c28 --- /dev/null +++ b/tests/cases/public/img/img.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.public.img + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.public.img + * @since CakePHP Test Suite v 1.0.0.0 + */ +class ImageFileTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/public/js/js.test.php b/tests/cases/public/js/js.test.php new file mode 100644 index 000000000..6371ce1fa --- /dev/null +++ b/tests/cases/public/js/js.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.public.js + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.public.js + * @since CakePHP Test Suite v 1.0.0.0 + */ +class JavasScriptTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/public/public.test.php b/tests/cases/public/public.test.php new file mode 100644 index 000000000..6fa205ebb --- /dev/null +++ b/tests/cases/public/public.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.public + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.public + * @since CakePHP Test Suite v 1.0.0.0 + */ +class PublicTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/scripts/bake.bat.test.php b/tests/cases/scripts/bake.bat.test.php new file mode 100644 index 000000000..d8bc07549 --- /dev/null +++ b/tests/cases/scripts/bake.bat.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.scripts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.scripts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class BakeBatScriptsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/scripts/bake.test.php b/tests/cases/scripts/bake.test.php new file mode 100644 index 000000000..49fd01384 --- /dev/null +++ b/tests/cases/scripts/bake.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.scripts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.scripts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class BakeScriptsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/scripts/cake_generator/generators/applications/app/cake_generator_applications_app.test.php b/tests/cases/scripts/cake_generator/generators/applications/app/cake_generator_applications_app.test.php new file mode 100644 index 000000000..431c40fc3 --- /dev/null +++ b/tests/cases/scripts/cake_generator/generators/applications/app/cake_generator_applications_app.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.scripts.cake_generator.applications.app + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.scripts.cake_generator.applications.app + * @since CakePHP Test Suite v 1.0.0.0 + */ +class CakeGeneratorApplicationsAppTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/scripts/cake_generator/generators/applications/cake_generator_applications.test.php b/tests/cases/scripts/cake_generator/generators/applications/cake_generator_applications.test.php new file mode 100644 index 000000000..1c2444662 --- /dev/null +++ b/tests/cases/scripts/cake_generator/generators/applications/cake_generator_applications.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.scripts.cake_generator.applications + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.scripts.cake_generator.applications + * @since CakePHP Test Suite v 1.0.0.0 + */ +class CakeGeneratorApplicationsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/scripts/cake_generator/scripts/cake_generator_scripts.test.php b/tests/cases/scripts/cake_generator/scripts/cake_generator_scripts.test.php new file mode 100644 index 000000000..71bf99b17 --- /dev/null +++ b/tests/cases/scripts/cake_generator/scripts/cake_generator_scripts.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.scripts.cake_generator.scripts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.scripts.cake_generator.scripts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class CakeGeneratorScriptsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/scripts/test.bat.test.php b/tests/cases/scripts/test.bat.test.php new file mode 100644 index 000000000..bc1f7de1c --- /dev/null +++ b/tests/cases/scripts/test.bat.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.scripts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.scripts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class TestBatScriptsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/cases/scripts/test.test.php b/tests/cases/scripts/test.test.php new file mode 100644 index 000000000..c84980541 --- /dev/null +++ b/tests/cases/scripts/test.test.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.cases.scripts + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.cases.scripts + * @since CakePHP Test Suite v 1.0.0.0 + */ +class TestScriptsTest extends UnitTestCase +{ +} + +?> \ No newline at end of file diff --git a/tests/groups/AllButExamplesTest.group.php b/tests/groups/AllButExamplesTest.group.php new file mode 100644 index 000000000..f08fcfae5 --- /dev/null +++ b/tests/groups/AllButExamplesTest.group.php @@ -0,0 +1,56 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Load Test Manager Class + */ +require_once TESTS .'suite_libs/TestManager.php'; + +/** AllButExamplesTest + * + * This test group will run all test in the cases + * directory with the exception of examples in the + * examples directory. + * + * @todo implement, nothing coded yet!!! + * + * @package test_suite + * @subpackage test_suite.cases.app + * @since CakePHP Test Suite v 1.0.0.0 + */ +class AllButExamplesTest extends GroupTest +{ + function AllButExamplesTest() + { + } +} + +?> \ No newline at end of file diff --git a/tests/libs/controller.php b/tests/libs/controller.php deleted file mode 100644 index b7b8cdaad..000000000 --- a/tests/libs/controller.php +++ /dev/null @@ -1,100 +0,0 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * - * @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.tests.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - * - */ - -/** - * Basic defines - */ -uses('controller'); - -/** - * Enter description here... - * - * @package cake - * @subpackage cake.tests.libs - * @since CakePHP v .9 - * - */ -class ControllerTest extends UnitTestCase -{ -/** - * Enter description here... - * - * @var unknown_type - */ - var $controller; - - -/** - * constructor of the test suite. - * - * @return ControllerTest - */ - function ControllerTest() - { - $this->UnitTestCase('Controller test'); - } - - -/** - * called before the test functions will be executed - * this function is defined in PHPUnit_TestCase and overwritten - * here - * - */ - function setUp() - { - $this->controller = new Controller(); - $this->controller->base = '/ease'; - - $data = array('foo'=>'foo_value', 'foobar'=>'foobar_value', 'tofu'=>'1'); - $params = array('controller'=>'Test', 'action'=>'test_action', 'data'=>$data); - $here = '/cake/test'; - $this->controller->params = $params; - $this->controller->data = $data; - $this->controller->here = $here; - - $this->controller->action = $this->controller->params['action']; - $this->controller->passed_args = null; - } - -/** - * called after the test functions are executed - * this function is defined in PHPUnit_TestCase and overwritten - * here - */ - function tearDown() - { - unset($this->controller); - } -} - -?> \ No newline at end of file diff --git a/tests/libs/dbo.php b/tests/libs/dbo.php deleted file mode 100644 index c03d032a5..000000000 --- a/tests/libs/dbo.php +++ /dev/null @@ -1,176 +0,0 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * - * @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.tests.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - * - */ - -/** - * Basic defines - */ -uses('dbo_factory'); - -class DboTest extends UnitTestCase -{ -/** - * Enter description here... - * - * @var unknown_type - */ - var $dbo; - -/** - * Enter description here... - * - * @return DboTest - */ - function DboTest() - { - $this->UnitTestCase('DBO test'); - } - -/** - * Enter description here... - * - */ - function setUp() - { - $this->dbo = DBO::getInstance('test'); - - $this->createTemporaryTable(); - } - -/** - * Enter description here... - * - * @return unknown - */ - function tearDown() - { - if(!$this->dbo) return false; - - $this->dropTemporaryTable(); - } - -/** - * Enter description here... - * - * @return unknown - */ - function createTemporaryTable() - { - if(!$this->dbo) return false; - - if($this->dbo->config['driver'] == 'postgres') - $sql = 'CREATE TABLE __test(id serial NOT NULL, body CHARACTER VARYING(255))'; - else - $sql = 'CREATE TABLE __test(id INT UNSIGNED PRIMARY KEY, body VARCHAR(255))'; - - return $this->dbo->query($sql); - } - -/** - * Enter description here... - * - * @return unknown - */ - function dropTemporaryTable() - { - if(!$this->dbo) return false; - - return $this->dbo->query("DROP TABLE __test"); - } - -/** - * Enter description here... - * - * @return unknown - */ - function testHasImplementation() - { - if(!$this->dbo) return false; - - $functions = array( - 'connect', - 'disconnect', - 'execute', - 'fetchRow', - 'tables', - 'fields', - 'prepare', - 'lastError', - 'lastAffected', - 'lastNumRows', - 'lastInsertId' - ); - - foreach($functions as $function) - { - $this->assertTrue(method_exists($this->dbo, $function)); - } - } - -/** - * Enter description here... - * - * @return unknown - */ - function testConnectivity() - { - if(!$this->dbo) return false; - - $this->assertTrue($this->dbo->connected); - } - -/** - * Enter description here... - * - * @return unknown - */ - function testFields() - { - if(!$this->dbo) return false; - - $fields = $this->dbo->fields('__test'); - $this->assertEqual(count($fields), 2, 'equals'); - } - -/** - * Enter description here... - * - * @return unknown - */ - function testTables() - { - if(!$this->dbo) return false; - - $this->assertTrue(in_array('__test', $this->dbo->tables())); - } -} - -?> \ No newline at end of file diff --git a/tests/libs/dbo_factory.php b/tests/libs/dbo_factory.php deleted file mode 100644 index c3c87ed59..000000000 --- a/tests/libs/dbo_factory.php +++ /dev/null @@ -1,133 +0,0 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * - * @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.tests.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - * - */ - -/** - * - */ -uses('dbo_factory'); -/** - * Enter description here... - * - * @package cake - * @subpackage cake.tests.libs - * @since CakePHP v .9 - * - */ -class DboFactoryTest extends UnitTestCase -{ -/** - * Enter description here... - * - * @var unknown_type - */ - var $dboFactory; - - -/** - * Enter description here... - * - * @return DboFactoryTest - */ - function DboFactoryTest() - { - $this->UnitTestCase('DBO Factory test'); - } - - // called before the test functions will be executed - // this function is defined in PHPUnit_TestCase and overwritten - // here - -/** - * Enter description here... - * - */ - //function setUp() - //{ - // $this->dboFactory = new DboFactory(); - //} - - -/** - * Enter description here... - * - */ - //function tearDown() - //{ - // unset($this->dboFactory); - //} - -/** - * Enter description here... - * - */ - //function testMake() - //{ - // if(class_exists('DATABASE_CONFIG')) - // { - - // $output = $this->dboFactory->make('test'); - // $this->assertTrue(is_object($output), 'We create dbo factory object'); - // - // $config = DATABASE_CONFIG::test(); - // if(preg_match('#^(adodb)_.*$#i', $config['driver'], $res)) - // { - // $desiredDriverName = $res[1]; - // } - // else - // { - // $desiredDriverName = $config['driver']; - // } - - // $desiredClassName = 'dbo_'.strtolower($desiredDriverName); - // $outputClassName = is_object($output)? strtolower(get_class($output)): false; - - // $this->assertEqual($outputClassName, $desiredClassName, "Class name should be $desiredClassName - is $outputClassName"); - - // $this->assertTrue($output->connected, 'We are connected'); - // } - //} - - // this test expect an E_USER_ERROR to occur during it's run - // I've disabled it until I find a way to assert it happen - // - -/** - * Enter description here... - * - */ - // function testBadConfig() { - // $output = $this->dboFactory->make(null); - // $this->assertTrue($output === false); - //} -} - -?> \ No newline at end of file diff --git a/tests/libs/flay.php b/tests/libs/flay.php deleted file mode 100644 index 19e71d46c..000000000 --- a/tests/libs/flay.php +++ /dev/null @@ -1,156 +0,0 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * - * @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.tests.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - * - */ - -/** - * - */ -uses ('flay'); -/** - * Enter description here... - * - * @package cake - * @subpackage cake.tests.libs - * @since CakePHP v .9 - * - */ -class FlayTest extends UnitTestCase -{ -/** - * Enter description here... - * - * @var unknown_type - */ - var $flay; - -/** - * Enter description here... - * - * @return FlayTest - */ - function FlayTest() - { - $this->UnitTestCase('Flay test'); - } - -/** - * Enter description here... - * - */ - function setUp() - { - $this->flay = new Flay (); - } - -/** - * Enter description here... - * - */ - function tearDown() - { - unset($this->flay); - } - - -/** - * Enter description here... - * - */ - function testToHtml() - { - $tests_to_html = array( - array( - 'text'=>"", - 'html'=>"" - ), - array( - 'text'=>"This is a text.", - 'html'=>"

    This is a text.

    \n" - ), - array( - 'text'=>"This is a line.\n\n\nThis is\n another one.\n\n", - 'html'=>"

    This is a line.

    \n

    This is
    \n another one.

    \n" - ), - array( - 'text'=>"This line has *bold*, _italic_, and a _combo *bold* and italic_ texts.", - 'html'=>"

    This line has bold, italic, and a combo bold and italic texts.

    \n" - ), - array( - 'text'=>"This line has tags which are
    not allowed.", - 'html'=>"

    This line has <b>tags</b> which are <br />not allowed.

    \n", - ), - array( - 'text'=>"[http://sputnik.pl] is a link, but so is [http://sputnik.pl/bla/ this one], and [this is not.", - 'html'=>"

    http://sputnik.pl is a link, but so is this one, and [this is not.

    \n" - ), - array( - 'text'=>"Why don't we try to insert an image.\n\n[http://sputnik.pl/test.jpg]", - 'html'=>"

    Why don't we try to insert an image.

    \n

    \"\"

    \n" - ), - array( - 'text'=>"Auto-link my.name+real@my-server.com and example@example.com, should work.", - 'html'=>"

    Auto-link my.name+real@my-server.com and example@example.com, should work.

    \n" - ), - array( - 'text'=>"\"\"\"This is a blockquote\"\"\"", - 'html'=>"
    \n

    This is a blockquote

    \n
    \n" - ), - array( - 'text'=>"How about a blockquote?\"\"\"This is a multiline blockquote.\n\nThis is the second line.\"\"\"\nAnd this is not.", - 'html'=>"

    How about a blockquote?

    \n
    \n

    This is a multiline blockquote.

    \n

    This is the second line.

    \n
    \n

    And this is not.

    \n" - ), - array( - 'text'=>"Now auto-link an url such as http://sputnik.pl or www.robocik-malowany.com/dupa[4] - or any other.", - 'html'=>"

    Now auto-link an url such as http://sputnik.pl or www.robocik-malowany.com/dupa[4] – or any other.

    \n" - ), - array( - 'text'=>"===This be centered===", - 'html'=>"
    \n

    This be centered

    \n
    \n" - ), - array( - 'text'=>"===This be centered.\n\nAnd this be centered too,\nalong with this.===\nThis, alas, be not.", - 'html'=>"
    \n

    This be centered.

    \n

    And this be centered too,
    \nalong with this.

    \n
    \n

    This, alas, be not.

    \n" - ), - array( - 'text'=>"This tests (C)2004 Someone Else, \"Layer Your Apps(R)\" and Cake(TM).", - 'html'=>"

    This tests ©2004 Someone Else, \"Layer Your Apps®\" and Cake™.

    \n" - ), - ); - - foreach ($tests_to_html as $test) - { - $this->assertEqual($this->flay->toHtml($test['text']), $test['html']); - } - } -} - - -?> \ No newline at end of file diff --git a/tests/libs/folder.php b/tests/libs/folder.php deleted file mode 100644 index 6741bd39e..000000000 --- a/tests/libs/folder.php +++ /dev/null @@ -1,262 +0,0 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * - * @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.tests.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - * - */ - -/** - * - */ -uses('folder'); -/** - * Enter description here... - * - * @package cake - * @subpackage cake.tests.libs - * @since CakePHP v .9 - * - */ -class FolderTest extends UnitTestCase -{ -/** - * Enter description here... - * - * @var unknown_type - */ - var $folder; -/** - * Enter description here... - * - * @var unknown_type - */ - var $testDir; - -/** - * Enter description here... - * - * @return FolderTest - */ - function FolderTest() - { - $this->UnitTestCase('Folder test'); - } - -/** - * Enter description here... - * - */ - function setUp() - { - $this->testDir = ROOT.'tmp'.DS.'tests'; - - touch($this->testDir.DS.'.htaccess'); - chmod($this->testDir.DS.'.htaccess', 0777); - if (!is_dir($this->testDir.DS.'dir1')) - { - mkdir($this->testDir.DS.'dir1', 0777); - } - touch($this->testDir.DS.'dir1'.DS.'test1.php'); - chmod($this->testDir.DS.'dir1'.DS.'test1.php', 0777); - - if (!is_dir($this->testDir.DS.'dir2')) - { - mkdir($this->testDir.DS.'dir2', 0777); - } - touch($this->testDir.DS.'dir2'.DS.'test2.php'); - chmod($this->testDir.DS.'dir2'.DS.'test2.php', 0777); - - - $this->folder = new Folder($this->testDir); - } - -/** - * Enter description here... - * - */ - function tearDown() - { - unlink($this->testDir.DS.'.htaccess'); - unlink($this->testDir.DS.'dir1'.DS.'test1.php'); - unlink($this->testDir.DS.'dir2'.DS.'test2.php'); - - rmdir($this->testDir.DS.'dir1'); - rmdir($this->testDir.DS.'dir2'); - - unset($this->folder); - } - - -/** - * Enter description here... - * - */ - function testLs() - { - $result = $this->folder->ls(); - $expected = array ( - array('.svn', 'dir1', 'dir2'), - array('.htaccess') - ); - - $this->assertEqual($result, $expected, "List directories and files from test dir"); - } - -/** - * Enter description here... - * - */ - function testPwd() - { - $result = $this->folder->pwd(); - - $this->assertEqual($result, $this->testDir, 'Print current path (test dir)'); - } - -/** - * Enter description here... - * - */ - function testCd() - { - $this->folder->cd($this->testDir); - $result = $this->folder->pwd(); - $this->assertEqual($result, $this->testDir, 'Change directory to the actual one'); - - //THIS ONE IS HACKED... why do i need to give a full path to this method? - $this->folder->cd($this->testDir.DS.'dir1'); - $result = $this->folder->pwd(); - - $this->assertEqual($result, Folder::addPathElement($this->testDir, 'dir1'), 'Change directory to dir1'); - } - -/** - * Enter description here... - * - */ - function testFindRecursive() - { - $result = $this->folder->findRecursive('.*\.php'); - $expected = array(Folder::addPathElement($this->folder->pwd().DS.'dir1', 'test1.php'), Folder::addPathElement($this->folder->pwd().DS.'dir2', 'test2.php')); - - $this->assertEqual($result, $expected, 'Find .php files'); - } - -/** - * Enter description here... - * - */ - function testIsWindowsPath() - { - $result = Folder::isWindowsPath('C:\foo'); - $expected = true; - $this->assertEqual($result, $expected); - - $result = Folder::isWindowsPath('/foo/bar'); - $expected = false; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testIsAbsolute() - { - $result = Folder::isAbsolute('foo/bar'); - $expected = false; - $this->assertEqual($result, $expected); - - $result = Folder::isAbsolute('c:\foo\bar'); - $expected = true; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testAddPathElement() - { - $result = Folder::addPathElement('c:\foo', 'bar'); - $expected = 'c:\foo\bar'; - $this->assertEqual($result, $expected); - - $result = Folder::addPathElement('C:\foo\bar\\', 'baz'); - $expected = 'C:\foo\bar\baz'; - $this->assertEqual($result, $expected); - - $result = Folder::addPathElement('/foo/bar/', 'baz'); - $expected = '/foo/bar/baz'; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testIsSlashTerm() - { - $result = Folder::isSlashTerm('/foo/bar/'); - $this->assertEqual($result, true); - - $result = Folder::isSlashTerm('/foo/bar'); - $this->assertEqual($result, false); - } - -/** - * Enter description here... - * - */ - function testCorrectSlashFor() - { - $result = Folder::correctSlashFor('/foo/bar/'); - $this->assertEqual($result, '/'); - - $result = Folder::correctSlashFor('C:\foo\bar'); - $this->assertEqual($result, '\\'); - } - -/** - * Enter description here... - * - */ - function testSlashTerm() - { - $result = Folder::slashTerm('/foo/bar/'); - $this->assertEqual($result, '/foo/bar/'); - - $result = Folder::slashTerm('/foo/bar'); - $this->assertEqual($result, '/foo/bar/'); - - $result = Folder::slashTerm('C:\foo\bar'); - $this->assertEqual($result, 'C:\foo\bar\\'); - } -} - -?> \ No newline at end of file diff --git a/tests/libs/helpers/html.php b/tests/libs/helpers/html.php deleted file mode 100644 index cdf1f9746..000000000 --- a/tests/libs/helpers/html.php +++ /dev/null @@ -1,409 +0,0 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * - * @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.tests.libs.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 - * - */ - -/** - * Basic defines - */ -uses('helpers/html'); -/** - * Enter description here... - * - * @package cake - * @subpackage cake.tests.libs.helpers - * @since CakePHP v .9 - * - */ -class HtmlHelperTest extends UnitTestCase -{ -/** - * Enter description here... - * - * @var unknown_type - */ - var $html; - - -/** - * constructor of the test suite - * - */ - function ControllerTest() - { - $this->UnitTestCase('Html helper test'); - } - -/** - * Enter description here... - * - */ - function setUp() - { - $this->html = new HtmlHelper(); - - $this->html->base = '/ease'; - - $data = array('foo'=>'foo_value', 'foobar'=>'foobar_value', 'tofu'=>'1'); - $params = array('controller'=>'Test', 'action'=>'test_action', 'data'=>$data); - $here = '/cake/test'; - $this->html->params = $params; - $this->html->data = $data; - $this->html->here = $here; - - $this->html->action = $this->html->params['action']; - $this->html->passed_args = null; - } - -/** - * Enter description here... - * - */ - function tearDown() - { - unset($this->html); - } - -/** - * Enter description here... - * - */ - function testTrim() - { - $expected = 'Long ...'; - $result = $this->html->trim('Long string', 5, '...'); - $this->assertEqual($expected, $result); - } - -/** - * Enter description here... - * - */ - function testUrlFor() - { - $result = $this->html->urlFor('/foo/bar'); - $expected = '/ease/foo/bar'; - $this->assertEqual($result, $expected); - - $result = $this->html->urlFor('baz'); - $expected = '/ease/test/baz'; - $this->assertEqual($result, $expected); - - $result = $this->html->urlFor(); - $expected = '/cake/test'; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testParseHtmlOptions() - { - $result = $this->html->parseHtmlOptions(null); - $expected = null; - $this->assertEqual($result, $expected); - - $result = $this->html->parseHtmlOptions(array()); - $expected = null; - $this->assertEqual($result, $expected); - - $result = $this->html->parseHtmlOptions(array('class'=>'foo')); - $expected = ' class="foo"'; - $this->assertEqual($result, $expected); - - $result = $this->html->parseHtmlOptions(array('class'=>'foo', 'id'=>'bar'), array('class')); - $expected = ' id="bar"'; - $this->assertEqual($result, $expected); - - $result = $this->html->parseHtmlOptions(array('class'=>'foo', 'id'=>'bar'), null, '', ' '); - $expected = 'class="foo" id="bar" '; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testLinkTo() - { - $result = $this->html->linkTo('Testing �', '/test/ok', array('style'=>'color:Red'), 'Sure?'); - $expected = 'Testing �'; - $this->assertEqual($result, $expected); - - $result = $this->html->linkTo('Ok', 'ok'); - $expected = 'Ok'; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testLinkOut() - { - $result = $this->html->linkOut('Sputnik.pl', 'http://www.sputnik.pl/', array('style'=>'color:Red')); - $expected = 'Sputnik.pl'; - $this->assertEqual($result, $expected); - - $result = $this->html->linkOut('http://sputnik.pl'); - $expected = 'http://sputnik.pl'; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testFormTag() - { - $result = $this->html->formTag(); - $expected = "
    html->here}\" method=\"post\">"; - $this->assertEqual($result, $expected); - - $result = $this->html->formTag('foo', 'get'); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->html->formTag('/bar/baz', 'file'); - $expected = ''; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testSubmitTag() - { - $result = $this->html->submitTag(); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->html->submitTag('Foo', array('class'=>'Bar')); - $expected = ''; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testInputTag() - { - $result = $this->html->inputTag('foo'); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->html->inputTag('bar', 20, array('class'=>'Foobar')); - $expected = ''; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testPasswordTag() - { - $result = $this->html->passwordTag('foo'); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->html->passwordTag('foo', 33, array('class'=>'Bar')); - $expected = ''; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testHiddenTag() - { - $result = $this->html->hiddenTag('foo'); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->html->hiddenTag('bar', 'baz'); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->html->hiddenTag('foobar', null, array('class'=>'Bar')); - $expected = ''; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testFileTag() - { - $result = $this->html->fileTag('bar', array('class'=>'Foo', 'disabled'=>'1')); - $expected = ''; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testAreaTag() - { - $result = $this->html->areaTag('foo'); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->html->areaTag('foo', 33, 33, array('class'=>'Bar')); - $expected = ''; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testCheckboxTag() - { - $result = $this->html->checkboxTag('bar'); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->html->checkboxTag('tofu', 'ToFu title', array('class'=>'Baz')); - $expected = ''; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testRadioTags() - { - $result = $this->html->radioTags('foo', array('foo'=>'Foo', 'bar'=>'Bar'), '---', array('class'=>'Foo')); - $expected = '---'; - $this->assertEqual($result, $expected); - - $result = $this->html->radioTags('bar', array()); - $expected = null; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testSelectTag() - { - $result = $this->html->selectTag('tofu', array('m'=>'male', 'f'=>'female'), 'm', array('class'=>'Outer'), array('class'=>'Inner', 'id'=>'FooID')); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->html->selectTag('tofu', array()); - $expected = null; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testTableHeaders() - { - $result = $this->html->tableHeaders(array('One', 'Two', 'Three')); - $expected = 'One Two Three'; - $this->assertEqual($result, $expected); - - $result = $this->html->tableHeaders(array('Foo Bar', 'Baz'), array('class'=>'Eco'), array('align'=>'left')); - $expected = 'Foo Bar Baz'; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testTableCells() - { - $result = $this->html->tableCells(array('Foo', 'Bar')); - $expected = 'Foo Bar'; - $this->assertEqual($result, $expected); - - $result = $this->html->tableCells(array(array('Foo','Bar'),array('Baz','Echo'),array('Nul','Pio')), array('class'=>'Mini'), array('align'=>'left')); - $expected = join("\n", array('Foo Bar', 'Baz Echo', 'Nul Pio')); - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testImageTag() - { - $result = $this->html->imageTag('foo.gif'); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->html->imageTag('bar/baz.gif', 'Foobar', array('class'=>'Zet')); - $expected = 'Foobar'; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testTagValue() - { - $result = $this->html->tagValue('foo'); - $expected = 'foo_value'; - $this->assertEqual($result, $expected); - - $result = $this->html->tagValue('bar'); - $expected = false; - $this->assertEqual($result, $expected); - } - -/** - * Enter description here... - * - */ - function testGetCrumbs() - { - $this->html->addCrumb('Foo', '/bar/foo'); - $result = $this->html->getCrumbs(); - $expected = 'START»Foo'; - $this->assertEqual($result, $expected); - } - -} - -?> \ No newline at end of file diff --git a/tests/libs/inflector.php b/tests/libs/inflector.php deleted file mode 100644 index c552bef05..000000000 --- a/tests/libs/inflector.php +++ /dev/null @@ -1,159 +0,0 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * - * @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.tests.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - * - */ - -/** - * - */ -uses('inflector'); -/** - * Enter description here... - * - * @package cake - * @subpackage cake.tests.libs - * @since CakePHP v .9 - * - */ -class InflectorTest extends UnitTestCase -{ -/** - * Enter description here... - * - * @var unknown_type - */ - var $inflector; - -/** - * Enter description here... - * - * @return InflectorTest - */ - function InflectorTest() - { - $this->UnitTestCase('Inflector test'); - } - -/** - * Enter description here... - * - */ - function setUp() - { - $this->inflector = new Inflector(); - } - -/** - * Enter description here... - * - */ - function tearDown() - { - unset($this->inflector); - } - -/** - * Enter description here... - * - */ - function testPluralizeSingularize() - { - $singulars = array( - 'search', 'switch', 'fix', 'box', 'process', 'address', 'query', 'ability', - 'agency', 'half', 'safe', 'wife', 'basis', 'diagnosis', 'datum', 'medium', - 'person', 'salesperson', 'man', 'woman', 'spokesman', 'child', 'page', 'robot'); - $plurals = array( - 'searches', 'switches', 'fixes', 'boxes', 'processes', 'addresses', 'queries', 'abilities', - 'agencies', 'halves', 'saves', 'wives', 'bases', 'diagnoses', 'data', 'media', - 'people', 'salespeople', 'men', 'women', 'spokesmen', 'children', 'pages', 'robots'); - - foreach (array_combine($singulars, $plurals) as $singular => $plural) - { - $this->assertEqual($this->inflector->pluralize($singular), $plural); - $this->assertEqual($this->inflector->singularize($plural), $singular); - } - } - -/** - * Enter description here... - * - */ - function testCamelize() - { - $this->assertEqual($this->inflector->camelize('foo_bar_baz'), 'FooBarBaz'); - } - -/** - * Enter description here... - * - */ - function testUnderscore() - { - $this->assertEqual($this->inflector->underscore('FooBarBaz'), 'foo_bar_baz'); - } - -/** - * Enter description here... - * - */ - function testHumanize() - { - $this->assertEqual($this->inflector->humanize('foo_bar_baz'), 'Foo Bar Baz'); - } - -/** - * Enter description here... - * - */ - function testTableize() - { - $this->assertEqual($this->inflector->tableize('Bar'), 'bars'); - } - -/** - * Enter description here... - * - */ - function testClassify() - { - $this->assertEqual($this->inflector->classify('bars'), 'Bar'); - } - -/** - * Enter description here... - * - */ - function testForeignKey() - { - $this->assertEqual($this->inflector->foreignKey('Bar'), 'bar_id'); - } -} - -?> \ No newline at end of file diff --git a/tests/libs/neat_array.php b/tests/libs/neat_array.php deleted file mode 100644 index f28666a2f..000000000 --- a/tests/libs/neat_array.php +++ /dev/null @@ -1,115 +0,0 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * - * @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.tests.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - * - */ - -/** - * - */ -uses('neat_array'); -/** - * Enter description here... - * - * @package cake - * @subpackage cake.tests.libs - * @since CakePHP v .9 - * - */ -class NeatArrayTest extends UnitTestCase -{ -/** - * Enter description here... - * - * @var unknown_type - */ - var $neatArray; - -/** - * Enter description here... - * - * @return NeatArrayTest - */ - function NeatArrayTest() - { - $this->UnitTestCase('NeatArray test'); - } - -/** - * Enter description here... - * - */ - function setUp() - { - $this->neatArray = new NeatArray(); - } - -/** - * Enter description here... - * - */ - function tearDown() - { - unset($this->neatArray); - } - - -/** - * Enter description here... - * - */ - function testInArray() - { - $a = array('foo'=>' bar ', 'i-am'=>'a'); - $b = array('foo'=>'bar ', 'i-am'=>'b'); - $c = array('foo'=>' bar', 'i-am'=>'c'); - $d = array('foo'=>'bar', 'i-am'=>'d'); - - $n = new NeatArray(array($a, $b, $c, $d)); - - $result = $n->findIn('foo', ' bar '); - $expected = array(0=>$a); - $this->assertEqual($result, $expected); - - $result = $n->findIn('foo', 'bar '); - $expected = array(1=>$b); - $this->assertEqual($result, $expected); - - $result = $n->findIn('foo', ' bar'); - $expected = array(2=>$c); - $this->assertEqual($result, $expected); - - $result = $n->findIn('foo', 'bar'); - $expected = array(3=>$d); - $this->assertEqual($result, $expected); - } - -} - -?> \ No newline at end of file diff --git a/tests/libs/router.php b/tests/libs/router.php deleted file mode 100644 index 848c3e9bd..000000000 --- a/tests/libs/router.php +++ /dev/null @@ -1,130 +0,0 @@ - + // -// + Copyright: (c) 2005, CakePHP Authors/Developers + // -// + Author(s): Michal Tatarynowicz aka Pies + // -// + Larry E. Masters aka PhpNut + // -// + Kamil Dzielinski aka Brego + // -// +------------------------------------------------------------------+ // -// + Licensed under The MIT License + // -// + Redistributions of files must retain the above copyright notice. + // -// + See: http://www.opensource.org/licenses/mit-license.php + // -////////////////////////////////////////////////////////////////////////// - -/** - * - * - * @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.tests.libs - * @since CakePHP v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - * - */ - -/** - * - */ -uses ('router'); -/** - * Enter description here... - * - * @package cake - * @subpackage cake.tests.libs - * @since CakePHP v .9 - * - */ -class RouterTest extends UnitTestCase -{ -/** - * Enter description here... - * - * @var unknown_type - */ - var $router; - -/** - * Enter description here... - * - * @return RouterTest - */ - function RouterTest() - { - $this->UnitTestCase('Router test'); - } - -/** - * Enter description here... - * - */ - function setUp() - { - $this->router = new Router(); - } - -/** - * Enter description here... - * - */ - function tearDown() - { - unset($this->router); - } - - -/** - * Enter description here... - * - */ - function _testConnect() - { - $tests = array( - '/' => array('controller'=>'Foo', 'action'=>'bar'), - '/foo/baz' => array('controller'=>'Foo', 'action'=>'baz'), - '/foo/*' => array('controller'=>'Foo', 'action'=>'dodo'), - '/foobar' => array('controller'=>'Foobar', 'action'=>'bar'), - ); - - foreach ($tests as $route=>$data) - $this->router->connect ($route, $data); - } - - -/** - * Enter description here... - * - */ - function testParse () - { - - $this->_testConnect(); - - $tests = array( - '' => array('controller'=>'Foo', 'action'=>'bar'), - '/' => array('controller'=>'Foo', 'action'=>'bar'), - '/foo/baz/' => array('controller'=>'Foo', 'action'=>'baz'), - '/foo/foo+bar' => array('pass'=>array('foo+bar'), 'controller'=>'Foo', 'action'=>'dodo'), - '/foobar/' => array('controller'=>'Foobar', 'action'=>'bar'), - '/foo/bar/baz' => array('controller'=>'Foo', 'action'=>'dodo', 'pass'=>array('bar', 'baz')), - '/one/two/three/' => array('controller'=>'one', 'action'=>'two', 'pass'=>array('three')), - '/ruburb' => array('controller'=>'ruburb','action'=>null), - '???' => array() - ); - - foreach ($tests as $test=>$expected) - { - $tested = $this->router->parse($test); - $this->assertEqual($tested, $expected); - } - } -} - -?> \ No newline at end of file diff --git a/tests/menu.php b/tests/menu.php new file mode 100644 index 000000000..c255f2fc7 --- /dev/null +++ b/tests/menu.php @@ -0,0 +1,36 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +error_reporting(E_ALL); +set_time_limit(600); +ini_set('memory_limit','128M'); + +?> \ No newline at end of file diff --git a/tests/suite_libs/cake_web_test_case.php b/tests/suite_libs/cake_web_test_case.php new file mode 100644 index 000000000..6e4bf3756 --- /dev/null +++ b/tests/suite_libs/cake_web_test_case.php @@ -0,0 +1,48 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.suite_libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description + */ + +SimpleTestOptions::ignore('CakeWebTestCase'); + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.suite_libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class CakeWebTestCase extends WebTestCase { +} +?> \ No newline at end of file diff --git a/tests/suite_libs/test_manager.php b/tests/suite_libs/test_manager.php new file mode 100644 index 000000000..3a0828694 --- /dev/null +++ b/tests/suite_libs/test_manager.php @@ -0,0 +1,44 @@ + + * Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * + * Author(s): Larry E. Masters aka PhpNut + * Kamil Dzielinski aka Brego + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @author CakePHP Test Suite Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Test Suite Authors/Developers + * @link https://trac.cakephp.org/wiki/TestSuite/Authors/ Authors/Developers + * @package test_suite + * @subpackage test_suite.suite_libs + * @since CakePHP Test Suite v 1.0.0.0 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ + +/** + * Short description for class. + * + * @package test_suite + * @subpackage test_suite.suite_libs + * @since CakePHP Test Suite v 1.0.0.0 + */ +class TestManager { + var $_testExtension = '.test.php'; + var $_groupExtension = '.group.php'; +} +?> \ No newline at end of file