Ejemplo n.º 1
0
 static function getPath($path)
 {
     //Add front slash
     if (substr($path, 0, 1) != "/") {
         $path = "/" . $path;
     }
     //Remove end slash
     if (substr($path, -1) == "/") {
         $path = substr($path, 0, strlen($path) - 1);
     }
     //Set a path
     if (!is_dir($_SERVER['DOCUMENT_ROOT'] . $path) && is_dir($path)) {
         //Absoulute Path
         self::$fullPath = $path;
         self::$path = substr($path, strlen($_SERVER['DOCUMENT_ROOT']));
     } else {
         //DocumentRoot Path
         if (!is_null($path)) {
             self::$fullPath = $_SERVER['DOCUMENT_ROOT'] . $path;
             self::$path = $path;
         } else {
             self::$fullPath = $_SERVER['DOCUMENT_ROOT'];
         }
     }
 }
Ejemplo n.º 2
0
 function getApplicationLanguages($application)
 {
     if (substr($application, 0, 1) != "/") {
         $path = "/studio2b.kr/" . $application . "/resources";
     } else {
         $path = $application;
     }
     if (!is_null($application) && is_dir($_SERVER['DOCUMENT_ROOT'] . $path)) {
         $temp = XFDirectory::browse($path);
         foreach ($temp as $directory) {
             if (strlen($directory) == 5 && strpos($directory, "-") !== false) {
                 $return[] = $directory;
             }
         }
         $this->applicationLanguages = $return;
     } else {
         $return = false;
     }
     return $return;
 }