Skip to content

Commit

Permalink
Bring into line with OpenFISMA coding standards (more strict than Zend)
Browse files Browse the repository at this point in the history
  • Loading branch information
boydjd committed Feb 1, 2010
1 parent 3e3a2b0 commit 08c5cee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
16 changes: 8 additions & 8 deletions phploader/combo.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
file_exists($localPathToBuild) === false ||
is_readable($localPathToBuild) === false
) {
die('<!-- Unable to locate the YUI build directory! -->');
throw new Exception('Unable to locate the YUI build directory!');
}

//Detect and load the required components now
Expand All @@ -95,7 +95,7 @@
//Add module to array for loading
$yuiComponents[] = $parts[2];
} else {
die('<!-- Unable to determine module name! -->');
throw new Exception('Unable to determine module name!');
}
}

Expand All @@ -117,7 +117,7 @@
}
echo $rawScript;
} else {
$rawCSS = '';
$rawCss = '';
$cssResourceList = $loader->css_data();
foreach ($cssResourceList["css"] as $cssResource=>$val) {
foreach (
Expand Down Expand Up @@ -147,20 +147,20 @@
); // AlphaImageLoader relative paths (e.g.)
// AlphaImageLoader(src='../../foo.png')

$rawCSS .= $crtResourceContent;
$rawCss .= $crtResourceContent;
}
}

//Cleanup build path dups caused by relative paths that already
//included the build directory
$rawCSS = str_replace("/build/build/", "/build/", $rawCSS);
$rawCss = str_replace("/build/build/", "/build/", $rawCss);

if (APC_AVAIL === true) {
apc_store(server(true), $rawCSS, APC_TTL);
apc_store(server(true), $rawCss, APC_TTL);
}
echo $rawCSS;
echo $rawCss;
}
}
} else {
die('<!-- No YUI modules defined! -->');
throw new Exception('No YUI modules defined!');
}
4 changes: 2 additions & 2 deletions phploader/combo_functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//server(): Computes the base URL of the current page (protocol, server, path)
//credit: http://code.google.com/p/simple-php-framework/
//(modified version of full_url), license: MIT
function server($includeRequestURI=false)
function server($includeRequestUri=false)
{
$s = getenv('HTTPS') ? '' : (getenv('HTTPS') == 'on') ? 's' : '';
$protocol = substr(
Expand All @@ -19,7 +19,7 @@ function server($includeRequestURI=false)
$port = (getenv('SERVER_PORT') == '80') ? '' : (":".getenv('SERVER_PORT'));
$server = $protocol . "://" . getenv('HTTP_HOST') . $port;

if ($includeRequestURI === true) {
if ($includeRequestUri === true) {
$server .= getenv('REQUEST_URI');
}

Expand Down
13 changes: 7 additions & 6 deletions phploader/loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
define('YUI_TYPE', 'type');
define('YUI_URL', 'url');


/**
* The YUI PHP loader base class which provides dynamic server-side loading for
* YUI
Expand Down Expand Up @@ -338,12 +337,14 @@ class YAHOO_util_Loader
* @param {boolean} noYUI Pass true if you do not want the YUI metadata
*/
function YAHOO_util_Loader(
$yuiVersion, $cacheKey=null, $modules=null, $noYUI=false
$yuiVersion, $cacheKey=null, $modules=null, $noYui=false
)
{
if (!isset($yuiVersion)) {
die("Error: The first parameter of YAHOO_util_Loader must specify "
. "which version of YUI to use!");
throw new Exception(
"Error: the first parameter of YAHOO_util_Loader must specify " .
"which version of YUI to use!"
);
}

/*
Expand All @@ -367,7 +368,7 @@ function YAHOO_util_Loader(
$inf = json_decode($jsonConfigString, true);
$GLOBALS['yui_current'] = $inf;
} else {
die("Unable to find a suitable YUI metadata file!");
throw new Exception("Unable to find a suitable YUI metadata file!");
}

global $yuiCurrent;
Expand Down Expand Up @@ -398,7 +399,7 @@ function YAHOO_util_Loader(
$this->filters = $cache[YUI_FILTERS];
} else {
// set up the YUI info for the current version of the lib
if ($noYUI) {
if ($noYui) {
$this->modules = array();
} else {
$this->modules = $yuiCurrent['moduleInfo'];
Expand Down

0 comments on commit 08c5cee

Please sign in to comment.