public function testGet_svn_revision() { /* the below is copied verbatim from version.php. This may not be optimal testing. */ $rev = 0; // Cheating! $stash_file = HABARI_PATH . '/.svn/entries'; if (file_exists($stash_file)) { $info = file_get_contents($stash_file); $info = explode("\n", $info); if (strpos($info[4], 'svn.habariproject.org/habari/') !== false) { $rev = intval(trim($info[3])); } } if ($rev == 0) { $rev = intval(preg_replace('/[^0-9]/', '', Version::HABARI_SVN_REV)); } $this->assertEquals($rev, Version::get_svn_revision()); }
?> ">comments feed</a>. <br /> <a href="<?php Site::out_url('habari'); ?> " title="<?php Options::out('title'); ?> "><?php Options::out('title'); ?> </a> is powered by <a href="http://www.habariproject.org/" title="Powered by Habari">Habari <?php echo Version::get_habariversion(); if (Version::is_devel()) { echo ' r' . Version::get_svn_revision(); } ?> </a>. <br /> Theme: <a href="http://www.somefoolwitha.com/hmallow2" title="hMallow2">hMallow2</a>. Administrator <a href="<?php Site::out_url('habari'); ?> /admin"><?php _e('admin'); ?> </a>. <div id="footer_area"> <?php $theme->area('footer');
/** * Handles get requests for the system information page. */ public function get_sysinfo() { $sysinfo = array(); $siteinfo = array(); // Assemble Site Info $siteinfo[_t('Habari Version')] = Version::get_habariversion(); if (Version::is_devel()) { $siteinfo[_t('Habari Version')] .= " r" . Version::get_svn_revision(); } $siteinfo[_t('Habari API Version')] = Version::get_apiversion(); $siteinfo[_t('Habari DB Version')] = Version::get_dbversion(); $siteinfo[_t('Active Theme')] = Options::get('theme_name'); $siteinfo[_t('Site Language')] = strlen(Options::get('system_locale')) ? Options::get('system_locale') : 'en-us'; $this->theme->siteinfo = $siteinfo; // Assemble System Info $sysinfo[_t('PHP Version')] = phpversion(); $sysinfo[_t('Server Software')] = $_SERVER['SERVER_SOFTWARE']; $sysinfo[_t('Database')] = DB::get_driver_name() . ' - ' . DB::get_driver_version(); $sysinfo[_t('PHP Extensions')] = implode(', ', get_loaded_extensions()); if (defined('PCRE_VERSION')) { $sysinfo[_t('PCRE Version')] = PCRE_VERSION; } else { // probably PHP < 5.2.4 ob_start(); phpinfo(8); $phpinfo = ob_get_contents(); ob_end_clean(); preg_match('/PCRE Library Version.*class="v">(.*)$/mi', $phpinfo, $matches); $sysinfo[_t('PCRE Version')] = $matches[1]; } $sysinfo[_t('Browser')] = $_SERVER['HTTP_USER_AGENT']; $this->theme->sysinfo = $sysinfo; // Assemble Class Info $classinfo = Utils::glob(HABARI_PATH . "/user/classes/*.php"); if (count($classinfo)) { $classinfo = array_map('realpath', $classinfo); } $this->theme->classinfo = $classinfo; // Assemble Plugin Info $raw_plugins = Plugins::get_active(); $plugins = array('system' => array(), 'user' => array(), '3rdparty' => array(), 'other' => array()); foreach ($raw_plugins as $plugin) { $file = $plugin->get_file(); if (preg_match('%[\\\\/](system|3rdparty|user)[\\\\/]plugins[\\\\/]%i', $file, $matches)) { // A plugin's info is XML, cast the element to a string. See #1026. $plugins[strtolower($matches[1])][(string) $plugin->info->name] = $file; } else { $plugins['other'][$plugin->info->name] = $file; } } $this->theme->plugins = $plugins; $this->display('sysinfo'); }