Skip to content

Commit

Permalink
MINOR Fixed spaces with tabs in Core (from r113924)
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114540 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
Sam Minnee committed Dec 5, 2010
1 parent 567c0b4 commit edc7a46
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions core/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,15 @@ function array_fill_keys($keys,$value) {
* Class names are converted to lowercase for lookup to adhere to PHP's case-insensitive
* way of dealing with them.
*/
function sapphire_autoload($className)
{
function sapphire_autoload($className) {
global $_CLASS_MANIFEST;
$lClassName = strtolower($className);
if(isset($_CLASS_MANIFEST[$lClassName])) include_once($_CLASS_MANIFEST[$lClassName]);
else if(isset($_CLASS_MANIFEST[$className])) include_once($_CLASS_MANIFEST[$className]);

}

spl_autoload_register('sapphire_autoload');


require_once("core/ManifestBuilder.php");
require_once("core/ClassInfo.php");
require_once('core/Object.php');
Expand Down Expand Up @@ -267,15 +264,15 @@ function sapphire_autoload($className)
// HELPER FUNCTIONS

function getSysTempDir() {
if(function_exists('sys_get_temp_dir')) {
$sysTmp = sys_get_temp_dir();
} elseif(isset($_ENV['TMP'])) {
if(function_exists('sys_get_temp_dir')) {
$sysTmp = sys_get_temp_dir();
} elseif(isset($_ENV['TMP'])) {
$sysTmp = $_ENV['TMP'];
} else {
$tmpFile = tempnam('adfadsfdas','');
unlink($tmpFile);
$sysTmp = dirname($tmpFile);
}
} else {
$tmpFile = tempnam('adfadsfdas','');
unlink($tmpFile);
$sysTmp = dirname($tmpFile);
}
return $sysTmp;
}

Expand Down Expand Up @@ -355,7 +352,7 @@ function singleton($className) {
if(!isset($className)) user_error("singleton() Called without a class", E_USER_ERROR);
if(!is_string($className)) user_error("singleton() passed bad class_name: " . var_export($className,true), E_USER_ERROR);
if(!isset($_SINGLETONS[$className])) {
if(!class_exists($className)) user_error("Bad class to singleton() - $className", E_USER_ERROR);
if(!class_exists($className)) user_error("Bad class to singleton() - $className", E_USER_ERROR);
$_SINGLETONS[$className] = Object::strong_create($className,null, true);
if(!$_SINGLETONS[$className]) user_error("singleton() Unknown class '$className'", E_USER_ERROR);
}
Expand Down Expand Up @@ -426,5 +423,3 @@ function increase_time_limit_to($timeLimit = null) {
}
}
}

?>

0 comments on commit edc7a46

Please sign in to comment.