示例#1
0
 public static function create($frameworkPath, array $serverPaths = array(), $clientPaths = array('../client/'), $scriptDir = null, $pathsDir = null)
 {
     $stack = debug_backtrace();
     $file1 = $stack[count($stack) - 1]['file'];
     $file2 = $stack[count($stack) - 2]['file'];
     if (defined('CONVERT_TO_REAL_PATHS')) {
         $file1 = realpath($file1);
         $file2 = realpath($file2);
     }
     if ($scriptDir === null) {
         $scriptDir = str_replace('\\', '/', dirname($file1));
     }
     if ($pathsDir === null) {
         $pathsDir = str_replace('\\', '/', dirname($file2));
     }
     self::$instance = new Gpf_Paths($frameworkPath, $serverPaths, $clientPaths, $scriptDir, $pathsDir);
 }