コード例 #1
0
ファイル: modules.php プロジェクト: kshyana/Logiks-Core
 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
ファイル: vendors.php プロジェクト: kshyana/Logiks-Core
 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
ファイル: boot.php プロジェクト: arunjoseph/Logiks-Core
 function checkService($scmd, $supportedEngines = array("php"))
 {
     if (strlen($scmd) <= 0) {
         return false;
     }
     $cachePath = _metaCache("SERVICES", $scmd);
     if (!$cachePath || !file_exists($cachePath)) {
         $modulesFolder = getPluginFolders("modules");
         $cmdArr = array();
         $cmdArr[] = ROOT . APPS_FOLDER . SITENAME . "/services/" . $scmd;
         $cmdArr[] = ROOT . APPS_FOLDER . SITENAME . "/" . APPS_PLUGINS_FOLDER . "modules/" . $scmd . "/service";
         $cmdArr[] = SERVICE_ROOT . "cmds/" . $scmd;
         foreach ($modulesFolder as $path) {
             $cmdArr[] = ROOT . $path . $scmd . "/service";
         }
         $cmdArr = array_unique($cmdArr);
         foreach ($cmdArr as $fl) {
             foreach ($supportedEngines as $ext) {
                 $fpath = "{$fl}.{$ext}";
                 if (file_exists($fpath)) {
                     _metaCacheUpdate("SERVICES", $scmd, $fpath);
                     return array("src" => $fpath, "ext" => $ext);
                 }
             }
         }
     } else {
         $ext = explode(".", $cachePath);
         $ext = end($ext);
         return array("src" => $cachePath, "ext" => $ext);
     }
     return false;
 }
コード例 #4
0
ファイル: media.php プロジェクト: logiks/logiks-core
 function loadMedia($name, $relativeOnly = false, $defaultMedia = null)
 {
     if (strlen($name) <= 0) {
         return "";
     }
     $cachePath = _metaCache("MEDIA:SITE", $name);
     if (!$cachePath) {
         $paths = getLoaderFolders('mediaPaths', "");
         if (count($paths) > 0) {
             foreach ($paths as $a) {
                 if (file_exists(ROOT . $a . $name)) {
                     _metaCacheUpdate("MEDIA:SITE", $name, $a . $name);
                     if (!$relativeOnly) {
                         return SiteLocation . $a . $name;
                     } else {
                         return $a . $name;
                     }
                 }
             }
         }
         if ($defaultMedia == null) {
             return $name;
         } else {
             $defaultMedia;
         }
     } else {
         if (!$relativeOnly) {
             return SiteLocation . $cachePath;
         } else {
             return $cachePath;
         }
     }
 }
コード例 #5
0
ファイル: helpers.php プロジェクト: logiks/logiks-core
 function loadHelpers($helperNames, $path = "*", $type = "include_once")
 {
     if (is_array($helperNames)) {
         foreach ($helperNames as $x => $a) {
             $b = loadHelpers($a);
         }
     } else {
         $cachePath = _metaCache("HELPERS", $helperNames);
         if (!$cachePath || !file_exists($cachePath)) {
             $helperPath = helper_exists($helperNames);
         } else {
             $helperPath = $cachePath;
         }
         if (file_exists($helperPath)) {
             if ($type == "require_once") {
                 require_once $helperPath;
             } elseif ($type == "require") {
                 require $helperPath;
             } elseif ($type == "include_once") {
                 include_once $helperPath;
             } else {
                 include $helperPath;
             }
         } else {
             trigger_logikserror("Helper Not Found :: " . $helperNames, E_LOGIKS_ERROR, 404);
         }
     }
 }
コード例 #6
0
ファイル: widgets.php プロジェクト: logiks/logiks-core
 function checkWidget($widget)
 {
     if (strlen($widget) <= 0) {
         return false;
     }
     $cachePath = _metaCache("WIDGETS", $widget);
     if (!$cachePath) {
         $path = getAllWidgetsFolders();
         foreach ($path as $a) {
             $f1 = ROOT . $a . $widget . "/index.php";
             $f2 = ROOT . $a . $widget . ".php";
             if (file_exists($f1)) {
                 _metaCacheUpdate("WIDGETS", $widget, $f1);
                 return $f1;
             } elseif (file_exists($f2)) {
                 _metaCacheUpdate("WIDGETS", $widget, $f2);
                 return $f2;
             }
         }
         return false;
     } else {
         return $cachePath;
     }
 }