/** * Stop loading gpEasy * Check to see if gpEasy has already been installed * */ static function stop() { global $dataDir; if (!gpFiles::Exists($dataDir . '/data/_site/config.php')) { if (file_exists($dataDir . '/include/install/install.php')) { common::SetLinkPrefix(); includeFile('install/install.php'); die; } } die('<p>Notice: The site configuration did not load properly.</p>' . '<p>If you are the site administrator, you can troubleshoot the problem turning debugging "on" or bypass it by enabling gpEasy safe mode.</p>' . '<p>More information is available in the <a href="http://docs.gpeasy.com/Main/Troubleshooting">gpEasy documentation</a>.</p>' . common::ErrorBuffer(true, false)); }
/** * Try to fetch a response using RemoteGet to see if we're getting a 500 error * * @access public * @static * @since 1.7 * * @return boolean */ static function TestResponse() { //get url, force gp_rewrite to $new_gp_rewrite $rewrite_before = $_SERVER['gp_rewrite']; $_SERVER['gp_rewrite'] = true; common::SetLinkPrefix(); $abs_url = common::AbsoluteUrl('Site_Map', '', true, false); $_SERVER['gp_rewrite'] = $rewrite_before; common::SetLinkPrefix(); $result = gpRemoteGet::Get_Successful($abs_url); if (!$result) { return false; } return true; }
<?php ob_start(); echo "\n************************************************************************************"; echo "\nBegin gpEasy Tests\n\n"; defined('is_running') or define('is_running', true); defined('gp_unit_testing') or define('gp_unit_testing', true); global $dataDir; $dataDir = $_SERVER['PWD']; include 'include/common.php'; common::SetLinkPrefix(); includeFile('tool/display.php'); includeFile('tool/Files.php'); includeFile('tool/gpOutput.php'); includeFile('tool/functions.php'); includeFile('tool/Plugins.php'); class gptest_bootstrap extends PHPUnit_Framework_TestCase { function setUP() { common::GetLangFile(); } static function log($msg) { static $fp; if (!$fp) { $log = __DIR__ . '/phpunit.log'; $fp = fopen($log, 'a'); } fwrite($fp, "\n" . print_r($msg, TRUE)); }
/** * Determine if gpEasy has been installed * */ function gpInstalled() { global $dataDir; if (@file_exists($dataDir . '/data/_site/config.php')) { return; } if (file_exists($dataDir . '/include/install/install.php')) { common::SetLinkPrefix(); includeFile('install/install.php'); die; } die('<p>Sorry, this site is temporarily unavailable.</p>'); }
/** * Try to fetch a response using RemoteGet to see if we're getting a 500 error * * @access public * @static * @since 1.7 * * @return boolean */ public static function TestResponse($new_rewrite = true) { //get url, force gp_rewrite to $new_gp_rewrite $rewrite_before = $_SERVER['gp_rewrite']; $_SERVER['gp_rewrite'] = $new_rewrite; common::SetLinkPrefix(); $abs_url = common::AbsoluteUrl('Site_Map', '', true, false); //can't be special_site_map, otherwise common::IndexToTitle() will be called during install $_SERVER['gp_rewrite'] = $rewrite_before; common::SetLinkPrefix(); return self::ConfirmGet($abs_url, false); }