forked from yui/phploader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7d2dbb8
Showing
36 changed files
with
6,267 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
These instructions are only needed if your machine does not have yinst (e.g., Macs) | ||
|
||
---------------------------------------------------------- | ||
New install | ||
---------------------------------------------------------- | ||
|
||
1) If not already created, create the /home/y directory structure: | ||
|
||
sudo mkdir -p /home/y/share/pear/Yahoo/YUI | ||
|
||
2) Copy/link loader.php, config.php, to that directory | ||
|
||
sudo cp ~/dev/yahoo/presentation/tools/yui_loader/*.php /home/y/share/pear/Yahoo/YUI | ||
|
||
3) Restart Apache | ||
|
||
---------------------------------------------------------- | ||
Updating | ||
---------------------------------------------------------- | ||
|
||
Update cvs and repeat steps 2 and 3. If you link to the cvsroot files rather than copy them, | ||
this becomes unnecessary. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Yahoo UI Library Loader | ||
|
||
Provides a PHP include file that will allow you to specify package | ||
javascript and css module requirements. It maintains a dependency | ||
tree for these modules so when a module is requested, all of the | ||
other modules it depends on are included as well. By default, the | ||
YUI Library is configured, and other modules and their dependencies | ||
can be added via PHP. | ||
|
||
ChangeLog | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Version 2.0.4 (08/06/08, adamoore) | ||
- Fixed incorrect canEmbed() function referece that prevented raw output. | ||
|
||
Version 2.0.3 (05/06/08, adamoore) | ||
- APC ttl is now off by default | ||
|
||
Version 2.0.2 (02/26/08, adamoore) | ||
- CSS files that depend on skinnable components will load after the corresponding skin. | ||
|
||
Version 2.0.1 (12/04/07, adamoore) | ||
- YUI 2.4.0 release | ||
- Config has moved into yui_module_info | ||
|
||
Version 2.0.0 (11/30/07, adamoore) | ||
|
||
- The 2.0 release of loader offers improved performance, and it is a | ||
recommended upgrade for all current users. There will be one more | ||
release of the 1.x version of loader, which will be released when | ||
YUI 2.4.0 is released. Future YUI releases will require an upgrade | ||
to the 2.x version of the loader. | ||
|
||
Migrating from 1.x: | ||
|
||
Most common usages of the utility will work with no change. Your | ||
implementation will need to change if: | ||
|
||
- You pass in a list of required modules to the constructor: | ||
|
||
$loader = new YAHOO_util_Loader("dragdrop", "tabview"); | ||
|
||
This is no longer supported. You must use the load method: | ||
|
||
$loader = new YAHOO_util_Loader(); | ||
$loader->("dragdrop", "tabview"); | ||
|
||
- You use the target property to switch between debug/raw/production | ||
sources: | ||
|
||
$loader->target = $yui_load_manager->DEBUG; | ||
|
||
This is configured in a different manner now: | ||
|
||
$loader->base = "/yui/" // Use this base path instead of http://yui.yahooapis.com/2.4.0/build/ | ||
$loader->filter = YUI_DEBUG; // use -debug files instead of -min. YUI_RAW is a valid option too. | ||
|
||
- If you add your own dependencies, or do anything that used or modified | ||
$yui_config: | ||
|
||
The configuration mechanism has completely changed. See the documentation | ||
for information about custom configurations. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* | ||
* jslint_console is a simple console wrapper for Doug Crockford's jslint | ||
* application: http://www.crockford.com/jslint/lint.html | ||
* | ||
* Config: specify the path to fulljslint.js, available for download | ||
* at the above site. | ||
* | ||
* The included jslint.sh file provides the mechanism to pipe a file's | ||
* contents, using SpiderMonkey, into jslint_console | ||
* | ||
*/ | ||
|
||
var navigator = { | ||
userAgent: "custom" | ||
}; | ||
|
||
load("../../build/yuiloader/yuiloader-beta.js"); | ||
load("../../build/json/json-beta.js"); | ||
|
||
var l = new YAHOO.util.YUILoader(); | ||
|
||
print(YAHOO.lang.JSON.stringify({ | ||
|
||
base: l.base, | ||
skin: l.skin, | ||
moduleInfo: l.moduleInfo | ||
|
||
})); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
function getRemoteContent($url) { | ||
$content = ""; | ||
$remote_content = apc_fetch($url); | ||
|
||
if (!$remote_content) { | ||
|
||
$ch = curl_init(); | ||
|
||
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to | ||
curl_setopt($ch, CURLOPT_FAILONERROR, 1); | ||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable | ||
// curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s | ||
|
||
$remote_content = curl_exec($ch); | ||
|
||
// save the contents of the remote url for 30 minutes | ||
apc_store($url, $remote_content, 1800); | ||
|
||
curl_close ($ch); | ||
} | ||
|
||
$content = $remote_content; | ||
return $content; | ||
} | ||
|
||
$json = getRemoteContent('http://127.0.0.1/phploader/phploader/YUIJSON.txt'); | ||
|
||
$inf = json_decode($json, true); | ||
|
||
print_r( '<?php $yui_current = ' . var_export($inf, true) . '; ?>'); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
java -jar /usr/local/js/js.jar YUIJSON.js $* > YUIJSON.txt | ||
|
||
curl -o config.php http://127.0.0.1/phploader/phploader/YUIJSON.php | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"base":"http://yui.yahooapis.com/2.3.1/build/","skin":{"path":"skin.css","rollup":3,"base":"assets/skins/","defaultSkin":"sam"},"moduleInfo":{"logger":{"path":"logger/logger-min.js","skinnable":true,"requires":["event","dom"],"type":"js","optional":["dragdrop"]},"autocomplete":{"path":"autocomplete/autocomplete-min.js","skinnable":true,"requires":["dom","event"],"type":"js","optional":["connection","animation"]},"reset":{"type":"css","path":"reset/reset-min.css"},"animation":{"type":"js","requires":["dom","event"],"path":"animation/animation-min.js"},"dom":{"type":"js","requires":["yahoo"],"path":"dom/dom-min.js"},"event":{"type":"js","requires":["yahoo"],"path":"event/event-min.js"},"utilities":{"supersedes":["yahoo","event","dragdrop","animation","dom","connection","element","yahoo-dom-event"],"path":"utilities/utilities.js","rollup":6,"type":"js"},"containercore":{"type":"js","requires":["dom","event"],"path":"container/container_core-min.js"},"reset-fonts-grids":{"type":"css","supersedes":["reset","fonts","grids"],"path":"reset-fonts-grids/reset-fonts-grids.css"},"slider":{"path":"slider/slider-min.js","requires":["dragdrop"],"type":"js","optional":["animation"]},"calendar":{"path":"calendar/calendar-min.js","skinnable":true,"requires":["event","dom"],"type":"js"},"container":{"supersedes":["containercore"],"path":"container/container-min.js","skinnable":true,"requires":["dom","event"],"type":"js","optional":["dragdrop","animation"]},"history":{"type":"js","requires":["event"],"path":"history/history-beta-min.js"},"connection":{"type":"js","requires":["event"],"path":"connection/connection-min.js"},"colorpicker":{"path":"colorpicker/colorpicker-beta-min.js","skinnable":true,"requires":["slider","element"],"type":"js","optional":["animation"]},"yahoo-dom-event":{"supersedes":["yahoo","event","dom"],"path":"yahoo-dom-event/yahoo-dom-event.js","rollup":3,"type":"js"},"fonts":{"type":"css","path":"fonts/fonts-min.css"},"dragdrop":{"type":"js","requires":["dom","event"],"path":"dragdrop/dragdrop-min.js"},"datasource":{"path":"datasource/datasource-beta-min.js","requires":["event"],"type":"js","optional":["connection"]},"imageloader":{"type":"js","requires":["event","dom"],"path":"imageloader/imageloader-experimental-min.js"},"tabview":{"path":"tabview/tabview-min.js","skinnable":true,"requires":["element"],"type":"js","optional":["connection"]},"datatable":{"path":"datatable/datatable-beta-min.js","skinnable":true,"requires":["element","datasource"],"type":"js","optional":["calendar","dragdrop"]},"treeview":{"path":"treeview/treeview-min.js","skinnable":true,"requires":["event"],"type":"js"},"grids":{"path":"grids/grids-min.css","requires":["fonts"],"type":"css","optional":["reset"]},"editor":{"path":"editor/editor-beta-min.js","skinnable":true,"requires":["menu","element","button"],"type":"js","optional":["animation","dragdrop"]},"yuiloader":{"type":"js","path":"yuiloader/yuiloader-beta-min.js"},"yuitest":{"path":"yuitest/yuitest-beta-min.js","skinnable":true,"requires":["logger"],"type":"js"},"element":{"type":"js","requires":["dom","event"],"path":"element/element-beta-min.js"},"menu":{"path":"menu/menu-min.js","skinnable":true,"requires":["containercore"],"type":"js"},"button":{"path":"button/button-beta-min.js","skinnable":true,"requires":["element"],"type":"js","optional":["menu"]},"yahoo":{"type":"js","path":"yahoo/yahoo-min.js"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* | ||
* jslint_console is a simple console wrapper for Doug Crockford's jslint | ||
* application: http://www.crockford.com/jslint/lint.html | ||
* | ||
* Config: specify the path to fulljslint.js, available for download | ||
* at the above site. | ||
* | ||
* The included jslint.sh file provides the mechanism to pipe a file's | ||
* contents, using SpiderMonkey, into jslint_console | ||
* | ||
*/ | ||
|
||
var navigator = { | ||
userAgent: "custom" | ||
}; | ||
|
||
load("http://yui.yahooapis.com/2.3.1/build/yahoo/yahoo-min.js"); | ||
load("http://yui.yahooapis.com/2.3.1/build/yuiloader/yuiloader-beta-min.js"); | ||
load("../../build/json/json-beta.js"); | ||
|
||
var l = new YAHOO.util.YUILoader(); | ||
|
||
print(YAHOO.lang.JSON.stringify({ | ||
|
||
base: l.base, | ||
skin: l.skin, | ||
moduleInfo: l.moduleInfo | ||
|
||
})); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
java -jar /usr/local/js/js.jar YUIJSON_231.js $* > YUIJSON.txt | ||
|
||
curl -o config_231.php http://127.0.0.1/phploader/phploader/YUIJSON.php | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/** | ||
* This is a compatibility layer that can be used for yui_loader configuration files | ||
* created for versions prior to < 1.2.5. Prior to 1.2.5, yui_loader only supported | ||
* php5. Globals had to be rewired for php4 compatibility. Obviously, don't include | ||
* this file on php4 systems. | ||
*/ | ||
|
||
class YAHOO_util_LoadManager { | ||
|
||
// constants for the default targets | ||
const LOCAL = 'PE-LOCAL'; // Local box | ||
const DEV = 'PE-DEV'; // makeover.corp | ||
const DEBUG = 'PE-DEBUG'; // makeover.corp with debug filter | ||
const PROD = 'PE-PROD'; // Akamai | ||
|
||
// known script paths | ||
public static $paths = array(); | ||
// known modules | ||
public static $modules = array(); | ||
// meta modules | ||
public static $rollupModules = array(); | ||
// global dependencies | ||
public static $globalDependencies = array(); | ||
// global config for allowing embed | ||
public static $canEmbed = true; | ||
|
||
function addGlobalDependency($module) { | ||
global $yui_load_manager; | ||
$yui_load_manager->addGlobalDependency($module); | ||
} | ||
|
||
function getGlobalDependencies($moduleType=null) { | ||
global $yui_load_manager; | ||
$yui_load_manager->getGlobalDependencies($module); | ||
} | ||
|
||
function init() { | ||
global $yui_load_manager; | ||
YAHOO_util_LoadManager::$paths =& $yui_load_manager->paths; | ||
YAHOO_util_LoadManager::$modules =& $yui_load_manager->modules; | ||
YAHOO_util_LoadManager::$rollupModules =& $yui_load_manager->rollupModules; | ||
YAHOO_util_LoadManager::$globalDependencies =& $yui_load_manager->globalDependencies; | ||
} | ||
} | ||
|
||
YAHOO_util_LoadManager::init(); | ||
|
||
?> |
Oops, something went wrong.