Ejemplo n.º 1
0
 /**
  * constructor.
  *
  * @param Command     $command
  * @param Container   $container
  * @param IOInterface $io
  */
 public function __construct(Command $command, Container $container = null, IOInterface $io = null)
 {
     $this->command = $command;
     $container = $container ?: Ioc::factory();
     $this->container = $container;
     $container->registerServiceProvider(new MuseProvider($this));
     $io = $io ?: $container->get('io');
     $io->setCommand($command);
     parent::__construct($io);
 }
Ejemplo n.º 2
0
 /**
  * Constructor.
  *
  * @param Container $container
  */
 public function __construct(Container $container = null)
 {
     $this->container = $container ?: Ioc::factory();
 }
Ejemplo n.º 3
0
 /**
  * setUp
  *
  * @return  void
  */
 public function setUp()
 {
     $this->controller = new GetController(null, Ioc::getApplication(), Ioc::factory(), PackageHelper::getPackage('vaseman'));
 }
Ejemplo n.º 4
0
<?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();