public function isAFramework($sName)
 {
     $sName = trim(\Flake\Util\Tools::trimSlashes($sName));
     if ($sName === "" || $sName === "." || $sName === "..") {
         return FALSE;
     }
     $sFrameworkPath = PROJECT_PATH_FRAMEWORKS . $sName;
     return file_exists($sFrameworkPath) && is_dir($sFrameworkPath);
 }
Exemple #2
0
 public static function getURLParams()
 {
     $aTokens = self::getRouteTokens();
     # stripping route
     if (!empty($aTokens)) {
         $sRouteUrl = implode("/", $aTokens);
         $sCurrentRoute = $GLOBALS["ROUTER"]::getCurrentRoute();
         if (strpos($sRouteUrl, $sCurrentRoute) === FALSE) {
             throw new \Exception("Flake\\Util\\Router\\QuestionMarkRewrite::getURLParams(): unrecognized route.");
         }
         $sParams = \Flake\Util\Tools::trimSlashes(substr($sRouteUrl, strlen($sCurrentRoute)));
         $aParams = array();
         if ($sParams !== "") {
             $aParams = explode("/", $sParams);
         }
         reset($aParams);
         foreach ($aParams as $sParam => $sValue) {
             $aParams[$sParam] = rawurldecode($sValue);
         }
         return $aParams;
     }
     return array();
 }