コード例 #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $conf = \Config::get('couch');
     $user = $conf['username'];
     $pass = $conf['password'];
     $host = $conf['hostname'];
     $port = $conf['port'];
     $login = $user ? "{$user}:{$pass}@" : "";
     $guz = new \App\Services\CouchService(['base_uri' => "http://{$login}{$host}:{$port}/", 'timeout' => 1800.0]);
     $guz->setDb('games');
     $this->couchsag = $guz;
     $this->initDoc();
 }
コード例 #2
0
 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     $this->app->singleton('App\\Services\\CouchService', function () {
         $conf = $this->app->config['couch'];
         $user = $conf['username'];
         $pass = $conf['password'];
         $host = $conf['hostname'];
         $port = $conf['port'];
         $login = $user ? "{$user}:{$pass}@" : "";
         $guz = new \App\Services\CouchService(['base_uri' => "http://{$login}{$host}:{$port}/", 'timeout' => 1800.0]);
         $guz->setDb('rest');
         return $guz;
     });
 }