示例#1
0
文件: changelog.php 项目: rikaix/core
        parent::__construct();
        $this->User->authenticate();
    }
    /**
     * Run the controller
     */
    public function run()
    {
        $strBuffer = file_get_contents(TL_ROOT . '/system/docs/CHANGELOG.md');
        $strBuffer = str_replace("\r", '', $strBuffer);
        // see #4190
        $strBuffer = preg_replace(array('/#([0-9]+)/', '/(---+\\n)(?!\\n)/', '/([^\\n]+)\\n===+\\n/', '/([^\\n]+)\\n---+\\n/', '/\\n### ([^\\n]+)\\n/', '/ _(?!_)/', '/_ /', '/===+\\n/'), array('<a href="https://github.com/contao/core/issues/$1" target="_blank">#$1</a>', "\$1\n", '<h2>$1</h2>', "<h3>\$1</h3>\n", "<h4>\$1</h4>\n", ' <em>', '</em> ', ''), $strBuffer);
        $strBuffer = str_replace(array("\n\n```\n", "\n```\n\n", ' `', '` ', '(`', '`)', "\n`", "`\n", '`.', '`,'), array("\n\n<pre>", "</pre>\n\n", ' <code>', '</code> ', '(<code>', '</code>)', "\n<code>", "</code>\n", '</code>.', '</code>,'), trim($strBuffer));
        $this->Template = new BackendTemplate('be_changelog');
        // Template variables
        $this->Template->content = $strBuffer;
        $this->Template->theme = $this->getTheme();
        $this->Template->base = Environment::get('base');
        $this->Template->language = $GLOBALS['TL_LANGUAGE'];
        $this->Template->title = specialchars($GLOBALS['TL_LANG']['MSC']['changelog']);
        $this->Template->charset = $GLOBALS['TL_CONFIG']['characterSet'];
        $GLOBALS['TL_CONFIG']['debugMode'] = false;
        $this->Template->output();
    }
}
/**
 * Instantiate the controller
 */
$objChangelog = new Changelog();
$objChangelog->run();