Ejemplo n.º 1
0
/**
 * Runs Frank
 */
function run()
{
    if (Frank::was_run() !== true) {
        $output = Frank::call();
        foreach (Frank::middleware() as $middleware) {
            if (gettype($middleware) == 'string') {
                $middleware = new $middleware();
            }
            $output = $middleware->call($output);
        }
        Frank::output($output);
    }
}
Ejemplo n.º 2
0
/**
 * API to make another route handle execution
 *
 * @param string $route		Route to pass execution to
 */
function pass($route)
{
    Frank::set_request($route);
    Frank::call(array('pass' => true));
}
Ejemplo n.º 3
0
 /**
  * Gets the output from a url
  *
  * @param 	string	$url	 path (in Frank) to get the data for
  * @param	array	$options set of options to pass to Frank::exec()
  * @param	string	$method  type of request to the server (i.e. get, post, put, delete)
  * @return 	string			 data the function outputs
  */
 private function get_data($url, $options = array(), $method = 'get')
 {
     Frank::set_request($url);
     Frank::set_method($method);
     Frank::set_run(true);
     Frank::set_status(array(200, array(), false));
     $output = Frank::call($options);
     foreach (Frank::middleware() as $middleware) {
         if (gettype($middleware) == 'string') {
             $middleware = new $middleware();
         }
         $output = $middleware->call($output);
     }
     return $output[2];
 }