Released under GPLv3 license; see LICENSE.
Inheritance: extends BaseRoute
示例#1
0
文件: configure.php 项目: swk/bluebox
 public function postInstall()
 {
     Doctrine::getTable('SimpleRoute')->getRecordListener()->get('MultiTenant')->setOption('disabled', TRUE);
     foreach (SimpleRouteLib::importConfigRoutes() as $route) {
         $simpleRoute = new SimpleRoute();
         $simpleRoute->fromArray($route);
         $simpleRoute['account_id'] = 1;
         $simpleRoute->save();
     }
     Doctrine::getTable('SimpleRoute')->getRecordListener()->get('MultiTenant')->setOption('disabled', FALSE);
 }
示例#2
0
 /**
  *    Stashes the proxy address.
  *    @param SimpleUrl $url     URL as object.
  *    @param string $proxy      Proxy URL.
  *    @param string $username   Username for autentication.
  *    @param string $password   Password for autentication.
  *    @access public
  */
 function __construct($url, $proxy, $username = false, $password = false)
 {
     parent::__construct($url);
     $this->proxy = $proxy;
     $this->username = $username;
     $this->password = $password;
 }
示例#3
0
 /**
  * @see SimpleRoute::__construct()
  * @param string $uri The URI pattern
  * @param string|callable $action The action to dispatch the request to
  * @param string $method The HTTP method
  * @param string[string] $headers Any HTTP headers to match
  * @param array[string] $defaults Default parameter values
  * @throws \InvalidArgumentException If $uri or $method is empty or non-string
  */
 public function __construct($uri, $action, $method = null, array $headers = [], array $defaults = [])
 {
     $this->defaults = $defaults;
     parent::__construct($uri, $action, $method, $headers);
 }
示例#4
0
<?php

ini_set('date.timezone', 'Asia/Shanghai');
define('APPLICATION_PATH', dirname(dirname(__FILE__)));
include APPLICATION_PATH . '/bootstrap.php';
$uri = isset($_GET['r']) ? $_GET['r'] : 'task/list';
$Route = new SimpleRoute();
$Route->mapped($uri);
$Route->callAction();