removing changes made in trunk after directory changes made on next release

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1055 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-10-03 04:41:33 +00:00
parent a00a927cca
commit a316884f37
2 changed files with 184 additions and 206 deletions

View file

@ -565,5 +565,7 @@ class %sTest extends TestCase
return false;
}
}
}
?>

View file

@ -51,10 +51,10 @@ define('YEAR', 365 * DAY);
*/
function loadModels ()
{
require APP.'app_model.php';
require (APP.'app_model.php');
foreach (listClasses(MODELS) as $model_fn)
{
require_once MODELS.$model_fn;
require_once (MODELS.$model_fn);
}
}
@ -68,16 +68,16 @@ function loadModels()
*/
function loadControllers ()
{
require APP.'app_controller.php';
require (APP.'app_controller.php');
foreach (listClasses(HELPERS) as $helper)
{
require_once HELPERS.$helper.'.php';
require_once (HELPERS.$helper.'.php');
}
foreach (listClasses(CONTROLLERS) as $controller)
{
require_once CONTROLLERS.$controller.'.php';
require_once (CONTROLLERS.$controller.'.php');
}
}
@ -89,24 +89,15 @@ function loadControllers()
*/
function loadController ($name)
{
$controllerFn = CONTROLLERS.Inflector::underscore($name).'_controller.php';
$helperFn = HELPERS.Inflector::underscore($name).'_helper.php';
$controller_fn = CONTROLLERS.Inflector::underscore($name).'_controller.php';
$helper_fn = HELPERS.Inflector::underscore($name).'_helper.php';
require_once(APP.'app_controller.php');
if (file_exists($helperFn))
{
require_once $helperFn;
}
if (file_exists($helper_fn))
require_once($helper_fn);
if (file_exists($controllerFn))
{
return require_once $controllerFn;
}
else
{
return false;
}
return file_exists($controller_fn)? require_once($controller_fn): false;
}
/**
@ -133,22 +124,19 @@ function config()
{
if (('database' == $arg) && file_exists(CONFIGS.$arg.'.php'))
{
require_once CONFIGS.$arg.'.php';
include_once(CONFIGS.$arg.'.php');
}
elseif (file_exists(CONFIGS.$arg.'.php'))
{
require_once CONFIGS.$arg.'.php';
include_once (CONFIGS.$arg.'.php');
if (count($args) == 1) return true;
}
else
{
if (count($args) == 1) return false;
}
}
if (count($args) == 1)
{
return true;
}
}
elseif (count($args) == 1)
{
return false;
}
}
return true;
}
@ -167,19 +155,22 @@ function uses()
$args = func_get_args();
foreach ($args as $arg)
{
require_once LIBS.strtolower($arg).'.php';
require_once(LIBS.strtolower($arg).'.php');
}
}
/**
* Require given files in the VENDORS directory. Takes optional number of parameters.
*
* @param string $name Filename without the .php part.
*
*/
function vendor()
function vendor($name)
{
$args = func_get_args();
foreach ($args as $arg)
{
require_once VENDORS.$arg.'.php';
require_once(VENDORS.$arg.'.php');
}
}
@ -196,10 +187,7 @@ function debug($var = false, $show_html = false)
if (DEBUG)
{
print "\n<pre>\n";
if ($show_html)
{
$var = str_replace('<', '&lt;', str_replace('>', '&gt;', $var));
}
if ($show_html) $var = str_replace('<', '&lt;', str_replace('>', '&gt;', $var));
print_r($var);
print "\n</pre>\n";
}
@ -234,23 +222,16 @@ if (!function_exists('sortByKey'))
function sortByKey(&$array, $sortby, $order='asc', $type=SORT_NUMERIC)
{
if (!is_array($array))
{
return null;
}
foreach ($array as $key => $val)
{
$sa[$key] = $val[$sortby];
}
if ($order == 'asc')
{
asort($sa, $type);
}
else
{
arsort($sa, $type);
}
$order == 'asc'
? asort($sa, $type)
: arsort($sa, $type);
foreach ($sa as $key=>$val)
{
@ -278,16 +259,8 @@ if (!function_exists('array_combine'))
$c1 = count($a1);
$c2 = count($a2);
if ($c1 != $c2)
{
// different lenghts
return false;
}
if ($c1 <= 0)
{
// arrays are the same and both are empty
return false;
}
if ($c1 != $c2) return false; // different lenghts
if ($c1 <= 0) return false; // arrays are the same and both are empty
$output = array();
@ -305,12 +278,14 @@ function h($text)
return htmlspecialchars($text);
}
function a()
{
$args = func_get_args();
return $args;
}
function ha()
{
$args = func_get_args();
@ -323,6 +298,7 @@ function ha()
return $a;
}
function e($text)
{
echo $text;