/** * Returns the PHP version as an array with the version elements. * * @return array(string) */ public static function phpVersion() { return explode('.', phpVersion()); }
<?php if ($prereq->check()) { ?> <div class="info">Oui, Version <?php echo phpVersion(); ?> </div> <?php } else { ?> <div class="<?php echo $prereq->mandatory ? "error" : "warning"; ?> "> Non, Version <?php echo phpVersion(); ?> </div> <?php } ?> </td> </tr> <?php } ?> </table> <h3>Extensions PECL</h3> <p>
include REL_PATH . 'control/connect.php'; include REL_PATH . 'control/functions.php'; include REL_PATH . 'control/system/core/c2.php'; include REL_PATH . 'control/timezones.php'; mswDBConnector(); include PATH . 'control/functions.php'; $cmd = isset($_GET['s']) ? $_GET['s'] : '1'; $title = SCRIPT_NAME . ': Installation'; $stages = 6; $perc_width = $cmd > 1 ? ceil(($cmd - 1) * (100 / $stages)) : '0'; $progress = $cmd > 1 ? ceil(($cmd - 1) * (100 / $stages)) : '0'; if (isset($_GET['connectionTest'])) { $cmd = 'test'; } // Check if PHP version is too old.. if (phpVersion() < '4.3' || !function_exists('file_get_contents')) { $cmd = 'e'; $code = 'old'; $type = 'FATAL ERROR'; } switch ($cmd) { case '1': include PATH . 'templates/header.php'; include PATH . 'templates/1.php'; include PATH . 'templates/footer.php'; break; case '2': include PATH . 'templates/header.php'; include PATH . 'templates/2.php'; include PATH . 'templates/footer.php'; break;
protected function checkPhpVersion($requiredPhpVersion) { $currentPhpVersion = phpVersion(); return version_compare($requiredPhpVersion, $currentPhpVersion, '<='); }
function mswlogDBError($table, $error, $code, $line, $file, $type = 'Create') { $header = ''; if (!file_exists(REL_PATH . 'logs/install-error-report.txt')) { $query = @mysql_query("SELECT VERSION() AS v"); $VERSION = @mysql_fetch_object($query); $header = 'Script: ' . SCRIPT_NAME . mswDefineNewline(); $header .= 'Script Version: ' . SCRIPT_VERSION . mswDefineNewline(); $header .= 'PHP Version: ' . phpVersion() . mswDefineNewline(); $header .= 'MySQL Version: ' . (isset($VERSION->v) ? $VERSION->v : 'Unknown') . mswDefineNewline(); if (isset($_SERVER['SERVER_SOFTWARE'])) { $header .= 'Server Software: ' . $_SERVER['SERVER_SOFTWARE'] . mswDefineNewline(); } if (isset($_SERVER["HTTP_USER_AGENT"])) { if (strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'win')) { $platform = 'Windows'; } else { if (strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'mac')) { $platform = 'Mac'; } else { $platform = 'Other'; } } $header .= 'Platform: ' . $platform . mswDefineNewline(); } $header .= '=================================================================================' . mswDefineNewline(); } $string = 'Table: ' . $table . mswDefineNewline(); $string .= 'Operation: ' . $type . mswDefineNewline(); $string .= 'Error Code: ' . $code . mswDefineNewline(); $string .= 'Error Msg: ' . $error . mswDefineNewline(); $string .= 'On Line: ' . $line . mswDefineNewline(); $string .= 'In File: ' . $file . mswDefineNewline(); $string .= '- - - - - - - - - - - - - - - - - - - - - ' . mswDefineNewline(); if (is_writeable(REL_PATH . 'logs')) { $fp = fopen(REL_PATH . 'logs/install-error-report.txt', 'ab'); if ($fp) { fwrite($fp, $header . $string); fclose($fp); } } }
* @return type a cleaned string. */ function cleanString($string) { $badText = array("content-type", "bcc:", "cc:", "href"); //text to clean if found. return str_replace($badText, "", $string); //Return cleaned string. } //Prepare email. $emailMessage .= "Name: " . cleanString($name) . "\n"; $emailMessage .= "Email: " . cleanString($email) . "\n"; $emailMessage .= "Subject: " . cleanString($subject) . "\n"; $emailMessage .= "Comment:\n" . cleanString($comment) . "\n"; //Create email headers. $headers = "From: " . $email . "\r\n" . "Reply-To: " . $email . "\r\n" . "X-Mailer: PHP/" . phpVersion(); mail($emailTo, $subject, $emailMessage, $headers); //Send email here. $array = array('submitted' => true); //Send back true. echo json_encode($array); //Send JSON. } } } } } } } } else { $array = array('submitted' => false);
public function testSystemInfoPhpVersionTest() { $phpVersion = ezcSystemInfo::phpVersion(); $waitVersion = explode('.', phpVersion()); self::assertEquals($phpVersion, $waitVersion, 'Php version was not determined correctly'); unset($phpVersion); $info = ezcSystemInfo::getInstance(); $phpVersion = $info->phpVersion; self::assertEquals($phpVersion, $waitVersion, 'Php version was not determined correctly'); }
@header('Content-type: text/html; charset=utf-8'); @header('Pragma: no-cache'); @header('Cache-Control: private, no-cache, must-revalidate'); @header('Expires: 0'); @header('Vary: *'); # start or bind to session # (start session even if GS_GUI_SESSIONS==false so $_SESSION is # superglobal) ini_set('session.referer_check', ''); ini_set('session.use_cookies', 1); ini_set('session.use_only_cookies', 0); ini_set('session.use_trans_sid', 0); ini_set('session.hash_function', 1); ini_set('session.hash_bits_per_character', 5); ini_set('session.entropy_length', 0); if (version_compare(phpVersion(), '5.2.0', '>=')) { session_set_cookie_params(0, GS_URL_PATH, '', false, false); } else { session_set_cookie_params(0, GS_URL_PATH, '', false); } session_name('gemeinschaft'); $_REQUEST['gemeinschaft'] = preg_replace('[^0-9a-zA-Z\\-,]', '', @$_REQUEST['gemeinschaft']); $_COOKIE['gemeinschaft'] = preg_replace('[^0-9a-zA-Z\\-,]', '', @$_COOKIE['gemeinschaft']); if ($_REQUEST['gemeinschaft'] == '') { unset($_REQUEST['gemeinschaft']); } if ($_COOKIE['gemeinschaft'] == '') { unset($_COOKIE['gemeinschaft']); } session_start(); function gs_user_is_admin($username)
public static function init($storeClassName, $config, $keyPrefix = '') { $phpVersion = phpVersion(); if (version_compare($phpVersion, '5.4') != -1) { return MemcacheSessionHandler::init($storeClassName, $config, $keyPrefix); } else { return MemcacheSessionHandlerCompatible::init($storeClassName, $config, $keyPrefix); } }