Permalink
Browse files

Re-merge boydjd

  • Loading branch information...
1 parent e2c49d0 commit bea64b4d388d34fc3644f496d9ecf767135e1018 Adam Moore committed Feb 1, 2010
Showing with 18 additions and 16 deletions.
  1. +1 −0 README
  2. +8 −8 phploader/combo.php
  3. +2 −2 phploader/combo_functions.inc.php
  4. +7 −6 phploader/loader.php
View
1 README
@@ -55,3 +55,4 @@ examples
api_docs
Contains the standard YUI API style documentation
+
View
16 phploader/combo.php
@@ -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
@@ -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!');
}
}
@@ -117,7 +117,7 @@
}
echo $rawScript;
} else {
- $rawCSS = '';
+ $rawCss = '';
$cssResourceList = $loader->css_data();
foreach ($cssResourceList["css"] as $cssResource=>$val) {
foreach (
@@ -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!');
}
View
4 phploader/combo_functions.inc.php
@@ -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(
@@ -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');
}
View
13 phploader/loader.php
@@ -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
@@ -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!"
+ );
}
/*
@@ -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;
@@ -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'];

0 comments on commit bea64b4

Please sign in to comment.