merging code from sandboxes since [430]

preparing for release .0.9.2

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@606 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-08-21 06:49:02 +00:00
parent 57ef2eba9b
commit fbf4d9ee27
261 changed files with 13560 additions and 5453 deletions

185
app/apis/my_acl.php Normal file
View file

@ -0,0 +1,185 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + 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;
}
}
?>

View file

@ -1,34 +1,46 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @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 {
}

View file

@ -1,34 +1,46 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
//////////////////////////////////////////////////////////////////////////
/* 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @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 model file. You can put all
* application-wide model-related methods here.
* 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 {
}

View file

@ -1,32 +1,48 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @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');

View file

@ -1,39 +1,60 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @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';
// }
}
?>

View file

@ -1,27 +1,42 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
//////////////////////////////////////////////////////////////////////////
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* @filesource
* @package cake
* @subpackage cake.app.helpers
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
*/
/**
* In this file you can extend the PagesController.
*
* @package cake
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.app.helpers
* @since CakePHP v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*
/**
* Short description for class.
*
* Long description for class
*
* @package cake
* @subpackage cake.app.helpers
*/

View file

@ -1,27 +1,42 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @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
*/

View file

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl" xml:lang="pl">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?=$title_for_layout?></title>
<?=$html->charsetTag('UTF-8')?>
@ -8,10 +8,8 @@
</head>
<body>
<div id="container">
<div id="content">
<?=$content_for_layout?>
</div>
<div id="main">
<?=$content_for_layout?>
</div>
</body>
</html>

View file

@ -1,36 +1,29 @@
<h1>Cake PHP works!</h1>
<h1>CakePHP <em>Works!</em></h1><br/>
<hr/>
Your database configuration file is <?= file_exists(CONFIGS.'database.php') ? 'present.'. $filePresent = ' ' : 'not present.';?><br/>
<? $db = DboFactory::getInstance(); ?>
<? if (!empty($filePresent)):?>
Cake <?=$db->connected ? "is able to" : "is not able to" ?> connect to the database.
<?endif?>
<hr/>
<br/>
<h2>Editing <em>this Page</em></h2>
<p>
To change the content of this page, edit <code>/app/views/pages/home.thtml</code>. To change it's layout, edit <code>/app/views/layouts/default.thtml</code>. You can also edit the CSS styles for this page at <code>/public/css/default.css</code>.
</p><br/>
<p>Your installation of Cake PHP is functional. Edit <code>/app/views/pages/home.thtml</code> to change the contents of this page.</p>
<h2>Introducing <em>Cake</em></h2>
<h2>Introducing Cake PHP</h2>
<p>Cake is a rapid development framework for PHP: a structure of libraries, classes and run-time infrastructure for programmers creating web applications. Our primary goal is to enable you to work in a structured and rapid manner within a framework - without loss of flexibility. </p><br/>
<p>Tired of repeating yourself? Ever copy and pasted code? Want to get your app in production quicker? Cake is for you. </p><br/>
<p>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 <?=$html->linkOut('PEAR', 'http://pear.php.net')?> and <?=$html->linkOut('PECL', 'http://pecl.php.net')?> libraries &ndash; they don't usually re-use their code.</p>
<p>Cake PHP builds on a concept introduced in <?=$html->linkOut('Ruby on Rails', 'http://rubyonrails.com')?> &ndash; it enables rapid developement of feature-rich websites.</p>
<h2>Features</h2>
<ul>
<li>Compatibile with PHP4 and PHP5.</li>
<li>Supplies integrated <acronym title="Create, Read, Update, Delete">CRUD</acronym> for databases.</li>
<li>Pretty URL's that work with and without mod_rewrite.</li>
<li>Fast, flexible templating (PHP syntax with helper methods).</li>
<li>Suported database-types: MySQL, PostgreSQL and SQLIte</li>
<li>Suported webservers: Apache (others will most likely also work)</li>
</ul>
<p>Cake is still in its early infancy, but we are proceeding in good direction &ndash; table joins will most probably get added in 0.9.3 release, and better support for user-defined settings is also underway.</p>
<h2>Getting involved</h2>
<p>Cake PHP needs you! We have already quiet active user base, but we are allways open to new bug reports or feature ideas!</p>
<ul>
<li><?=$html->linkOut('Google Group','http://groups-beta.google.com/group/cake-php')?> &ndash; for public discussions about everything Cake.</li>
<li><?=$html->linkOut('Wiki','https://trac.cakephp.org/wiki')?> &ndash; fastest way of getting newest information on Cake PHP.</li>
<li><?=$html->linkOut('Report a bug or feature request','https://trac.cakephp.org/newticket')?>.</li>
<li><?=$html->linkOut('Roadmap','https://trac.cakephp.org/roadmap')?> &ndash; check our plans for the bright future.</li>
</ul>
<p>Soon there will be oficial <?=$html->linkOut('Cake PHP website','http://www.cakephp.org/')?>, so stay tuned.</p>
<p>Also see Cake PHP's original authors <?=$html->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.</p>
<h2>Get <em>Involved</em></h2>
<p>Cake PHP needs you! We have an active user base and are always open to new bug reports or feature ideas!</p><br/>
<?=$html->linkOut('Google Group','http://groups-beta.google.com/group/cake-php')?> &ndash; for public discussions about everything Cake.<br/>
<?=$html->linkOut('Wiki','https://trac.cakephp.org/wiki')?> &ndash; fastest way of getting newest information on Cake PHP.<br/>
<?=$html->linkOut('Report a bug or feature request','https://trac.cakephp.org/newticket')?>.<br/>
<?=$html->linkOut('Roadmap','https://trac.cakephp.org/roadmap')?> &ndash; check our plans for the bright future.<br/>
#cakephp on irc.euirc.net for quick help<br/>
</p>
<br/>
<p>Cake 0.9.2</p>

50
config/acl.ini.php Normal file
View file

@ -0,0 +1,50 @@
<? die(); ?>
; 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

View file

@ -1,19 +1,34 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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');
?>

View file

@ -1,18 +1,34 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
//////////////////////////////////////////////////////////////////////////
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* In this file you set paths to different directories used by Cake.
*
* @package cake
* @subpackage cake.config
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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
*/
/**

View file

@ -1,20 +1,36 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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
*/
/**

108
config/tags.ini.php Normal file
View file

@ -0,0 +1,108 @@
;<?php die() ?>
; 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 <http://www.cakephp.org/>
; * Copyright (c) 2005, CakePHP Authors/Developers
; *
; * Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
; * Larry E. Masters aka PhpNut <nut@phpnut.com>
; * Kamil Dzielinski aka Brego <brego.dk@gmail.com>
; *
; * Licensed under The MIT License
; * Redistributions of files must retain the above copyright notice.
; *
; * @filesource
; * @author CakePHP Authors/Developers
; * @copyright Copyright (c) 2005, CakePHP Authors/Developers
; * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
; * @package cake
; * @subpackage cake.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 = "<a href="%s"%s>%s</a>"
; Tag template for a mailto: link.
mailto = "<a href="mailto:%s"%s>%s</a>"
; Tag template for opening form tag.
form = "<form %s>"
; Tag template for an input type='text' tag.
input = "<input name="data[%s][%s]"%s/>"
; Tag template for an input type='textarea' tag
textarea = "<textarea name="data[%s][%s]"%s>%s</textarea>"
; Tag template for an input type='hidden' tag.
hidden = "<input type="hidden" name="data[%s][%s]"%s/>"
; Tag template for a textarea tag.
textarea = "<textarea name="data[%s][%s]"%s>%s</textarea>"
; Tag template for a input type='checkbox ' tag.
checkbox = "<input type="checkbox" name="data[%s][%s]" id="tag_%s"%s/>"
; Tag template for a input type='radio' tag.
radio = "<input type="radio" name="data[%s][%s]" id="tag_%s"%s/>"
; Tag template for a select opening tag.
selectStart = "<select name="data[%s][%s]"%s>"
; Tag template for an empty select option tag.
selectEmpty = "<option value=""%s></option>"
; Tag template for a select option tag.
selectOption = "<option value="%s"%s>%s</option>"
; Tag template for a closing select tag.
selectEnd = "</select>"
; Tag template for a password tag.
password = "<input type="password" name="data[%s][%s]"%s/>"
; Tag template for a file input tag.
file = "<input type="file" name="%s"%s/>"
; Tag template for a submit button tag.
submit = "<input type="submit"%s/>"
; Tag template for an image tag.
image =" <img src="%s"%s/>"
; Tag template for a table header tag.
tableHeader = "<th%s>%s</th>"
; Tag template for table headers row tag.
tableHeaderRow = "<tr%s>%s</tr>"
; Tag template for a table cell tag.
tableCell = "<td%s>%s</td>"
; Tag template for a table row tag.
tableRow = "<tr%s>%s</tr>"
; Tag template for a CSS link tag.
css = "<link rel="%s" type="text/css" href="%s" />"
; Tag template for a charset meta-tag.
charset = "<meta http-equiv="Content-Type" content="text/html; charset=%s" />"
; Tag template for inline JavaScript.
javascriptBlock = "<script type="text/javascript">%s</script>"
; Tag template for included JavaScript.
javascriptLink = "<script type="text/javascript" src="%s"></script>"

View file

@ -1,139 +0,0 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + 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', '<a href="%s"%s>%s</a>');
/**
* Tag template for a mailto: link.
*/
define('TAG_MAILTO', '<a href="mailto:%s"%s>%s</a>');
/**
* Tag template for opening form tag.
*/
define('TAG_FORM', '<form %s>');
/**
* Tag template for an input type='text' tag.
*/
define('TAG_INPUT', '<input name="data[%s][%s]" %s/>');
/**
* Tag template for an input type='hidden' tag.
*/
define('TAG_HIDDEN', '<input type="hidden" name="data[%s][%s]" %s/>');
/**
* Tag template for a textarea tag.
*/
define('TAG_AREA', '<textarea name="data[%s][%s]"%s>%s</textarea>');
/**
* Tag template for a input type='checkbox ' tag.
*/
define('TAG_CHECKBOX', '<label for="tag_%s"><input type="checkbox" name="data[%s][%s]" id="tag_%s" %s/>%s</label>');
/**
* Tag template for a input type='radio' tag.
*/
define('TAG_RADIOS', '<label for="tag_%s"><input type="radio" name="data[%s][%s]" id="tag_%s" %s/>%s</label>');
/**
* Tag template for a select opening tag.
*/
define('TAG_SELECT_START', '<select name="data[%s][%s]"%s>');
/**
* Tag template for an empty select option tag.
*/
define('TAG_SELECT_EMPTY', '<option value=""%s></option>');
/**
* Tag template for a select option tag.
*/
define('TAG_SELECT_OPTION','<option value="%s"%s>%s</option>');
/**
* Tag template for a closing select tag.
*/
define('TAG_SELECT_END', '</select>');
/**
* Tag template for a password tag.
*/
define('TAG_PASSWORD', '<input type="password" name="data[%s][%s]" %s/>');
/**
* Tag template for a file input tag.
*/
define('TAG_FILE', '<input type="file" name="%s" %s/>');
/**
* Tag template for a submit button tag.
*/
define('TAG_SUBMIT', '<input type="submit" %s/>');
/**
* Tag template for an image tag.
*/
define('TAG_IMAGE', '<img src="%s" alt="%s" %s/>');
/**
* Tag template for a table header tag.
*/
define('TAG_TABLE_HEADER', '<th%s>%s</th>');
/**
* Tag template for table headers row tag.
*/
define('TAG_TABLE_HEADERS','<tr%s>%s</tr>');
/**
* Tag template for a table cell tag.
*/
define('TAG_TABLE_CELL', '<td%s>%s</td>');
/**
* Tag template for a table row tag.
*/
define('TAG_TABLE_ROW', '<tr%s>%s</tr>');
/**
* Tag template for a CSS link tag.
*/
define('TAG_CSS', '<link rel="%s" type="text/css" href="%s" />');
/**
* Tag template for a charset meta-tag.
*/
define('TAG_CHARSET', '<meta http-equiv="Content-Type" content="text/html; charset=%s" />');
/**
* Tag template for inline JavaScript.
*/
define('TAG_JAVASCRIPT', '<script language="javascript" type="text/javascript">%s</script>');
/**
* Tag template for included JavaScript.
*/
define('TAG_JAVASCRIPT_INCLUDE', '<script language="javascript" type="text/javascript" src="%s"></script>');
?>

View file

@ -1,33 +1,35 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @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
*/
/**

62
libs/acl.php Normal file
View file

@ -0,0 +1,62 @@
<?php
/* SVN FILE: $Id$ */
/**
* Access Control List.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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;
}
}
?>

View file

@ -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
{
/**
* Enter description here...
*
* @return ModelCollection
*/
function ModelCollection()
function AclBase()
{
//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) {}
}
?>

View file

@ -1,33 +1,35 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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 {

View file

@ -1,33 +1,34 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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
*/
/**

View file

@ -1,34 +1,36 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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 {
/**

112
libs/class_registry.php Normal file
View file

@ -0,0 +1,112 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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];
}
}
?>

File diff suppressed because it is too large Load diff

View file

@ -1,102 +1,25 @@
<h1>Editing <?php echo Inflector::camelize($this->name); ?></h1>
<?php echo $html->formTag('/'.$this->viewPath.'/update');?>
<table cellspacing="0" class="inav">
<tr>
<th>Column Type</th>
<th>Column Name</th>
<th>Value</th>
</tr>
<?php
$model = Inflector::pluralize($this->name);
$table = Inflector::singularize($this->name);
$evenNum = 1;
$css = false;
uses('helpers/form');
foreach ($this->$table->_table_info as $tables) {
$columnCount = 0;
foreach ($tables as $tabl) {
foreach ($this->_viewVars as $names) {?>
<?php
$form = new FormHelper();
if ($evenNum % 2 == 0 ){
$css = ' class="or"';
}else{
$css = false;
}
$evenNum++;
?>
echo $html->formTag('/'.$this->name.'/update');
echo $form->generateFields( $html, $fieldNames );
echo $form->generateSubmitDiv( $html, 'Save' )
<?php echo "<tr$css>";?>
<td> <?php echo $tabl['type'];?> </td>
<td> <?php echo $tabl['name'];?> </td>
<td><?php echo $names[$table][$tabl['name']]?></td>
</tr>
<?php
}
$columnCount++;
}
}
?>
</table>
<ul class='actions'>
<?php
if(!empty($this->$table->joinedHasOne)){?>
$modelName = Inflector::singularize($this->name);
echo "<li>".$html->linkTo('Delete '.Inflector::humanize($modelName), '/'.$this->viewPath.'/destroy/'.$data[$modelName]['id'])."</li>";
<table cellspacing="0" class="inav">
<tr>
<th> </th>
<th>Joined Table</th>
<th> </th>
</tr>
<tr>
<th>Column Type</th>
<th>Column Name</th>
<th>Value</th>
</tr>
<?php
$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){
foreach( $fieldNames as $field=>$value ) {
if( isset( $value['foreignKey'] ) )
{
echo "<li>".$html->linkTo( "View ".Inflector::humanize($value['controller']), "/".Inflector::underscore($value['controller'])."/show/".$data[Inflector::singularize($params['controller'])][$field] )."</li>";
}
}
?>
<?php
if ($evenNum % 2 == 0 ){
$css = ' class="or"';
}else{
$css = false;
}
$evenNum++;
?>
<?php echo "<tr$css>";?>
<td> <?php echo $test['type'];?> </td>
<td> <?php echo $test['name'];?> </td>
<td><?php echo $names[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']]?></td>
</tr>
<?php
$count++;
}
}
}
?>
</table>
<?php }?>
<table cellspacing="0" class="inav">
<br /><?php echo $html->submitTag('Save')?></p>
</form>
<tr>
<td>
<?php echo $html->linkTo('<span style="color: red;">Back</span>', "/{$this->viewPath}/list/")?>
</td>
</tr>
</table>
</ul>

View file

@ -1,105 +1,66 @@
<h1>Listing <?php echo Inflector::humanize($this->name); ?></h1>
<table cellspacing="0" class="inav">
<tr>
<?php
$model = Inflector::pluralize($this->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 );
?>
<th><?php echo $tableHeader;?></th>
<?php
}
}
if(!empty($this->$table->joinedHasOne)){
<table class="inav" cellspacing="0">
<tr>
<?php foreach ( $fieldNames as $fieldName ) { ?>
<th><?php echo $fieldName['prompt'];?></th>
<?php } ?>
<th>Actions</th>
</tr>
<?php
$iRowIndex = 0;
echo" <th>Joined Table Actions</th>";
}
if( is_array( $data ) )
{
foreach ( $data as $row ) {
if( $iRowIndex++ % 2 == 0 )
{
echo "<tr>";
} else {
echo "<tr class='altRow'>";
}
foreach( $fieldNames as $field=>$value ) { ?>
<td>
<?php
if( Model::isForeignKey( $field ) ) {
if(!empty($this->$table->_hasMany)){
// this is a foreign key, figure out what the display field should be for this model.
$otherModelName = $value['model'];
$otherControllerName = $value['controller'];
echo" <th>Has Many ";
for ($i = 0; $i <= count($this->$table->_hasMany)-1; $i++) {
echo Inflector::humanize($this->$table->_hasMany[$i]);
}
echo "</th>";
} ?>
$registry = ClassRegistry::getInstance();
$otherModelObject = $registry->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] );
<th>Actions for <?php echo Inflector::humanize($this->name);?></th>
</tr>
} else {
echo $row[$table ][$field];
} ?>
</td>
<?php } // end for each $fieldNames as $field=>value ?>
<td class="listactions"><?php echo $html->linkTo('View',"/".$this->viewPath."/show/{$row[$table]['id']}/")?>
<?php echo $html->linkTo('Edit',"/".$this->viewPath."/edit/{$row[$table]['id']}/")?>
<?php echo $html->linkTo('Delete',"/".$this->viewPath."/destroy/{$row[$table]['id']}/")?>
</td>
<?php
$evenNum = 1;
$css = false;
foreach ($this->$table->findAll() as $columns){
if ($evenNum % 2 == 0 ){
$css = ' class="or"';
}else{
$css = false;
}
$evenNum++;
?>
<?php echo "<tr$css>";?>
<?php foreach ($tables as $tabl) {?>
<td><?php echo $columns[$table][$tabl['name']]?></td>
<?php
}
if(!empty($this->$table->joinedHasOne)){echo" <td>";?>
<?php
$joinedCount = count($this->$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('<span style="color: red;">Edit: <b>'. Inflector::humanize(Inflector::singularize($this->$table->joinedHasOne[$i]->table)) .'</b></span>',"/{$this->$table->joinedHasOne[$i]->table}/edit/{$columns[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']]}");
echo '<br /><b>' . Inflector::humanize($test['name']) .':</b> ' . $columns[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']] .'<br />';
} else{
echo '<b>' . Inflector::humanize($test['name']) .':</b> ' . $columns[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']] .'<br />';
}
}
}
}
}
if(!empty($this->$table->joinedHasOne)){ echo" </td>";}?>
<?php if(!empty($this->$table->_hasMany)){ echo" <td>";?>
<?php
for ($i = 0; $i <= count($this->$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('<span style="color: red;">Edit: <b>'. Inflector::humanize(Inflector::singularize($this->$table->_hasMany[$i])) .'</b></span>',"/{$this->$table->_hasMany[$i]}/edit/{$columns[$ia][Inflector::singularize($this->$table->_hasMany[$i])][$test['name']]}");
echo '<br /><b>' . Inflector::humanize($test['name']) .':</b> ' . $columns[$ia][Inflector::singularize($this->$table->_hasMany[$i])][$test['name']] .'<br />';
} else{
echo '<b>' . Inflector::humanize($test['name']) .':</b> ' . $columns[$ia][Inflector::singularize($this->$table->_hasMany[$i])][$test['name']] .'<br />';
}
}
}
}
}
}
</tr>
<?php } // end for each data as row
} // end if( $data )?>
if(!empty($this->$table->hasMany)){ echo" </td>";}?>
</table>
<ul class="actions">
<li><?php echo $html->linkTo('New '.$humanSingularName, '/'.$this->viewPath.'/new'); ?></li>
</ul>
<td><?php echo $html->linkTo('<span style="color: red;">Show</span>', "/{$this->viewPath}/show/{$columns[Inflector::singularize($this->name)]['id']}")?>
<?php echo $html->linkTo('<span style="color: red;">Edit</span>',"/{$this->viewPath}/edit/{$columns[Inflector::singularize($this->name)]['id']}")?>
<?php echo $html->linkTo('<span style="color: red;">Destroy</span>',"/{$this->viewPath}/destroy/{$columns[Inflector::singularize($this->name)]['id']}")?>
</td>
</tr>
<?php } ?>
</table>
<table>
<tr>
<td colspan="3"><?php echo $html->linkTo('Add New '.Inflector::humanize(Inflector::singularize($this->viewPath)).'', "/{$this->viewPath}/new/") ?></td>
</tr>
</table>

View file

@ -1,94 +1,11 @@
<h1>New <?php echo Inflector::camelize($this->name); ?></h1>
<?php echo $html->formTag('/'.$this->viewPath.'/create');?>
<table cellspacing="0" class="inav">
<tr>
<th>Column Type</th>
<th>Column Name</th>
</tr>
<?php
$model = Inflector::pluralize($this->name);
$table = Inflector::singularize($this->name);
$columnCount = 0;
$evenNum = 1;
$css = false;
uses('helpers/form');
foreach ($this->$table->_table_info as $tables) {
foreach ($tables as $tabl) {?>
$form = new FormHelper();
<?php
echo $html->formTag('/'.$this->name.'/create');
if ($evenNum % 2 == 0 ){
$css = ' class="or"';
}else{
$css = false;
}
$evenNum++;
?>
<?php echo "<tr$css>";?>
<td> <?php echo $tabl['type'];?> </td>
<td> <?php echo $tabl['name'];?> </td>
</tr>
<?php
}
$columnCount++;
}
?>
echo $form->generateFields( $html, $fieldNames );
</table>
<?php
if(!empty($this->$table->joinedHasOne)){?>
<table cellspacing="0" class="inav">
<tr>
<th>Joined Table</th>
<th> </th>
</tr>
<tr>
<th>Column Type</th>
<th>Column Name</th>
</tr>
<?php
$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){?>
<?php
if ($evenNum % 2 == 0 ){
$css = ' class="or"';
}else{
$css = false;
}
$evenNum++;
?>
<?php echo "<tr$css>";?>
<td> <?php echo $test['type'];?> </td>
<td> <?php echo $test['name'];?> </td>
</tr>
<?php
$count++;
}
}
}
echo $form->generateSubmitDiv( $html, 'Add' )
?>
</table>
<?php }?>
<table cellspacing="0" class="inav">
<br /><?php echo $html->submitTag('Save')?></p>
</form>
<tr>
<td>
<?php echo $html->linkTo('<span style="color: red;">Back</span>', "/{$this->viewPath}/list/")?>
</td>
</tr>
</table>

View file

@ -4,13 +4,14 @@
<title><?=$title_for_layout?></title>
<?=$html->charsetTag('UTF-8')?>
<?=$html->cssTag('scaffold')?>
<?=$html->cssTag('forms')?>
</head>
<body>
<div id="container">
<h1><?=$title_for_layout?></h1>
<?=$content_for_layout?>
</div>
</body>
</html>

View file

@ -1,93 +1,95 @@
<?php
$model = Inflector::pluralize($this->name);
$table = Inflector::singularize($this->name);
$evenNum = 1;
$css = false;
?>
$modelName = Inflector::singularize($this->name);
$registry = ClassRegistry::getInstance();
<h1>Showing <?php echo Inflector::camelize($this->name); ?></h1>
<table cellspacing="0" class="inav">
<tr>
<th>Field</th>
<th>Value</th>
<?php
if(!empty($this->$table->joinedHasOne)){
echo" <th>Joined Table</th>";
}
?>
</tr>
<?php
foreach ($this->$table->_table_info as $tables) {
$columnCount = 0;
foreach ($tables as $tabl) {
$tableName[] = $tabl['name'];
foreach ($this->_viewVars as $names) {
?>
<?php
if ($evenNum % 2 == 0 ){
$css = ' class="or"';
}else{
$css = false;
}
$evenNum++;
?>
<?php echo "<tr$css>";?>
<td><?php echo Inflector::humanize($tableName[$columnCount]);?></td>
<td><?php echo $names[$table][$tabl['name']]?></td>
<?php
}
$columnCount++;
}
}
?>
</tr>
<?php
if(!empty($this->$table->joinedHasOne)){?>
<tr>
<td></td>
<td></td>
<td>
<?php
$joinedCount = count($this->$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('<span style="color: red;">Edit: <b>'. Inflector::humanize(Inflector::singularize($this->$table->joinedHasOne[$i]->table)) .'</b></span>',"/{$this->$table->joinedHasOne[$i]->table}/edit/{$names[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']]}");
echo '<br /><b>' . Inflector::humanize($test['name']) .':</b> ' . $names[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']];
} else{
echo '<br /><b>' . Inflector::humanize($test['name']) .':</b> ' . $names[Inflector::singularize($this->$table->joinedHasOne[$i]->table)][$test['name']];
}
$count++;
}
echo '<br />';
}
}
?>
</td>
</tr>
</table>
<?php }?>
<table cellspacing="0" class="inav">
<tr>
<td>
<?php echo $html->linkTo('<span style="color: red;">Back</span>', "/{$this->viewPath}/list/")?>
<?php echo $html->linkTo('<span style="color: red;">Edit</span>',"/{$this->viewPath}/edit/{$names[Inflector::singularize($this->name)]['id']}")?>
<?php echo $html->linkTo('<span style="color: red;">Destroy</span>',"/{$this->viewPath}/destroy/{$names[Inflector::singularize($this->name)]['id']}")?>
</td>
</tr>
</table>
<dl>
<?php foreach( $fieldNames as $field=>$value ) {
echo "<dt>".$value['prompt']."</dt>";
if( isset( $value['foreignKey'] ) ) {
$otherModelObject = $registry->getObject($value['model']);
$displayField = $otherModelObject->getDisplayField();
$displayText = $data[$value['model']][ $displayField ];
echo "<dd>".$html->linkTo($displayText, '/'.Inflector::underscore($value['controller']).'/show/'.$data[$modelName][ $field ] )."</dd>";
} else {
// this is just a plain old field.
if( isset($data[$modelName][$field]) )
{
echo "<dd>".$data[$modelName][$field]."</dd>";
} else {
echo "<dd>&nbsp;</dd>";
}
}
}
?>
</dl>
<ul class='actions'>
<?php
echo "<li>".$html->linkTo('Edit '.Inflector::humanize($modelName), '/'.$this->viewPath.'/edit/'.$data[$modelName]['id'])."</li>";
echo "<li>".$html->linkTo('Delete '.Inflector::humanize($modelName), '/'.$this->viewPath.'/destroy/'.$data[$modelName]['id'])."</li>";
foreach( $fieldNames as $field=>$value ) {
if( isset( $value['foreignKey'] ) )
{
echo "<li>".$html->linkTo( "View ".Inflector::humanize($value['controller']), "/".Inflector::underscore($value['controller'])."/show/".$data[Inflector::singularize($params['controller'])][$field] )."</li>";
}
}
?>
</ul>
<?php
$objModel = $registry->getObject($modelName);
foreach( $objModel->_oneToMany as $relation )
{
$count = 0;
list($table, $field, $value) = $relation;
$otherModelName = Inflector::singularize($table);
echo "<div class='related'><H2>Related ".Inflector::humanize($table)."</H2>";
if( isset($data[$table]) && is_array($data[$table]) )
{
?>
<table class="inav" cellspacing="0">
<tr>
<?php // Loop through and create the header row.
// find a row that matches this title.
$bFound = false;
foreach( $data[$table][0] as $column=>$value ) {
echo "<th>".Inflector::humanize($column)."</th>";
}
?>
<th>Actions</th>
</tr>
<?php
// now find all matching rows
foreach( $data[$table] as $row )
{
echo "<tr>";
foreach( $row as $column=>$value )
{
echo "<td>".$value."</td>";
}
?>
<td class="listactions"><?php echo $html->linkTo('View',"/".Inflector::underscore($table)."/show/{$row['id']}/")?>
<?php echo $html->linkTo('Edit',"/".Inflector::underscore($table)."/edit/{$row['id']}/")?>
<?php echo $html->linkTo('Delete',"/".Inflector::underscore($table)."/destroy/{$row['id']}/")?>
</td>
<?php
echo "</tr>";
}
}
?>
</table>
<ul class="actions">
<?php
// add a link to create a new relation.
echo "<li>".$html->linkTo('New '.Inflector::humanize($otherModelName),"/".Inflector::underscore($table)."/new/")."</li>";
// echo "<li>".$html->linkTo( "View ".Inflector::humanize($table), "/".Inflector::underscore($table)."/list/".$modelName."/".$data[$modelName]['id'])."</li>";
} // end loop through onetomany relations.
?>
</ul></div>

View file

@ -1,23 +1,47 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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);
* </code>
*
* @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
{

View file

@ -1,46 +1,50 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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.'); }
/**

View file

@ -1,42 +1,45 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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
{

View file

@ -1,33 +1,36 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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.');
}
}
/**

View file

@ -1,33 +1,35 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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));
}
/**

View file

@ -1,33 +1,35 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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.');
}
}
/**

View file

@ -1,32 +1,34 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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.
*
* @package cake
* @subpackage cake.libs.dbo
* @since CakePHP v 0.9.0
* Long description for class
*
* @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.');
}
}

View file

@ -1,49 +1,55 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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)
{
@ -68,13 +74,14 @@ 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))
{
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;
}
}

View file

@ -1,35 +1,38 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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':

View file

@ -1,33 +1,35 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/* SVN FILE: $Id$ */
/**
* Purpose: Error Messages Defines
*
* @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 Messages Defines
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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.');
?>

View file

@ -1,41 +1,45 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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
{

View file

@ -1,34 +1,35 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/* SVN FILE: $Id$ */
/**
* Purpose: Flay
* Text-to-html parser, similar to Textile or RedCloth, only with somehow different syntax.
*
* @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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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
{

View file

@ -1,44 +1,51 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/* SVN FILE: $Id$ */
/**
* Purpose: Folder
* Folder structure browser, lists folders and 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 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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 {
/**

33
libs/generator/base.php Normal file
View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

33
libs/generator/lookup.php Normal file
View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

33
libs/generator/spec.php Normal file
View file

@ -0,0 +1,33 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake <https://developers.nextco.com/cake/> + //
// + Copyright: (c) 2005, Cake Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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
*/
?>

177
libs/helper.php Normal file
View file

@ -0,0 +1,177 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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;
}
/**#@-*/
}
?>

View file

@ -1,41 +1,45 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/* SVN FILE: $Id$ */
/**
* Access Control List.
* Access Control List.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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
*/
/**
* Access Control List helper library.
*
* @package cake
* Long description for class
*
* @package cake
* @subpackage cake.libs.helpers
* @since CakePHP v 0.9.2
* @since CakePHP v 0.9.2
*
*/
class AclHelper

View file

@ -1,41 +1,45 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id:$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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.
*
* @package cake
* Long description for class
*
* @package cake
* @subpackage cake.libs.helpers
* @since CakePHP v 0.9.1
* @since CakePHP v 0.9.1
*
*/
class AjaxHelper

View file

@ -1,35 +1,40 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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' );
/**
@ -55,15 +60,17 @@ define('TAG_FIELDSET', '<fieldset><legend>%s</legend>%s</label>');
/**
* Form helper library.
*
* @package cake
* Long description for class
*
* @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 );
@ -226,6 +296,12 @@ class FormHelper
}
function generateSubmitDiv($html, $displayText, $htmlOptions = null)
{
return $this->divTag( 'submit', $html->submitTag( $displayText, $htmlOptions) );
}
/**
* Generates an form to go onto a HtmlHelper object.
*
@ -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( '
<fieldset>
<legend>%s</legend>
<div class="notes">
<h4>%s</h4>
<p class="last">%s</p>
</div>
%s
</fieldset>', $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( '
<fieldset>
<legend>%s</legend>
<div class="notes">
<h4>%s</h4>
<p class="last">%s</p>
</div>
%s
</fieldset>', $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;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,66 @@
<?php
/* SVN FILE: $Id$ */
/**
* Javascript Helper class file.
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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);
}
}
?>

90
libs/helpers/number.php Normal file
View file

@ -0,0 +1,90 @@
<?php
/* SVN FILE: $Id$ */
/**
* Number Helper.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @author Christian Gillen aka kodos <christian@crew.lu>
* @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) . '%';
}
}
?>

240
libs/helpers/text.php Normal file
View file

@ -0,0 +1,240 @@
<?php
/* SVN FILE: $Id$ */
/**
* Text Helper
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @author Christian Gillen aka kodos <christian@crew.lu>
* @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 = '<span class="highlight">\1</span>')
{
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 href=....) of a givent text
*
* @param string $text Text
* @return string The text without links
*/
function stripLinks($text)
{
return preg_replace('|<a.*>(.*)<\/a>|im', '\1', $text);
}
/**
* Adds links(<a href=....) to a given text
*
* @param string $text Text
* @param array $htmlOptions Array of HTML options.
* @return string The text with links
*/
function autoLinkUrls($text, $htmlOptions = array())
{
$options = 'array(';
foreach ($htmlOptions as $option => $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(
'#(?<!http://|https://|ftp://|nntp://)(www\.[^\n\%\ ]+[^\n\%\,\.\ ])#',
create_function(
'$matches',
'$Html = new HtmlHelper(); return $Html->linkOut($matches[0], "http://" . $matches[0],' . $options . ');'
),
$text
);
}
/**
* Adds email links(<a href="mailto:....) to a givent text
*
* @param string $text Text
* @param array $htmlOptions Array of HTML options.
* @return string The text with links
*/
function autoLinkEmails($text, $htmlOptions = array())
{
$options = 'array(';
foreach ($htmlOptions as $option => $value)
{
$options .= "'$option' => '$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);
}
}
?>

422
libs/helpers/time.php Normal file
View file

@ -0,0 +1,422 @@
<?php
/* SVN FILE: $Id: html.php 578 2005-08-12 04:09:07Z phpnut $ */
/**
* Html Helper class file.
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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 <i>strtotime</i>-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);
}
}
?>

View file

@ -1,46 +1,46 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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,18 +62,26 @@ 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)
@ -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)

View file

@ -1,39 +1,38 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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 <aidan@php.net>
* @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

View file

@ -1,42 +1,49 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id $
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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
{

File diff suppressed because it is too large Load diff

View file

@ -1,328 +1,332 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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
* @subpackage cake.libs
* @since CakePHP v 0.2.9
*/
class NeatArray {
/**
* Value of NeatArray.
* Long description for class
*
* @var array
* @access public
* @package cake
* @subpackage cake.libs
* @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;
}
/**
* 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;
}
/**
* 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;
}
}
$out = false;
foreach ($this->value as $k=>$v)
{
if (isset($v[$fieldName]) && ($v[$fieldName] == $value))
{
$out[$k] = $v;
}
}
return $out;
}
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;
}
/**
* 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
*/
/**
* 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 ($this->value = $this->plus($value))? true: false;
}
/**
* Returns itself merged with given array.
*
* @param array $value Array to add to NeatArray.
* @return array
* @access public
* @uses NeatArray::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)
{
return array_merge($this->value, (is_array($value)? $value: array($value)));
return array_merge($this->value, (is_array($value)? $value: array($value)));
}
/**
* 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;
}
/**
* 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;
}
if ($sortedBy == 1)
{
$reverse? arsort($out, SORT_NUMERIC): asort($out, SORT_NUMERIC);
}
if ($sortedBy == 1)
{
$reverse? arsort($out, SORT_NUMERIC): asort($out, SORT_NUMERIC);
}
if ($sortedBy == 2)
{
$reverse? krsort($out, SORT_STRING): ksort($out, SORT_STRING);
}
if ($sortedBy == 2)
{
$reverse? krsort($out, SORT_STRING): ksort($out, SORT_STRING);
}
return $out;
}
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);
}
/**
* 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;
}
/**
* 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; $ii<count($this->value); $ii++)
{
$this->value[$ii] = sprintf($template, $this->value[$ii]);
}
/**
* Enter description here...
*
* @param unknown_type $template
* @return unknown
*/
function sprintf($template)
{
for ($ii=0; $ii<count($this->value); $ii++)
{
$this->value[$ii] = sprintf($template, $this->value[$ii]);
}
return $this->value;
}
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]))
/**
* 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; $ii<sizeof($this->value); $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; $ii<sizeof($this->value); $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;
}
}

View file

@ -1,101 +1,105 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + 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 <http://www.cakephp.org/>
* Copyright (c) 2005, CakePHP Authors/Developers
*
* Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
* Larry E. Masters aka PhpNut <nut@phpnut.com>
* Kamil Dzielinski aka Brego <brego.dk@gmail.com>
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.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{
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 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('ą','ć','ę','ł','ń','ó','ś','ź','ż','Ą','Ć','Ę','<27>?','Ń','Ó','Ś','Ź','Ż');
$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 toRoman ($string)
{
$pl = array('Ä…','ć','Ä™','Å‚','Å„','ó','Å›','ź','ż','Ä„','Ć','Ę','Å?','Ń','Ó','Åš','Ź','Å»');
$ro = array('a','c','e','l','n','o','s','z','z','A','C','E','L','N','O','S','Z','Z');
return str_replace($pl, $ro, $string);
}
return str_replace($pl, $ro, $string);
}
/**
* 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 $string
* @return unknown
*/
function toCompressed ($string)
{
$whitespace = array("\n", "\t", "\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);
/**
* 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];
}
$out = '';
for ($ii=0; $ii<$length; $ii++)
{
$out .= $chars[rand(1, $char_count)-1];
}
return $out;
}
return $out;
}
}

Some files were not shown because too many files have changed in this diff Show more