示例#1
0
文件: Rhaco.php 项目: hisaboh/w2t
 /**
  * 初期定義
  *
  * @param string $path
  * @param string $lib
  * @param string $url
  */
 public static function init($path, $url = null, $lib = null, $work = null)
 {
     self::$inited = true;
     if (is_file($path)) {
         $path = dirname($path);
     }
     self::$PATH = preg_replace("/^(.+)\\/\$/", "\\1", str_replace("\\", "/", $path)) . "/";
     if (isset($lib)) {
         if (is_file($lib)) {
             $lib = dirname($lib);
         }
         self::$LIB = preg_replace("/^(.+)\\/\$/", "\\1", str_replace("\\", "/", $lib)) . "/";
     } else {
         self::$LIB = self::$PATH . "lib/";
     }
     if (isset($work)) {
         if (is_file($work)) {
             $work = dirname($work);
         }
         self::$WORK = preg_replace("/^(.+)\\/\$/", "\\1", str_replace("\\", "/", $work)) . "/";
     } else {
         self::$WORK = self::$PATH . "work/";
     }
     self::$URL = preg_replace("/^(.+)\\/\$/", "\\1", $url) . "/";
     Rhaco::add(self::$LIB);
 }