コード例 #1
0
ファイル: Manager.php プロジェクト: php-yaoi/php-yaoi
 /**
  * @return Storage
  */
 protected function getStorage()
 {
     if (null === $this->storage) {
         $this->storage = Storage::getInstance($this->settings->storage);
     }
     return $this->storage;
 }
コード例 #2
0
ファイル: SerializeProxy.php プロジェクト: php-yaoi/php-yaoi
 /**
  * @param Settings|null $dsn
  * @throws Exception
  * @throws \Yaoi\Service\Exception
  */
 public function __construct(Settings $dsn = null)
 {
     $this->settings = $dsn ? $dsn : Storage::createSettings();
     if (empty($dsn->proxyClient)) {
         throw new Exception('proxyClient required in dsn', Exception::PROXY_REQUIRED);
     }
     $this->storage = Storage::getInstance($this->settings->proxyClient);
 }
コード例 #3
0
ファイル: Layout.php プロジェクト: phperf/result-collector
    public function render()
    {
        $isDev = Auth::getInstance('dev')->isProvidedDemandOnWrong();
        ?>
<html>
<head>
    <title><?php 
        echo $this->title;
        ?>
</title>
    <link rel="stylesheet" type="text/css" href="/css/style.css" />
    <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
    <link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css" rel="stylesheet" />
    <script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js"></script>
    <script src="/js/tag-filter.js"></script>

</head>
<body>
<div class="list">
    <?php 
        echo $this->list;
        ?>
</div>

<div class="filters">
    <?php 
        echo $this->filters;
        ?>
</div>

<div class="main">
    <?php 
        echo $this->main;
        ?>
</div>

<?php 
        if ($isDev) {
            ?>
<div class="dev-debug">
    <a href="/dev?logout">Logout debug mode</a>
    <?php 
            $debugStorage = Storage::getInstance('debug_log');
            $debugStorage->set('_SERVER', $_SERVER);
            CollapsiblePrintR::create($debugStorage->exportArray())->render();
            ?>
</div><?php 
        }
        ?>

</body>
</html>
<?php 
    }
コード例 #4
0
ファイル: Storage.php プロジェクト: php-yaoi/php-yaoi
 public function __construct(Settings $dsn = null)
 {
     $this->storage = \Yaoi\Storage::getInstance($dsn->storage);
 }
コード例 #5
0
ファイル: conf.dist.php プロジェクト: xiaoix/project-1
use Yaoi\Database;
use Yaoi\Http;
use Yaoi\Migration;
use Yaoi\Mock;
use Yaoi\Storage;
date_default_timezone_set('Asia/Bangkok');
//Storage::getInstance('mock')->deleteAll();
Client::register(function () {
    $settings = new Settings();
    $settings->username = '******';
    $settings->password = '******';
    return $settings;
});
Http\Client::register(function () {
    $client = new Http\Client();
    $client->mock(new Mock(Storage::getInstance('mock')));
    return $client;
});
Storage::register(function () {
    $settings = new Storage\Settings();
    $settings->driverClassName = Storage\Driver\SerializedFile::className();
    $settings->path = __DIR__ . '/resources/mock4.serialized';
    return $settings;
}, 'mock');
Database::register('mysqli://root:@localhost/wakabot?timezone=Asia/Jakarta');
/*
Database::register(function(){
    $settings = new Database\Settings();
    $settings->driverClassName = Database\Driver\Sqlite::className();
    $settings->path = __DIR__ . '/resources/db.sqlite';
    return $settings;
コード例 #6
0
ファイル: App.php プロジェクト: php-yaoi/php-yaoi
 static function cache($identifier = Service::PRIMARY)
 {
     return Storage::getInstance($identifier);
 }