Created
December 27, 2013 02:45
-
-
Save zhangwc/8141870 to your computer and use it in GitHub Desktop.
php load javascript files
This file contains hidden or 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
######################################################################################### | |
# - 这里列出所有js文件名 | |
# - 使用#作为注释 | |
# - pre.js、post.jsの順序の変更は不可。 | |
######################################################################################### | |
pre.js | |
NttObject.js | |
# .... | |
post.js |
This file contains hidden or 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
<?php | |
header("Content-Type: application/javascript;charset=UTF-8"); | |
header("Expires: 0"); | |
$fileBaseDir = "./dev"; | |
$str = file_get_contents($fileBaseDir . "/files.txt"); | |
$files = explode("\n", $str); | |
$response = ""; | |
foreach ($files as $file) { | |
$file = trim($file); | |
if ($file == "") continue; | |
if ($file{0} == "#") continue; | |
$content = file_get_contents($fileBaseDir . "/" . $file); | |
$content = $content !== false ? $content : ""; | |
$response .= $content . "\n"; | |
} | |
echo $response; | |
?> |
This file contains hidden or 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
})(window); |
This file contains hidden or 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
(function(window, undefined) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment