コード例 #1
0
ファイル: Bootstrap.php プロジェクト: pruno/github-webhooks
    /**
     * @param string $path
     * @return bool|string
     */
    protected static function findParentPath($path)
    {
        $dir = __DIR__;
        $previousDir = '.';
        while (!is_dir($dir . '/' . $path)) {
            $dir = dirname($dir);
            if ($previousDir === $dir) {
                return false;
            }
            $previousDir = $dir;
        }
        return $dir . '/' . $path;
    }
    protected static function loadConfig()
    {
        if (is_readable(__DIR__ . '/testConfig.php')) {
            self::$config = (include __DIR__ . '/testConfig.php');
        } else {
            self::$config = (include __DIR__ . '/testConfig.php.dist');
        }
        if (!is_array(self::$config)) {
            throw new RuntimeException("Expecting array as configuration " . gettype(self::$config) . " given.");
        }
    }
}
Bootstrap::init();
コード例 #2
0
 /**
  * @return array
  */
 public function getConfig()
 {
     return Bootstrap::getConfig();
 }