/** * This checks for the correct Long Version. * * @return void */ public function testGetLongVersion() { $expected = 'Joomla! 12.23.999 Testing [ Desperation ] 22-June-3109 13:13 CDT'; $this->assertEquals( $expected, $this->object->getLongVersion(), 'Should get the correct Long Version' ); }
public function getInfo() { $info = array(); $version = new JVersion(); $platform = new JPlatform(); $db = JFactory::getDbo(); if (isset($_SERVER['SERVER_SOFTWARE'])) { $sf = $_SERVER['SERVER_SOFTWARE']; } else { $sf = getenv('SERVER_SOFTWARE'); } $info['php'] = php_uname(); $info['dbversion'] = $db->getVersion(); $info['dbcollation'] = $db->getCollation(); $info['phpversion'] = phpversion(); $info['server'] = $sf; $info['sapi_name'] = php_sapi_name(); $info['version'] = $version->getLongVersion(); $info['platform'] = $platform->getLongVersion(); $info['useragent'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ""; $info['j2store_version'] = $this->getJ2storeVerion(); $info['is_pro'] = J2Store::isPro(); $info['curl'] = $this->_isCurl(); $info['json'] = $this->_isJson(); $config = JFactory::getConfig(); $info['error_reporting'] = $config->get('error_reporting'); $caching = $config->get('caching'); $info['caching'] = $caching ? JText::_('J2STORE_ENABLED') : JText::_('J2STORE_DISABLED'); $cache_plugin = JPluginHelper::isEnabled('system', 'cache'); $info['plg_cache_enabled'] = $cache_plugin; $info['memory_limit'] = ini_get('memory_limit'); return $info; }
function _loadVersions() { $version = new JVersion(); $this->data['Versions']['Joomla!'] = $version->getLongVersion(); $this->data['Versions']['J!Dump'] = DUMP_VERSION; $this->data['Versions']['PHP'] = phpversion(); $this->data['Versions']['Apache'] = function_exists('apache_get_version') ? apache_get_version() : 'unknown'; $this->data['Versions']['Zend Engine'] = zend_version(); }
/** * Get the member items of the submenu. * * @param \Joomla\Registry\Registry &$params The parameters object. * * @return string String containing the current Joomla version based on the selected format. */ public static function getVersion(&$params) { $version = new JVersion(); $versionText = $version->getShortVersion(); $product = $params->get('product', 0); if ($params->get('format', 'short') === 'long') { $versionText = str_replace($version::PRODUCT . ' ', '', $version->getLongVersion()); } if (!empty($product)) { $versionText = $version::PRODUCT . ' ' . $versionText; } return $versionText; }
/** * Execute the version command * * @param InputInterface $input An InputInterface instance * @param OutputInterface $output An OutputInterface instance * * @return void */ protected function execute(InputInterface $input, OutputInterface $output) { $this->setupEnvironment('site', $input, $output); $version = new \JVersion(); if ($input->getOption('short')) { $result = $version->getShortVersion(); } elseif ($input->getOption('release')) { $result = $version->RELEASE; } else { $result = $version->getLongVersion(); } $output->writeln($result); }
public function getList() { if(!$this->_list) { $nooku_version = new JVersion(); $server_software = $_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVER_SOFTWARE'] : JText::_('n/a'); $rows = array( array( 'setting' => JText::_('PHP Built On'), 'value' => php_uname() ), array( 'setting' => JText::_('Database Version'), 'value' => mysqli_get_server_info(KFactory::get('koowa:database.adapter.mysqli')->getConnection()) ), array( 'setting' => JText::_('Database Collation'), 'value' => KFactory::get('com://admin/extensions.database.table.plugins')->getSchema()->collation ), array( 'setting' => JText::_('PHP Version'), 'value' => phpversion() ), array( 'setting' => JText::_('Web Server'), 'value' => $server_software ), array( 'setting' => JText::_('WebServer to PHP Interface'), 'value' => php_sapi_name() ), array( 'setting' => JText::_('Nooku Server Version'), 'value' => $nooku_version->getLongVersion() ), array( 'setting' => JText::_('User Agent'), 'value' => $_SERVER['HTTP_USER_AGENT'], ENT_QUOTES ) ); $this->_list = KFactory::get('com://admin/info.database.rowset.system') ->addData($rows, false); } return $this->_list; }
<?php echo php_sapi_name(); ?> </td> </tr> <tr> <td> <strong><?php echo JText::_('Joomla! Version'); ?> :</strong> </td> <td> <?php $version = new JVersion(); echo $version->getLongVersion(); ?> </td> </tr> <tr> <td> <strong><?php echo JText::_('User Agent'); ?> :</strong> </td> <td> <?php echo phpversion() <= "4.2.1" ? getenv("HTTP_USER_AGENT") : $_SERVER['HTTP_USER_AGENT']; ?> </td>
/** * Tests the getLongVersion method * * @return void * * @since 3.0 */ public function testGetLongVersion() { $this->assertInternalType('string', $this->object->getLongVersion()); }
/** * Returns the platform name and version * @param string $platform_name Name of the platform, e.g. Joomla! * @param string $version Full version of the platform */ public function getPlatformVersion(&$platform_name, &$version) { // Load the version.php of the suitable Joomla! release if (!class_exists('JVersion')) { $paths = array(JPATH_SITE . '/libraries/cms/version/version.php', JPATH_SITE . '/libraries/joomla/version.php', JPATH_SITE . '/includes/version.php'); foreach ($paths as $path) { if (@file_exists($path)) { require_once $path; break; } } } $platform_name = "Joomla!"; $v = new JVersion(); $version = $v->getLongVersion(); }
/** * Method to generate all the reportconfiguration. * * @return string * @since 1.6 */ public function getSystemReport () { $kunena_app = JFactory::getApplication (); $kunena_db = JFactory::getDBO (); $JVersion = new JVersion(); $jversion = $JVersion->getLongVersion(); if($kunena_app->getCfg('legacy' )) { $jconfig_legacy = '[color=#FF0000]Enabled[/color]'; } else { $jconfig_legacy = 'Disabled'; } if(!$kunena_app->getCfg('smtpuser' )) { $jconfig_smtpuser = '******'; } else { $jconfig_smtpuser = $kunena_app->getCfg('smtpuser' ); } if($kunena_app->getCfg('ftp_enable' )) { $jconfig_ftp = 'Enabled'; } else { $jconfig_ftp = 'Disabled'; } if($kunena_app->getCfg('sef' )) { $jconfig_sef = 'Enabled'; } else { $jconfig_sef = 'Disabled'; } if($kunena_app->getCfg('sef_rewrite' )) { $jconfig_sef_rewrite = 'Enabled'; } else { $jconfig_sef_rewrite = 'Disabled'; } if (file_exists(JPATH_ROOT.'/.htaccess')) { $htaccess = 'Exists'; } else { $htaccess = 'Missing'; } if(ini_get('register_globals')) { $register_globals = '[u]register_globals:[/u] [color=#FF0000]On[/color]'; } else { $register_globals = '[u]register_globals:[/u] Off'; } if(ini_get('safe_mode')) { $safe_mode = '[u]safe_mode:[/u] [color=#FF0000]On[/color]'; } else { $safe_mode = '[u]safe_mode:[/u] Off'; } if(extension_loaded('mbstring')) { $mbstring = '[u]mbstring:[/u] Enabled'; } else { $mbstring = '[u]mbstring:[/u] [color=#FF0000]Not installed[/color]'; } if(extension_loaded('gd')) { $gd_info = gd_info (); $gd_support = '[u]GD:[/u] '.$gd_info['GD Version'] ; } else { $gd_support = '[u]GD:[/u] [color=#FF0000]Not installed[/color]'; } $maxExecTime = ini_get('max_execution_time'); $maxExecMem = ini_get('memory_limit'); $fileuploads = ini_get('upload_max_filesize'); $kunenaVersionInfo = KunenaVersion::getVersionHTML (); // Get Kunena default template $ktemplate = KunenaFactory::getTemplate(); $ktempaltedetails = $ktemplate->getTemplateDetails(); //get all the config settings for Kunena $kconfig = $this->_getKunenaConfiguration(); $jtemplatedetails = $this->_getJoomlaTemplate($JVersion); $joomlamenudetails = $this->_getJoomlaMenuDetails($JVersion); $collation = $this->_getTablesCollation(); $kconfigsettings = $this->_getKunenaConfiguration(); // Check if Mootools plugins and others kunena plugins are enabled, and get the version of this modules jimport( 'joomla.plugin.helper' ); if ( JPluginHelper::isEnabled('system', 'mtupgrade') ) $mtupgrade = '[u]System - Mootools Upgrade:[/u] Enabled'; else $mtupgrade = '[u]System - Mootools Upgrade:[/u] Disabled'; if ( JPluginHelper::isEnabled('system', 'mootools12') ) $plg_mt = '[u]System - Mootools12:[/u] Enabled'; else $plg_mt = '[u]System - Mootools12:[/u] Disabled'; $plg['jfirephp'] = $this->_checkThirdPartyVersion('jfirephp', 'jfirephp', 'JFirePHP', 'plugins/system', 'system', 0, 0, 1); $plg['ksearch'] = $this->_checkThirdPartyVersion('kunenasearch', 'kunenasearch', 'Kunena Search', 'plugins/search', 'search', 0, 0, 1); $plg['kdiscuss'] = $this->_checkThirdPartyVersion('kunenadiscuss', 'kunenadiscuss', 'Kunena Discuss', 'plugins/content', 'content', 0, 0, 1); $plg['jxfinderkunena'] = $this->_checkThirdPartyVersion('plg_jxfinder_kunena', 'plg_jxfinder_kunena', 'Finder Kunena Posts', 'plugins/finder', 'finder', 0, 0, 1); $plg['kjomsocialmenu'] = $this->_checkThirdPartyVersion('kunenamenu', 'kunenamenu', 'My Kunena Forum Menu', 'plugins/community', 'community', 0, 0, 1); $plg['kjomsocialmykunena'] = $this->_checkThirdPartyVersion('mykunena', 'mykunena', 'My Kunena Forum Posts', 'plugins/community', 'community', 0, 0, 1); $plg['kjomsocialgroups'] = $this->_checkThirdPartyVersion('kunenagroups', 'kunenagroups', 'Kunena Groups', 'plugins/community', 'community', 0, 0, 1); foreach ($plg as $id=>$item) { if (empty($item)) unset ($plg[$id]); } if (!empty($plg)) $plgtext = '[quote][b]Plugins:[/b] ' . implode(' | ', $plg) . ' [/quote]'; else $plgtext = '[quote][b]Plugins:[/b] None [/quote]'; $mod = array(); $mod['kunenalatest'] = $this->_checkThirdPartyVersion('mod_kunenalatest', 'mod_kunenalatest', 'Kunena Latest', 'modules/mod_kunenalatest', null, 0, 1, 0); $mod['kunenastats'] = $this->_checkThirdPartyVersion('mod_kunenastats', 'mod_kunenastats', 'Kunena Stats', 'modules/mod_kunenastats', null, 0, 1, 0); $mod['kunenalogin'] = $this->_checkThirdPartyVersion('mod_kunenalogin', 'mod_kunenalogin', 'Kunena Login', 'modules/mod_kunenalogin', null, 0, 1, 0); $mod['kunenasearch'] = $this->_checkThirdPartyVersion('mod_kunenasearch', 'mod_kunenasearch', 'Kunena Search', 'modules/mod_kunenasearch', null, 0, 1, 0); foreach ($mod as $id=>$item) { if (empty($item)) unset ($mod[$id]); } if (!empty($mod)) $modtext = '[quote][b]Modules:[/b] ' . implode(' | ', $mod) . ' [/quote]'; else $modtext = '[quote][b]Modules:[/b] None [/quote]'; $thirdparty = array(); if ($JVersion->RELEASE == '1.5') { $thirdparty['aup'] = $this->_checkThirdPartyVersion('alphauserpoints', 'alphauserpoints', 'AlphaUserPoints', 'components/com_alphauserpoints', null, 1, 0, 0); $thirdparty['cb'] = $this->_checkThirdPartyVersion('comprofiler', 'comprofilej' , 'CommunityBuilder', 'components/com_comprofiler', null, 1, 0, 0); $thirdparty['jomsocial'] = $this->_checkThirdPartyVersion('community', 'community', 'Jomsocial', 'components/com_community', null, 1, 0, 0); $thirdparty['uddeim'] = $this->_checkThirdPartyVersion('uddeim', 'uddeim.j15', 'UddeIm', 'components/com_uddeim', null, 1, 0, 0); } else { $thirdparty['aup'] = $this->_checkThirdPartyVersion('alphauserpoints', 'manifest', 'AlphaUserPoints', 'components/com_alphauserpoints', null, 1, 0, 0); $thirdparty['cb'] = $this->_checkThirdPartyVersion('comprofiler', 'comprofileg' , 'CommunityBuilder', 'components/com_comprofiler', null, 1, 0, 0); $thirdparty['jomsocial'] = $this->_checkThirdPartyVersion('community', 'community', 'Jomsocial', 'components/com_community', null, 1, 0, 0); $thirdparty['uddeim'] = $this->_checkThirdPartyVersion('uddeim', 'uddeim', 'UddeIm', 'components/com_uddeim', null, 1, 0, 0); } foreach ($thirdparty as $id=>$item) { if (empty($item)) unset ($thirdparty[$id]); } if (!empty($thirdparty)) $thirdpartytext = '[quote][b]Third-party components:[/b] ' . implode(' | ', $thirdparty) . ' [/quote]'; else $thirdpartytext = '[quote][b]Third-party components:[/b] None [/quote]'; $sef = array(); $sef['sh404sef'] = $this->_checkThirdPartyVersion('sh404sef', 'sh404sef', 'sh404sef', 'components/com_sh404sef', null, 1, 0, 0); $sef['joomsef'] = $this->_checkThirdPartyVersion('joomsef', 'sef', 'ARTIO JoomSEF', 'components/com_sef', null, 1, 0, 0); $sef['acesef'] = $this->_checkThirdPartyVersion('acesef', 'acesef', 'AceSEF', 'components/com_acesef', null, 1, 0, 0); foreach ($sef as $id=>$item) { if (empty($item)) unset ($sef[$id]); } if (!empty($sef)) $seftext = '[quote][b]Third-party SEF components:[/b] ' . implode(' | ', $sef) . ' [/quote]'; else $seftext = '[quote][b]Third-party SEF components:[/b] None [/quote]'; $report = '[confidential][b]Joomla! version:[/b] '.$jversion.' [b]Platform:[/b] '.$_SERVER['SERVER_SOFTWARE'].' (' .$_SERVER['SERVER_NAME'].') [b]PHP version:[/b] '.phpversion().' | '.$safe_mode.' | '.$register_globals.' | '.$mbstring .' | '.$gd_support.' | [b]MySQL version:[/b] '.$kunena_db->getVersion().'[/confidential][quote][b]Database collation check:[/b] '.$collation.' [/quote][quote][b]Legacy mode:[/b] '.$jconfig_legacy.' | [b]Joomla! SEF:[/b] '.$jconfig_sef.' | [b]Joomla! SEF rewrite:[/b] ' .$jconfig_sef_rewrite.' | [b]FTP layer:[/b] '.$jconfig_ftp.' |[confidential][b]Mailer:[/b] '.$kunena_app->getCfg('mailer' ).' | [b]Mail from:[/b] '.$kunena_app->getCfg('mailfrom' ).' | [b]From name:[/b] '.$kunena_app->getCfg('fromname' ).' | [b]SMTP Secure:[/b] '.$kunena_app->getCfg('smtpsecure' ).' | [b]SMTP Port:[/b] '.$kunena_app->getCfg('smtpport' ).' | [b]SMTP User:[/b] '.$jconfig_smtpuser.' | [b]SMTP Host:[/b] '.$kunena_app->getCfg('smtphost' ).' [/confidential] [b]htaccess:[/b] '.$htaccess .' | [b]PHP environment:[/b] [u]Max execution time:[/u] '.$maxExecTime.' seconds | [u]Max execution memory:[/u] ' .$maxExecMem.' | [u]Max file upload:[/u] '.$fileuploads.' [/quote][confidential][b]Kunena menu details[/b]:[spoiler] '.$joomlamenudetails.'[/spoiler][/confidential][quote][b]Joomla default template details :[/b] '.$jtemplatedetails->name.' | [u]author:[/u] '.$jtemplatedetails->author.' | [u]version:[/u] '.$jtemplatedetails->version.' | [u]creationdate:[/u] '.$jtemplatedetails->creationdate.' [/quote][quote][b]Kunena default template details :[/b] '.$ktempaltedetails->name.' | [u]author:[/u] '.$ktempaltedetails->author.' | [u]version:[/u] '.$ktempaltedetails->version.' | [u]creationdate:[/u] '.$ktempaltedetails->creationDate.' [/quote][quote] [b]Kunena version detailled:[/b] '.$kunenaVersionInfo.' | [u]Kunena detailled configuration:[/u] [spoiler] '.$kconfigsettings.'[/spoiler][/quote]'.$thirdpartytext.' '.$seftext.' '.$plgtext.' '.$modtext; return $report; }
/** * Tests the getLongVersion method * * @return void * * @since 3.0 * * @covers JVersion::getLongVersion */ public function testGetLongVersion() { $this->assertThat($this->object->getLongVersion(), $this->isType('string'), 'getLongVersion should return a string with the full version information.'); }
/** * Method to get the system information * * @return array System information values */ public function getInfo() { if (is_null($this->info)) { $version = new \JVersion(); $platform = new \JPlatform(); $db = \App::get('db'); if (isset($_SERVER['SERVER_SOFTWARE'])) { $sf = $_SERVER['SERVER_SOFTWARE']; } else { $sf = getenv('SERVER_SOFTWARE'); } $this->info = array(); $this->info['php'] = php_uname(); $this->info['dbversion'] = $db->getVersion(); $this->info['dbcollation'] = $db->getCollation(); $this->info['phpversion'] = phpversion(); $this->info['server'] = $sf; $this->info['sapi_name'] = php_sapi_name(); $this->info['version'] = $version->getLongVersion(); $this->info['platform'] = $platform->getLongVersion(); $this->info['useragent'] = $_SERVER['HTTP_USER_AGENT']; } return $this->info; }
/** * Returns the platform name and version * @param string $platform_name Name of the platform, e.g. Joomla! * @param string $version Full version of the platform */ public function getPlatformVersion(&$platform_name, &$version) { $platform_name = "Joomla!"; $v = new JVersion(); $version = $v->getLongVersion(); }
/** * Open the log file pointer and create the file if it doesn't exist * * @access public * @return boolean True on success * @since 1.5 */ function _openLog() { // Only open if not already opened... if (is_resource($this->_file)) { return true; } $now =& JFactory::getDate(); $date = $now->toMySQL(); if (!file_exists($this->_path)) { jimport("joomla.filesystem.folder"); if (!JFolder::create(dirname($this->_path))) { return false; } // Start with empty comment line to prevent file content from being shown due to a PHP CGI bug - // see http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=27641 $header[] = "#"; $header[] = "#<?php die('Direct Access To Log Files Not Permitted'); ?>"; $header[] = "#Version: 1.0"; $header[] = "#Date: " . $date; // Prepare the fields string $fields = str_replace("{", "", $this->_format); $fields = str_replace("}", "", $fields); $fields = strtolower($fields); $header[] = "#Fields: " . $fields; // Prepare the software string $version = new JVersion(); $header[] = "#Software: " . $version->getLongVersion(); $head = implode("\n", $header); } else { $head = false; } if (!($this->_file = fopen($this->_path, "a"))) { return false; } if ($head) { if (!fputs($this->_file, $head)) { return false; } } // If we opened the file lets make sure we close it register_shutdown_function(array(&$this, '_closeLog')); return true; }
/** * The the pre-install info page * * @return boolean True if successful * @access public * @since 1.5 */ function preInstall() { $steps =& $this->getSteps(); $steps['preinstall'] = 'on'; $model =& $this->getModel(); $lists =& $model->getData('lists'); $version = new JVersion(); $this->assign('version', $version->getLongVersion()); $this->assign('php_options', $lists['phpOptions']); $this->assign('php_settings', $lists['phpSettings']); $this->assign('page', 'preinstall'); $this->assign('steps', $steps); $this->display(); }
/** * method to get the system information * * @return array system information values */ function &getInfo() { if (is_null($this->info)) { $this->info = array(); $version = new JVersion(); $db = JFactory::getDBO(); if (isset($_SERVER['SERVER_SOFTWARE'])) { $sf = $_SERVER['SERVER_SOFTWARE']; } else { $sf = getenv('SERVER_SOFTWARE'); } $this->info['php'] = php_uname(); $this->info['dbversion'] = $db->getVersion(); $this->info['dbcollation'] = $db->getCollation(); $this->info['phpversion'] = phpversion(); $this->info['server'] = $sf; $this->info['sapi_name'] = php_sapi_name(); $this->info['version'] = $version->getLongVersion(); $this->info['useragent'] = phpversion() <= '4.2.1' ? getenv("HTTP_USER_AGENT") : $_SERVER['HTTP_USER_AGENT']; } return $this->info; }
/** * Method to get the system information * * @return array System information values * * @since 1.6 */ public function &getInfo() { if (!empty($this->info)) { return $this->info; } $version = new JVersion(); $platform = new JPlatform(); $db = $this->getDbo(); $this->info = array('php' => php_uname(), 'dbversion' => $db->getVersion(), 'dbcollation' => $db->getCollation(), 'dbconnectioncollation' => $db->getConnectionCollation(), 'phpversion' => phpversion(), 'server' => isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : getenv('SERVER_SOFTWARE'), 'sapi_name' => php_sapi_name(), 'version' => $version->getLongVersion(), 'platform' => $platform->getLongVersion(), 'useragent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ""); return $this->info; }
/** * Returns the platform name and version * @param string $platform_name Name of the platform, e.g. Joomla! * @param string $version Full version of the platform */ public static function getPlatformVersion( &$platform_name, &$version ) { if( !class_exists('JVersion') ) { $path = JPATH_SITE.DS.'libraries'.DS.'joomla'.DS.'version.php'; if(file_exists($path)) { require_once $path; } else { $path = JPATH_SITE.DS.'includes'.DS.'version.php'; require_once $path; } } $platform_name = "Joomla!"; $v = new JVersion(); $version = $v->getLongVersion(); }
/** * The the pre-install info page * * @return boolean True if successful * @access public * @since 1.5 */ function preInstall() { $steps =& $this->getSteps(); $model =& $this->getModel(); $lists =& $model->getData('lists'); $version = new JVersion(); $tmpl =& $this->getTemplate('preinstall.html'); $steps['preinstall'] = 'on'; $tmpl->addVars('stepbar', $steps, 'step_'); $tmpl->addVar('body', 'version', $version->getLongVersion()); $tmpl->addRows('php-options', $lists['phpOptions']); $tmpl->addRows('php-settings', $lists['phpSettings']); return $this->display(); }
/** * Method to get the system information * * @return array system information values * * @since 1.6 */ public function &getInfo() { if (is_null($this->info)) { $this->info = array(); $version = new JVersion(); $platform = new JPlatform(); $db = JFactory::getDbo(); if (isset($_SERVER['SERVER_SOFTWARE'])) { $sf = $_SERVER['SERVER_SOFTWARE']; } else { $sf = getenv('SERVER_SOFTWARE'); } //Get PlayJoom Version require_once JPATH_BASE . '/components/com_playjoomupdate/helpers/pjversion.php'; if (!defined('PJVERSION')) { $jversion = new PJVersion(); $this->info['pj_version'] = $jversion->getLongVersion(); } //Get getID3 Version require_once JPATH_BASE . '/components/com_playjoom/helpers/id3/getid3.php'; $getID3 = new getID3(); $this->info['getID3_version'] = $getID3->version(); $this->info['php'] = php_uname(); $this->info['dbversion'] = $db->getVersion(); $this->info['dbcollation'] = $db->getCollation(); $this->info['phpversion'] = phpversion(); $this->info['server'] = $sf; $this->info['sapi_name'] = php_sapi_name(); $this->info['version'] = $version->getLongVersion(); $this->info['platform'] = $platform->getLongVersion(); $this->info['useragent'] = $_SERVER['HTTP_USER_AGENT']; } return $this->info; }
/** * This checks for the correct Long Version. * * @return void */ public function testGetLongVersion() { $expected = 'Joomla Platform 11.1.0 Dev [ Ember ] 15-Apr-2011 00:00 GMT'; $this->assertEquals($expected, JVersion::getLongVersion(), 'Should get the correct Long Version'); }
echo date('Y-m-d H:i:s'); ?> </div> Installation error on: <?php echo JURI::root(); ?> <br/><br/> <ul> <li> joomlamailer: <?php echo $manifest->version . ' (' . $manifest->creationDate . ')'; ?> </li> <li><?php $jversion = new JVersion(); echo $jversion->getLongVersion(); ?> </li> <li>PHP: <?php echo phpversion(); ?> </li> <li>Database: <?php echo JFactory::getDBO()->name . ' (' . JFactory::getDBO()->getConnection()->server_info . ')'; ?> </li> </ul> <label for="contact">Contact (optional)</label><br/> <div class="input-group"> <span class="input-group-addon" id="basic-addon1">@</span>
/** * Open the log file pointer and create the file if it doesn't exist * * @access public * @return boolean True on success * @since 1.5 */ function _openLog() { // Only open if not already opened... if (is_resource($this->_file)) { return true; } $now =& JFactory::getDate(); $date = $now->toMySQL(); if (!file_exists($this->_path)) { jimport("joomla.filesystem.folder"); if (!JFolder::create(dirname($this->_path))) { return false; } $header[] = "#<?php die('Direct Access To Log Files Not Permitted'); ?>"; $header[] = "#Version: 1.0"; $header[] = "#Date: " . $date; // Prepare the fields string $fields = str_replace("{", "", $this->_format); $fields = str_replace("}", "", $fields); $fields = strtolower($fields); $header[] = "#Fields: " . $fields; // Prepare the software string $version = new JVersion(); $header[] = "#Software: " . $version->getLongVersion(); $head = implode("\n", $header); } else { $head = false; } if (!($this->_file = fopen($this->_path, "a"))) { return false; } if ($head) { if (!fputs($this->_file, $head)) { return false; } } // If we opened the file lets make sure we close it register_shutdown_function(array(&$this, '_closeLog')); return true; }
/** * Initialises CUBE to start a new backup * */ function start($description, $comment) { global $mainframe; // Load registry $configuration =& JoomlapackModelRegistry::getInstance(); $configuration->reload(); // Load engine provisioning object $this->provisioning =& JoomlapackCUBEProvisioning::getInstance(); // Initialize statistics model $this->statmodel =& JoomlapackModelStatistics::getInstance(); // Initialize private fields $this->_activeDomain = 'init'; $this->_object = null; $this->_isFinished = false; // Load JP version JoomlapackHelperUtils::getJoomlaPackVersion(); // Initialise log file JoomlapackLogger::ResetLog(); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "--------------------------------------------------------------------------------"); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JoomlaPack " . _JP_VERSION . ' (' . _JP_DATE . ')'); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Got backup?"); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "--------------------------------------------------------------------------------"); // PHP configuration variables are tried to be logged only for debug and info log levels if ($configuration->get('logLevel') >= 2) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "--- System Information ---"); if (function_exists('phpversion')) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "PHP Version :" . phpversion()); } if (function_exists('php_uname')) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "OS Version :" . php_uname('s')); } $db =& JFactory::getDBO(); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "DB Version :" . $db->getVersion()); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "DB Collation :" . $db->getCollation()); if (isset($_SERVER['SERVER_SOFTWARE'])) { $server = $_SERVER['SERVER_SOFTWARE']; } else { if ($sf = getenv('SERVER_SOFTWARE')) { $server = $sf; } else { $server = JText::_('n/a'); } } JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Web Server :" . $server); if (function_exists('php_sapi_name')) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "PHP Interface :" . php_sapi_name()); } $version = new JVersion(); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Joomla! version :" . $version->getLongVersion()); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "User agent :" . phpversion() <= "4.2.1" ? getenv("HTTP_USER_AGENT") : $_SERVER['HTTP_USER_AGENT']); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Safe mode :" . ini_get("safe_mode")); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Display errors :" . ini_get("display_errors")); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Error reporting :" . error2string()); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Disabled functions :" . ini_get("disable_functions")); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "open_basedir restr.:" . ini_get('open_basedir')); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Max. exec. time :" . ini_get("max_execution_time")); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Memory limit :" . ini_get("memory_limit")); if (function_exists("memory_get_usage")) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Current mem. usage :" . memory_get_usage()); } if (function_exists("gzcompress")) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "GZIP Compression : available (good)"); } else { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "GZIP Compression : n/a (no compression)"); } JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JPATH_BASE :" . JPATH_BASE); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JPATH_ROOT :" . JPATH_ROOT); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JPATH_CACHE :" . JPATH_CACHE); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Output directory :" . $configuration->get('OutputDirectory')); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Temporary directory:" . $configuration->getTemporaryDirectory()); $temp = JoomlapackCUBETables::_getBase64() ? 'Available; will be used for temp vars' : 'Not available'; JoomlapackLogger::WriteLog(_JP_LOG_INFO, "BASE64 Encoding :" . $temp); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "--------------------------------------------------------------------------------"); } jpimport('helpers.status', true); $statushelper =& JoomlapackHelperStatus::getInstance(); if ($statushelper->hasQuirks()) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JoomlaPack has detected the following potential problems:"); foreach ($statushelper->quirks as $q) { JoomlapackLogger::WriteLog(_JP_LOG_INFO, '- ' . $q['code'] . ' ' . $q['description'] . ' (' . $q['severity'] . ')'); } JoomlapackLogger::WriteLog(_JP_LOG_INFO, "You probably do not have to worry about them, but you should be aware of them."); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "--------------------------------------------------------------------------------"); } // Get current profile ID $session =& JFactory::getSession(); $profile_id = $session->get('profile', null, 'joomlapack'); JoomlapackLogger::WriteLog(_JP_LOG_INFO, "Loading profile #{$profile_id}"); // Get archive name switch ($configuration->get('BackupType')) { case 'dbonly': JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JoomlaPack is starting a new database backup"); $extension = '.sql'; break; case 'full': JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JoomlaPack is starting a new full site backup"); // Instanciate archiver, only if not in DB only mode $archiver =& $this->provisioning->getArchiverEngine(true); if ($this->provisioning->getError()) { $this->setError($this->provisioning->getError()); return; } $extension = $this->provisioning->archiveExtension; break; case 'extradbonly': JoomlapackLogger::WriteLog(_JP_LOG_INFO, "JoomlaPack is starting a new extra databases only backup"); // Instanciate archiver, only if not in DB only mode $archiver =& $this->provisioning->getArchiverEngine(true); if ($this->provisioning->getError()) { $this->setError($this->provisioning->getError()); return; } $extension = $this->provisioning->archiveExtension; break; } $relativeArchiveName = JoomlapackHelperUtils::getExpandedTarName($extension, false); $absoluteArchiveName = JoomlapackHelperUtils::getExpandedTarName($extension, true); // ==== Stats initialisation === $this->statmodel->setId(0); // Detect backup origin if ($mainframe->isAdmin()) { $origin = 'backend'; } else { $origin = 'frontend'; } // Get profile $session =& JFactory::getSession(); $profile_id = $session->get('profile', null, 'joomlapack'); unset($session); // Create an initial stats entry jimport('joomla.utilities.date'); $jdate = new JDate(); switch ($configuration->get('BackupType')) { case 'full': $backupType = 'full'; break; case 'dbonly': $backupType = 'dbonly'; break; case 'extradbonly': $backupType = 'extradbonly'; break; } JoomlapackLogger::WriteLog(_JP_LOG_DEBUG, "Backup type is now set to '" . $backupType . "'"); $temp = array('description' => $description, 'comment' => $comment, 'backupstart' => $jdate->toMySQL(), 'status' => 'run', 'origin' => $origin, 'type' => $backupType, 'profile_id' => $profile_id, 'archivename' => $relativeArchiveName, 'absolute_path' => $absoluteArchiveName); // Save the entry $this->statmodel->save($temp); if ($this->statmodel->getError()) { $this->setError($this->statmodel->getError()); return; } unset($temp); // Get the ID! $temp = $this->statmodel->getSavedTable(); $this->_statID = $temp->id; // Initialize the archive. if ($configuration->get('BackupType') != 'dbonly') { JoomlapackLogger::WriteLog(_JP_LOG_DEBUG, "Expanded archive file name: " . $absoluteArchiveName); JoomlapackLogger::WriteLog(_JP_LOG_DEBUG, "Seeding archive with installer"); $installerPackage = JPATH_COMPONENT_ADMINISTRATOR . DS . 'assets' . DS . "installers" . DS . $configuration->get('InstallerPackage'); $archiver->initialize($installerPackage, $absoluteArchiveName); $archiver->setComment($comment); // Add the comment to the archive itself. if ($archiver->getError()) { $this->setError($archiver->getError()); return; } } $this->_initialised = true; }
/** * Method to get the system information * * @return array system information values * * @since 1.6 */ public function &getInfo() { if (!is_null($this->info)) { return $this->info; } $this->info = array(); $version = new JVersion(); $platform = new JPlatform(); $db = JFactory::getDbo(); $this->info['php'] = php_uname(); $this->info['dbversion'] = $db->getVersion(); $this->info['dbcollation'] = $db->getCollation(); $this->info['phpversion'] = phpversion(); $this->info['server'] = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : getenv('SERVER_SOFTWARE'); $this->info['sapi_name'] = php_sapi_name(); $this->info['version'] = $version->getLongVersion(); $this->info['platform'] = $platform->getLongVersion(); $this->info['useragent'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ""; return $this->info; }
/** * Method to generate the log file header. * * @return void * * @since 11.1 */ protected function generateFileHeader() { // Initialize variables. $head = array(); // Build the log file header. // If the no php flag is not set add the php die statement. if (empty($this->options['text_file_no_php'])) { $head[] = '#<?php die(\'Forbidden.\'); ?>'; } $head[] = '#Date: ' . gmdate('Y-m-d H:i:s') . ' UTC'; $head[] = '#Software: ' . JVersion::getLongVersion(); $head[] = ''; // Prepare the fields string $head[] = '#Fields: ' . strtolower(str_replace('}', '', str_replace('{', '', $this->format))); $head[] = ''; return implode("\n", $head); }