예제 #1
0
 function checkModule($module)
 {
     if (strlen($module) <= 0) {
         return false;
     }
     $cachePath = _metaCache("MODULES", $module);
     if (!$cachePath || !file_exists($cachePath)) {
         $modulespath = getLoaderFolders('pluginPaths', "modules");
         $fpath = "";
         foreach ($modulespath as $a) {
             $f1 = ROOT . $a . $module . "/index.php";
             if (file_exists($f1)) {
                 $fpath = $f1;
                 break;
             } else {
                 $fpath = "";
             }
         }
         if (strlen($fpath) > 0) {
             _metaCacheUpdate("MODULES", $module, $fpath);
             return $fpath;
         } else {
             return false;
         }
     } else {
         return $cachePath;
     }
 }
예제 #2
0
 function checkVendor($vendor)
 {
     if (strlen($vendor) <= 0) {
         return false;
     }
     $cachePath = _metaCache("VENDORS", $vendor);
     if (!$cachePath || !file_exists($cachePath)) {
         $vendorPath = getLoaderFolders('vendorPath', "vendors");
         $fpath = "";
         foreach ($vendorPath as $a) {
             $f1 = ROOT . $a . $vendor . "/boot.php";
             if (file_exists($f1)) {
                 $fpath = $f1;
                 break;
             } else {
                 $fpath = "";
             }
         }
         if (strlen($fpath) > 0) {
             _metaCacheUpdate("VENDORS", $vendor, $fpath);
             return $fpath;
         } else {
             return false;
         }
     } else {
         return $cachePath;
     }
 }
예제 #3
0
 function getAllWidgetsFolders()
 {
     if (!isset($_ENV['WIDGETS_DIRS'])) {
         $_ENV['WIDGETS_DIRS'] = getLoaderFolders('pluginPaths', "widgets");
     }
     return $_ENV['WIDGETS_DIRS'];
 }
예제 #4
0
 function loadMediaList($mediaPath, $relativeOnly = false)
 {
     if (strlen($mediaPath) <= 0) {
         return "";
     }
     $paths = getLoaderFolders('mediaPaths', "");
     foreach ($paths as $a) {
         $fa = $a . $mediaPath;
         if (is_dir(ROOT . $fa)) {
             $out = array();
             $arr = scandir(ROOT . $fa);
             unset($arr[0]);
             unset($arr[1]);
             if (!$relativeOnly) {
                 foreach ($arr as $m => $n) {
                     $fs = $fa . "/" . $n;
                     $fs = str_replace("//", "/", $fs);
                     array_push($out, SiteLocation . $fs);
                 }
             } else {
                 foreach ($arr as $m => $n) {
                     $fs = $fa . "/" . $n;
                     $fs = str_replace("//", "/", $fs);
                     array_push($out, $fs);
                 }
             }
             return $out;
         }
     }
     return array();
 }