From 1a7ca1add32e60c5a8d346af215cca33b335f1b0 Mon Sep 17 00:00:00 2001 From: henoheno Date: Wed, 14 Jan 2009 00:06:18 +0900 Subject: [PATCH] now rewriting --- bin/pkwk14.php | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/bin/pkwk14.php b/bin/pkwk14.php index 33374a1..9465da1 100644 --- a/bin/pkwk14.php +++ b/bin/pkwk14.php @@ -1,6 +1,6 @@ array( + // ENVIRONMENT => DEFAULT + 'PKWK_ROOT' => '.', + 'PKWK_LIB_DIR', => 'lib', + 'PKWK_PLUGIN_DIR', => 'plugin', + 'PKWK_SKIN_DIR', => 'skin', + 'PKWK_IMAGE_DIR', => 'image', + 'PKWK_DATA_HOME' => '.', +); + +foreach(array_keys($env_default as $key) { + if (isset($_ENV[$key])) { + $env_default[$key] = rtrim($_ENV[$key], '/\\') . '/'; } -} else { - $pkwk_root = './'; } -define('PKWK_ROOT', $pkwk_root); -unset($pkwk_root); + + +// if (! file_exists($dirs[$key])) { +// err('Error: [' . $key . ] No such directory: ' . $dirs[$key]); +// } # Load libraries -------------------------------------------- -define('LIB_DIR', PKWK_ROOT . 'lib' . '/'); +define('LIB_DIR', $env['PKWK_ROOT'] . '/' . $env['PKWK_LIB_DIR'] . '/'); if (! file_exists(LIB_DIR)) { err('Error: LIB_DIR not found: ' . LIB_DIR); } -- 2.11.0