Beispiel #1
0
 /**
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return int
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $file = getenv('HOME') . '/.bitcoinphp/bitcoin.ini';
     $config = new IniConfigProvider();
     try {
         $config->loadFile($file);
     } catch (\Exception $e) {
         throw new \RuntimeException('Failed to load config file');
     }
     $db = new Db($config);
     $db->reset();
 }
Beispiel #2
0
 /**
  * @return ConfigProviderInterface
  */
 public function load()
 {
     $config = new IniConfigProvider();
     $config->loadFile($this->location);
     return $config;
 }
Beispiel #3
0
 /**
  * Automatically build any missing elements, such as configurations
  */
 public function prepareCubex()
 {
     if (!$this->bound("ConfigProvider")) {
         $config = new IniConfigProvider();
         $files = ['defaults.ini', 'defaults' . DIRECTORY_SEPARATOR . 'config.ini', $this->env() . '.ini', $this->env() . DIRECTORY_SEPARATOR . 'config.ini'];
         foreach ($files as $fileName) {
             $file = Path::build($this->getProjectRoot(), 'conf', $fileName);
             try {
                 $config->loadFile($file, true);
             } catch (\Exception $e) {
             }
         }
         $this->instance("ConfigProvider", $config);
     }
 }