/**
  * Call the middleware
  *
  * @return void
  */
 public function call()
 {
     if (empty($this->options)) {
         $this->options = $this->app->config('kraken.controller');
     }
     if (!isset($this->options['mapping'])) {
         $this->next->call();
         return;
     }
     if (empty($this->options['mapping'])) {
         $this->next->call();
         return;
     }
     $mapping = $this->options['mapping'];
     $this->configureMapping($mapping);
     $this->next->call();
 }
示例#2
0
文件: index.php 项目: NaszvadiG/emp
<?php

require '../vendor/autoload.php';
use App\LXC\Host;
$app = new \Bono\App(array('autorun' => false));
$app->get('/', function () use($app) {
    echo 'hello world';
});
$app->run();
示例#3
0
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * @category  PHP_Framework
 * @package   Bono
 * @author    Ganesha <*****@*****.**>
 * @copyright 2013 PT Sagara Xinix Solusitama
 * @license   https://raw.github.com/xinix-technology/bono/master/LICENSE MIT
 * @version   0.10.0
 * @link      http://xinix.co.id/products/bono
 */
require '../vendor/autoload.php';
$app = new \Bono\App(array('autorun' => false, 'mode' => 'development'));
$app->run();
示例#4
0
<?php

require '../vendor/autoload.php';
if (!function_exists('t')) {
    function t($template, array $data = [])
    {
        $templateFile = '../templates/' . $template . '.php';
        if (!is_readable($templateFile)) {
            throw new \Exception('Unreadable template ' . $template);
        }
        ob_start();
        extract($data);
        include $templateFile;
        return ob_get_clean();
    }
}
$app = Bono\App::getInstance();
$app->run();