• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión1a7ca1add32e60c5a8d346af215cca33b335f1b0 (tree)
Tiempo2009-01-14 00:06:18
Autorhenoheno <henoheno>
Commiterhenoheno

Log Message

now rewriting

Cambiar Resumen

Diferencia incremental

--- a/bin/pkwk14.php
+++ b/bin/pkwk14.php
@@ -1,6 +1,6 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone.
3-// $Id: pkwk14.php,v 1.5 2009/01/12 04:19:12 henoheno Exp $
3+// $Id: pkwk14.php,v 1.6 2009/01/13 15:06:18 henoheno Exp $
44 // Copyright (C) 2009 PukiWiki Developers Team
55 // License: GPL v2 or (at your option) any later version
66 //
@@ -37,32 +37,39 @@ function load_once($filepath)
3737 {
3838 if (strpos($filepath, ':') !== FALSE) {
3939 err('load: Error: URL-like string');
40- } else if (! file_exists($filepath)) {
41- err('load: Error: No such file: ' . $filepath);
4240 }
4341
4442 require_once($filepath);
4543 }
4644
4745
48-# Default variables -----------------------------------------
46+# Environment variables -------------------------------------
4947
50-// PKWK_ROOT
51-if (isset($_ENV['PKWK_ROOT'])) {
52- $pkwk_root = rtrim($_ENV['PKWK_ROOT'], '/\\') . '/';
53- if (! file_exists($pkwk_root)) {
54- err('Error: [PKWK_ROOT] No such directory: ' . $pkwk_root);
48+$env_default => array(
49+ // ENVIRONMENT => DEFAULT
50+ 'PKWK_ROOT' => '.',
51+ 'PKWK_LIB_DIR', => 'lib',
52+ 'PKWK_PLUGIN_DIR', => 'plugin',
53+ 'PKWK_SKIN_DIR', => 'skin',
54+ 'PKWK_IMAGE_DIR', => 'image',
55+ 'PKWK_DATA_HOME' => '.',
56+);
57+
58+foreach(array_keys($env_default as $key) {
59+ if (isset($_ENV[$key])) {
60+ $env_default[$key] = rtrim($_ENV[$key], '/\\') . '/';
5561 }
56-} else {
57- $pkwk_root = './';
5862 }
59-define('PKWK_ROOT', $pkwk_root);
60-unset($pkwk_root);
63+
64+
65+// if (! file_exists($dirs[$key])) {
66+// err('Error: [' . $key . ] No such directory: ' . $dirs[$key]);
67+// }
6168
6269
6370 # Load libraries --------------------------------------------
6471
65-define('LIB_DIR', PKWK_ROOT . 'lib' . '/');
72+define('LIB_DIR', $env['PKWK_ROOT'] . '/' . $env['PKWK_LIB_DIR'] . '/');
6673 if (! file_exists(LIB_DIR)) {
6774 err('Error: LIB_DIR not found: ' . LIB_DIR);
6875 }