示例#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();
 }
示例#2
0
 /**
  * @return ConfigProviderInterface
  */
 public function load()
 {
     $config = new IniConfigProvider();
     $config->loadFile($this->location);
     return $config;
 }
示例#3
0
文件: Cubex.php 项目: cubex/framework
 /**
  * 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);
     }
 }