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; return false;
} }
} }
} }
?> ?>

View file

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