Ejemplo n.º 1
0
 /**
  * Main function to be called in order to parse the requested URI.
  *
  * <p>The returned parameter list can be accessed as an assoc array.</p>
  *
  * <code>
  * #Defined in routes.conf.php
  * $route['*']['/news/:year/:month'] = array('NewsController', 'show_news_by_year'
  * </code>
  *
  * @param array $routeArr Routes defined in <i>routes.conf.php</i>
  * @param string $subfolder Relative path of the sub directory where the app is located. eg. http://localhost/doophp, the value should be '/doophp/'
  * @return array returns an array consist of the Controller class, action method and parameters of the route
  */
 public function execute($routeArr, $subfolder = '/')
 {
     list($route, $params) = $this->connect($routeArr, $subfolder);
     if ($route[0] === 'redirect') {
         if (sizeof($route) === 2) {
             self::redirect($route[1]);
         } else {
             self::redirect($route[1], true, $route[2]);
         }
     }
     if (isset($route['auth']) === true) {
         $route['authFailURL'] = !isset($route['authFailURL']) ? null : $route['authFailURL'];
         $route['authFail'] = !isset($route['authFail']) ? null : $route['authFail'];
         Doo::loadCore('auth/DooDigestAuth');
         DooDigestAuth::http_auth($route['authName'], $route['auth'], $route['authFail'], $route['authFailURL']);
     }
     if (isset($route['params']) === true) {
         $params = array_merge($params, $route['params']);
     }
     if (isset($route['className']) === true) {
         return array($route[0], $route[1], $params, $route['className']);
     }
     //return Controller class, method, parameters of the route
     return array($route[0], $route[1], $params);
 }
Ejemplo n.º 2
0
    $userDir = DIRECTORY_SEPARATOR . $m[1] . DIRECTORY_SEPARATOR;
    if (false !== strpos(__FILE__, $userDir)) {
        $sm = array();
        $sm["//~{$m[1]}"] = dirname(__DIR__);
        $array = str_replace('array (', 'array(', var_export($sm, 1));
        $symlinkOption = "\$min_symlinks = {$array};";
    }
}
require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../config.php';
if (!$min_enableBuilder) {
    header('Content-Type: text/plain');
    die('This application is not enabled. See https://github.com/mrclay/minify/blob/master/docs/BuilderApp.wiki.md');
}
if (isset($min_builderPassword) && is_string($min_builderPassword) && $min_builderPassword !== '') {
    DooDigestAuth::http_auth('Minify Builder', array('admin' => $min_builderPassword));
}
$cachePathCode = '';
if (!isset($min_cachePath) && !function_exists('sys_get_temp_dir')) {
    $detectedTmp = Minify_Cache_File::tmp();
    $cachePathCode = "\$min_cachePath = " . var_export($detectedTmp, 1) . ';';
}
ob_start();
?>
<!DOCTYPE html>
<title>Minify URI Builder</title>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<style>
body {margin:1em 60px;}
h1, h2, h3 {margin-left:-25px; position:relative;}
Ejemplo n.º 3
0
 public function admin()
 {
     $users['admin'] = '1234';
     $users['doophp'] = '1234';
     $users['demo'] = 'demo';
     Doo::loadCore('auth/DooDigestAuth');
     $username = DooDigestAuth::http_auth('Food Api Admin', $users, 'Failed to login!');
     echo 'You are login now. Welcome, ' . $username;
 }
 public function execute($routeArr, $subfolder = '/')
 {
     list($route, $params) = $this->connect($routeArr, $subfolder);
     if ($route[0] == 'redirect') {
         if (sizeof($route) === 2) {
             self::redirect($route[1]);
         } else {
             self::redirect($route[1], true, $route[2]);
         }
     }
     if (isset($route['auth'])) {
         $route['authFailURL'] = !isset($route['authFailURL']) ? NULL : $route['authFailURL'];
         $route['authFail'] = !isset($route['authFail']) ? NULL : $route['authFail'];
         Doo::loadCore('auth/DooDigestAuth');
         DooDigestAuth::http_auth($route['authName'], $route['auth'], $route['authFail'], $route['authFailURL']);
     }
     if (isset($route['className'])) {
         return array($route[0], $route[1], $params, $route['className']);
     }
     return array($route[0], $route[1], $params);
 }