Bolt\Translation\TranslationFile::contentInfo PHP 메소드

contentInfo() 개인적인 메소드

Get the content of the info translation file or the fallback file.
private contentInfo ( ) : string
리턴 string
    private function contentInfo()
    {
        $path = $this->absPath;
        // if the file doesn't exist yet, point to the fallback one
        if (!file_exists($path) || filesize($path) < 10) {
            // fallback
            $localeFallbacks = $this->app['locale_fallbacks'];
            list($path) = $this->buildPath('infos', reset($localeFallbacks));
            if (!file_exists($path)) {
                $this->app['logger.flash']->danger('Locale infos yml file not found. Fallback also not found.');
                // fallback failed
                return null;
            }
            // we got the fallback, notify user we loaded the fallback
            $this->app['logger.flash']->warning('Locale infos yml file not found, loading the default one.');
        }
        return file_get_contents($path);
    }