示例#1
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$di = DI::getInstance();
 }
示例#2
0
<?php

$di = \Fw\DI::getInstance();
$di->set('request', '\\Fw\\Http\\Request', true);
$di->set('response', '\\Fw\\Http\\Response', true);
switch (BUILD_LIST_ADAPTER) {
    case 'File':
        $di->set('buildList', function () {
            return new \Cm\Download\Api\BuildList\File(BUILD_LIST_FILE);
        });
        break;
    case 'Folder':
        $di->set('buildList', function () {
            return new \Cm\Download\Api\BuildList\Folder(DOWNLOAD_ROOT, DOWNLOAD_BASE_URL);
        });
        break;
    default:
        /** @var \Fw\Http\Response $response */
        $response = $di->get('response');
        $response->setup(500, \Fw\Http::CONTENT_TYPE_TEXT, '')->send();
}
示例#3
0
 /**
  * User constructor
  */
 public function __construct()
 {
     $this->di = DI::getInstance();
 }