コード例 #1
0
 /**
  * getPackages
  *
  * @return  array
  */
 public static function loadPackages()
 {
     /*
      * Get Global Packages
      * -----------------------------------------
      * If you want a package can be used in every applications (for example: Web and Console),
      * set it in Windwalker\Windwalker object.
      */
     $packages = array_merge(parent::loadPackages(), Windwalker::loadPackages());
     /*
      * Get Packages for This Application
      * -----------------------------------------
      * If you want a package only use in this application or want to override a global package,
      * set it here. Example: $packages[] = new Flower\FlowerPackage;
      */
     // Your packages here...
     $packages['_debugger'] = new DebuggerPackage();
     return $packages;
 }
コード例 #2
0
ファイル: Application.php プロジェクト: bgao-ca/vaseman
 /**
  * loadConfiguration
  *
  * @param Registry $config
  *
  * @throws  \RuntimeException
  * @return  void
  */
 protected function loadConfiguration($config)
 {
     Windwalker::loadConfiguration($this->config);
 }
コード例 #3
0
 /**
  * loadRoutingConfiguration
  *
  * @return  mixed
  */
 protected function loadRoutingConfiguration()
 {
     return Windwalker::loadRouting();
 }
コード例 #4
0
ファイル: Application.php プロジェクト: asika32764/natika
 /**
  * loadRoutingConfiguration
  *
  * @return  mixed
  */
 protected function loadRoutingConfiguration()
 {
     $routes = Windwalker::loadRouting();
     $packages = (array) $this->get('package');
     foreach ($packages as $name => $class) {
         $routes[$name] = array('pattern' => '/' . $name, 'package' => $name);
     }
     return $routes;
 }
コード例 #5
0
ファイル: dev.php プロジェクト: asika32764/windmocker
<?php

/**
 * Part of Windwalker project.
 *
 * @copyright  Copyright (C) 2011 - 2014 SMS Taiwan, Inc. All rights reserved.
 * @license    GNU Lesser General Public License version 3 or later. see LICENSE
 */
// Start composer
$autoload = __DIR__ . '/vendor/autoload.php';
if (!is_file($autoload)) {
    exit;
}
include_once $autoload;
include_once __DIR__ . '/etc/define.php';
// Get allow remote ips from config.
\Windwalker\Windwalker::loadConfiguration($config = new \Windwalker\Registry\Registry());
if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !in_array(@$_SERVER['REMOTE_ADDR'], (array) $config->get('dev.allow_ips'))) {
    header('HTTP/1.1 403 Forbidden');
    exit('Forbidden');
}
// Start our application.
$app = new Windwalker\Web\DevApplication(\Windwalker\Ioc::factory());
define('WINDWALKER_DEBUG', $app->get('system.debug'));
$app->execute();