本文整理汇总了PHP中check_php_version函数的典型用法代码示例。如果您正苦于以下问题:PHP check_php_version函数的具体用法?PHP check_php_version怎么用?PHP check_php_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_php_version函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sq_get_attach_tempfile
/**
* Get a new file to write an attachment to.
* This function makes sure it doesn't overwrite other attachments,
* preventing collisions and race conditions.
*
* @return filename of the tempfile only (not full path)
* @since 1.5.2
*/
function sq_get_attach_tempfile()
{
global $username, $attachment_dir;
$hashed_attachment_dir = getHashedDir($username, $attachment_dir);
// using PHP >= 4.3.2 we can be truly atomic here
$filemods = check_php_version(4, 3, 2) ? 'x' : 'w';
// give up after 1000 tries
$TMP_MAX = 1000;
for ($try = 0; $try < $TMP_MAX; ++$try) {
$localfilename = GenerateRandomString(32, '', 7);
$full_localfilename = "{$hashed_attachment_dir}/{$localfilename}";
// filename collision. try again
if (file_exists($full_localfilename)) {
continue;
}
// try to open for (binary) writing
$fp = @fopen($full_localfilename, $filemods);
if ($fp !== FALSE) {
// success! make sure it's not readable, close and return filename
chmod($full_localfilename, 0600);
fclose($fp);
return $localfilename;
}
}
// we tried 1000 times but didn't succeed.
error_box(_("Could not open temporary file to store attachment. Contact your system administrator to resolve this issue."));
return FALSE;
}
示例2: sq_create_tempfile
/**
* Generates a unique file in a specific directory and
* returns the file name (without the path).
*
* @param directory The directory within which to create the file
*
* @return mixed FALSE when a failure occurs, otherwise a string
* containing the filename of the file only (not
* its full path)
*
* @since 1.5.2
*
*/
function sq_create_tempfile($directory)
{
// give up after 1000 tries
$maximum_tries = 1000;
// using PHP >= 4.3.2 we can be truly atomic here
$filemods = check_php_version(4, 3, 2) ? 'x' : 'w';
for ($try = 0; $try < $maximum_tries; ++$try) {
$localfilename = GenerateRandomString(32, '', 7);
$full_localfilename = $directory . DIRECTORY_SEPARATOR . $localfilename;
// filename collision. try again
if (file_exists($full_localfilename)) {
continue;
}
// try to open for (binary) writing
$fp = @fopen($full_localfilename, $filemods);
if ($fp !== FALSE) {
// success! make sure it's not readable, close and return filename
chmod($full_localfilename, 0600);
fclose($fp);
return $localfilename;
}
}
// we tried as many times as we could but didn't succeed.
return FALSE;
}
示例3: get_content
function get_content()
{
global $CFG;
if (empty($CFG->enableglobalsearch)) {
return '';
}
//cache block contents
if ($this->content !== NULL) {
return $this->content;
}
//if
$this->content = new stdClass();
//lazy check for the moment
if (check_php_version("5.0.0")) {
//fetch values if defined in admin, otherwise use defaults
$label = !empty($CFG->block_search_text) ? $CFG->block_search_text : get_string('searchmoodle', 'block_search');
$button = !empty($CFG->block_search_button) ? $CFG->block_search_button : get_string('go', 'block_search');
//basic search form
$this->content->text = '<form id="searchquery" method="get" action="' . $CFG->wwwroot . '/search/query.php"><div>' . '<label for="block_search_q">' . $label . '</label>' . '<input id="block_search_q" type="text" name="query_string" />' . '<input type="submit" value="' . $button . '" />' . '</div></form>';
} else {
$this->content->text = "Sorry folks, PHP 5 is needed for the new search module.";
}
//else
//no footer, thanks
$this->content->footer = '';
return $this->content;
}
示例4: wp_eMember_membership_level
function wp_eMember_membership_level()
{
echo '<div class="wrap"><h2>WP eMembers - Manage Access Levels v' . WP_EMEMBER_VERSION . '</h2>';
echo check_php_version();
echo eMember_admin_submenu_css();
$current = isset($_GET['level_action']) && $_GET['level_action'] > 0 && $_GET['level_action'] < 4 ? $_GET['level_action'] : 1;
?>
<h3 class="nav-tab-wrapper">
<a class="nav-tab <?php
echo $current == 1 ? 'nav-tab-active' : '';
?>
" href="admin.php?page=eMember_membership_level_menu&level_action=1">Manage Levels</a>
<a class="nav-tab <?php
echo $current == 2 ? 'nav-tab-active' : '';
?>
" href="admin.php?page=eMember_membership_level_menu&level_action=2">Manage Content Protection</a>
</h3>
<?php
switch ($current) {
case '2':
content_protection();
break;
default:
manage_access_levels();
break;
}
echo '</div>';
}
示例5: check_php
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
function check_php()
{
if (check_php_version() && check_php_hash() && check_php_hash_algo() && check_php_pdo() && check_php_pdo_mysql() && check_php_session() && check_php_json() && check_php_safemode()) {
return true;
}
return false;
}
示例6: DbSession
/**
* Constructor
*
* @param mixed $dbh
* DB handle, or WikiDB object (from which the DB handle will
* be extracted.
*
* @param string $table
* Name of SQL table containing session data.
*/
function DbSession(&$dbh, $table = 'session')
{
// Check for existing DbSession handler
$db_type = $dbh->getParam('dbtype');
if (isa($dbh, 'WikiDB')) {
// will fail with php4 and case-sensitive filesystem
//$db_type = substr(get_class($dbh),7);
// < 4.1.2 crash on dba sessions at session_write_close().
// (Tested with 4.1.1 and 4.1.2)
// Didn't try postgres sessions.
if (!check_php_version(4, 1, 2) and $db_type == 'dba') {
return false;
}
@(include_once "lib/DbSession/" . $db_type . ".php");
$class = "DbSession_" . $db_type;
if (class_exists($class)) {
// dba has no ->_dbh, so this is used for the session link
$this->_backend = new $class($dbh->_backend->_dbh, $table);
return $this;
}
}
//Fixme: E_USER_WARNING ignored!
trigger_error(sprintf(_("Your WikiDB DB backend '%s' cannot be used for DbSession.") . " " . _("Set USE_DB_SESSION to false."), $db_type), E_USER_WARNING);
return false;
}
示例7: is_logged_in
/**
* Check if user has previously logged in to the SquirrelMail session. If user
* has not logged in, execution will stop inside this function.
*
* @return int A positive value is returned if user has previously logged in
* successfully.
*/
function is_logged_in()
{
if (sqsession_is_registered('user_is_logged_in')) {
return;
} else {
global $PHP_SELF, $HTTP_POST_VARS, $_POST, $session_expired_post, $session_expired_location, $squirrelmail_language;
// First we store some information in the new session to prevent
// information-loss.
//
if (!check_php_version(4, 1)) {
$session_expired_post = $HTTP_POST_VARS;
} else {
$session_expired_post = $_POST;
}
$session_expired_location = $PHP_SELF;
if (!sqsession_is_registered('session_expired_post')) {
sqsession_register($session_expired_post, 'session_expired_post');
}
if (!sqsession_is_registered('session_expired_location')) {
sqsession_register($session_expired_location, 'session_expired_location');
}
session_write_close();
// signout page will deal with users who aren't logged
// in on its own; don't show error here
//
if (strpos($PHP_SELF, 'signout.php') !== FALSE) {
return;
}
include_once SM_PATH . 'functions/display_messages.php';
set_up_language($squirrelmail_language, true);
logout_error(_("You must be logged in to access this page."));
exit;
}
}
示例8: charset_decode_euc_kr
/**
* Decode euc-kr encoded string
* @param string $string euc-kr string
* @param boolean $save_html don't html encode special characters if true
* @return string $string decoded string
*/
function charset_decode_euc_kr($string, $save_html = false)
{
// global $aggressive_decoding;
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'euc-kr')) {
return $string;
}
// this is CPU intensive task. Use recode functions if they are available.
if (function_exists('recode_string')) {
// if string is already sanitized, undo htmlspecial chars
if (!$save_html) {
$string = str_replace(array('"', '<', '>', '&'), array('"', '<', '>', '&'), $string);
}
$string = recode_string("euc-kr..html", $string);
// if string sanitizing is not needed, undo htmlspecialchars applied by recode.
if ($save_html) {
$string = str_replace(array('"', '<', '>', '&'), array('"', '<', '>', '&'), $string);
}
return $string;
}
/*
* iconv does not support html target, but internal utf-8 decoding is faster
* than pure php implementation.
*/
if (function_exists('iconv') && file_exists(SM_PATH . 'functions/decode/utf_8.php')) {
include_once SM_PATH . 'functions/decode/utf_8.php';
$string = iconv('euc-kr', 'utf-8', $string);
return charset_decode_utf_8($string);
}
// try mbstring
if (function_exists('mb_convert_encoding') && function_exists('sq_mb_list_encodings') && check_php_version(4, 3, 0) && in_array('euc-kr', sq_mb_list_encodings())) {
return mb_convert_encoding($string, 'HTML-ENTITIES', 'EUC-KR');
}
return $string;
}
示例9: WikiDB_backend_PearDB
function WikiDB_backend_PearDB($dbparams)
{
// Find and include PEAR's DB.php. maybe we should force our private version again...
// if DB would have exported its version number, it would be easier.
@(require_once 'DB/common.php');
// Either our local pear copy or the system one
// check the version!
$name = check_php_version(5) ? "escapeSimple" : strtolower("escapeSimple");
// TODO: apparently some Pear::Db version adds LIMIT 1,0 to getOne(),
// which is invalid for "select version()"
if (!in_array($name, get_class_methods("DB_common"))) {
$finder = new FileFinder();
$dir = dirname(__FILE__) . "/../../pear";
$finder->_prepend_to_include_path($dir);
include_once "{$dir}/DB/common.php";
// use our version instead.
if (!in_array($name, get_class_methods("DB_common"))) {
$pearFinder = new PearFileFinder("lib/pear");
$pearFinder->includeOnce('DB.php');
} else {
include_once "{$dir}/DB.php";
}
} else {
include_once "DB.php";
}
// Install filter to handle bogus error notices from buggy DB.php's.
// TODO: check the Pear_DB version, but how?
if (DEBUG) {
global $ErrorManager;
$ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_pear_notice_filter'));
$this->_pearerrhandler = true;
}
// Open connection to database
$this->_dsn = $dbparams['dsn'];
$this->_dbparams = $dbparams;
$this->_lock_count = 0;
// persistent is usually a DSN option: we override it with a config value.
// phptype://username:password@hostspec/database?persistent=false
$dboptions = array('persistent' => DATABASE_PERSISTENT, 'debug' => 2);
//if (preg_match('/^pgsql/', $this->_dsn)) $dboptions['persistent'] = false;
$this->_dbh = DB::connect($this->_dsn, $dboptions);
$dbh =& $this->_dbh;
if (DB::isError($dbh)) {
trigger_error(sprintf("Can't connect to database: %s", $this->_pear_error_message($dbh)), isset($dbparams['_tryroot_from_upgrade']) ? E_USER_WARNING : E_USER_ERROR);
if (isset($dbparams['_tryroot_from_upgrade'])) {
return;
}
}
$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, array($this, '_pear_error_callback'));
$dbh->setFetchMode(DB_FETCHMODE_ASSOC);
$prefix = isset($dbparams['prefix']) ? $dbparams['prefix'] : '';
$this->_table_names = array('page_tbl' => $prefix . 'page', 'version_tbl' => $prefix . 'version', 'link_tbl' => $prefix . 'link', 'recent_tbl' => $prefix . 'recent', 'nonempty_tbl' => $prefix . 'nonempty');
$page_tbl = $this->_table_names['page_tbl'];
$version_tbl = $this->_table_names['version_tbl'];
$this->page_tbl_fields = "{$page_tbl}.id AS id, {$page_tbl}.pagename AS pagename, {$page_tbl}.hits AS hits";
$this->version_tbl_fields = "{$version_tbl}.version AS version, {$version_tbl}.mtime AS mtime, " . "{$version_tbl}.minor_edit AS minor_edit, {$version_tbl}.content AS content, {$version_tbl}.versiondata AS versiondata";
$this->_expressions = array('maxmajor' => "MAX(CASE WHEN minor_edit=0 THEN version END)", 'maxminor' => "MAX(CASE WHEN minor_edit<>0 THEN version END)", 'maxversion' => "MAX(version)", 'notempty' => "<>''", 'iscontent' => "content<>''");
}
示例10: open
function open($mode = 'w')
{
if ($this->_dbh) {
return;
}
// already open.
$watchdog = $this->_timeout;
global $ErrorManager;
$this->_dba_open_error = false;
$ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_dba_open_error_handler'));
// oops, you don't have DBA support.
if (!function_exists("dba_open")) {
echo "You don't seem to have DBA support compiled into PHP.";
}
// lock supported since 4.3.0:
if (check_php_version(4, 3, 0) and strlen($mode) == 1) {
// PHP 4.3.x Windows lock bug workaround: http://bugs.php.net/bug.php?id=23975
if (isWindows()) {
$mode .= "-";
// suppress locking, or
} elseif ($this->_handler != 'gdbm') {
// gdbm does it internally
$mode .= "d";
// else use internal locking
}
}
while (($dbh = dba_open($this->_file, $mode, $this->_handler)) < 1) {
if ($watchdog <= 0) {
break;
}
flush();
// "c" failed, try "w" instead.
if (substr($mode, 0, 1) == "c" and file_exists($this->_file)) {
$mode = "w";
}
// conflict: wait some random time to unlock (see ethernet)
$secs = 0.5 + (double) rand(1, 32767) / 32767;
sleep($secs);
$watchdog -= $secs;
if (strlen($mode) == 2) {
$mode = substr($mode, 0, -1);
}
}
$ErrorManager->popErrorHandler();
if (!$dbh) {
if ($error = $this->_dba_open_error) {
$error->errno = E_USER_ERROR;
$error->errstr .= "\nfile: " . $this->_file . "\nmode: " . $mode . "\nhandler: " . $this->_handler;
$ErrorManager->handleError($error);
} else {
trigger_error("dba_open failed", E_USER_ERROR);
}
}
$this->_dbh = $dbh;
return !empty($dbh);
}
示例11: _DbPassUser
function _DbPassUser($UserName = '', $prefs = false)
{
if (!$this->_prefs) {
if ($prefs) {
$this->_prefs = $prefs;
}
}
if (!isset($this->_prefs->_method)) {
_PassUser::_PassUser($UserName);
} elseif (!$this->isValidName($UserName)) {
trigger_error(_("Invalid username."), E_USER_WARNING);
return false;
}
$this->_authmethod = 'Db';
//$this->getAuthDbh();
//$this->_auth_crypt_method = @$GLOBALS['DBAuthParams']['auth_crypt_method'];
$dbi =& $GLOBALS['request']->_dbi;
$dbtype = $dbi->getParam('dbtype');
if ($dbtype == 'ADODB') {
include_once "lib/WikiUser/AdoDb.php";
if (check_php_version(5)) {
return new _AdoDbPassUser($UserName, $this->_prefs);
} else {
$user = new _AdoDbPassUser($UserName, $this->_prefs);
eval("\$this = \$user;");
return $user;
}
} elseif ($dbtype == 'SQL') {
include_once "lib/WikiUser/PearDb.php";
if (check_php_version(5)) {
return new _PearDbPassUser($UserName, $this->_prefs);
} else {
$user = new _PearDbPassUser($UserName, $this->_prefs);
eval("\$this = \$user;");
return $user;
}
} elseif ($dbtype == 'PDO') {
include_once "lib/WikiUser/PdoDb.php";
if (check_php_version(5)) {
return new _PdoDbPassUser($UserName, $this->_prefs);
} else {
$user = new _PdoDbPassUser($UserName, $this->_prefs);
eval("\$this = \$user;");
return $user;
}
}
return false;
}
示例12: wp_eMember_dashboard
function wp_eMember_dashboard()
{
echo '<div class="wrap"><h2>WP eMembers - Dashboard v' . WP_EMEMBER_VERSION . '</h2>';
echo check_php_version();
echo eMember_admin_submenu_css();
?>
<h3 class="nav-tab-wrapper">
<a class="nav-tab nav-tab-active" href="#">Dashboard</a>
<a class="nav-tab" href="admin.php?page=wp_eMember_manage">Members</a>
<a class="nav-tab" href="admin.php?page=eMember_membership_level_menu">Membership Levels</a>
<a class="nav-tab" href="admin.php?page=eMember_settings_menu">Settings</a>
</h3>
<?php
wp_eMember_dashboard1();
echo '</div>';
}
示例13: testLinks
function testLinks()
{
$uplink = 'http://' . (defined('SERVER_NAME') ? SERVER_NAME : '') . DATA_PATH . '/uploads/image.jpg';
$tests = array("[label|link]" => 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:15:"Cached_WikiLink":2:{s:5:"_page";s:4:"link";s:6:"_label";s:5:"label";}i:2;s:0:"";}}', "[ label | link.jpg ]" => 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:15:"Cached_WikiLink":2:{s:5:"_page";s:8:"link.jpg";s:6:"_label";s:5:"label";}i:2;s:0:"";}}', "[ image.jpg | link ]" => check_php_version(5) ? 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:15:"Cached_WikiLink":2:{s:5:"_page";s:4:"link";s:6:"_label";O:11:"HtmlElement":4:{s:4:"_tag";s:6:"object";s:5:"_attr";a:5:{s:3:"src";s:0:"";s:3:"alt";s:4:"link";s:5:"title";s:4:"link";s:5:"class";s:12:"inlineobject";s:4:"type";b:0;}s:8:"_content";a:1:{i:0;O:11:"HtmlElement":4:{s:4:"_tag";s:5:"embed";s:5:"_attr";a:5:{s:3:"src";s:0:"";s:3:"alt";s:4:"link";s:5:"title";s:4:"link";s:5:"class";s:12:"inlineobject";s:4:"type";b:0;}s:8:"_content";a:0:{}s:11:"_properties";i:4;}}s:11:"_properties";i:6;}}i:2;s:0:"";}}' : 'o:10:"xmlcontent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;o:15:"cached_wikilink":2:{s:5:"_page";s:4:"link";s:6:"_label";o:11:"htmlelement":4:{s:8:"_content";a:1:{i:0;o:11:"htmlelement":4:{s:8:"_content";a:0:{}s:4:"_tag";s:5:"embed";s:5:"_attr";a:5:{s:3:"src";s:0:"";s:3:"alt";s:4:"link";s:5:"title";s:4:"link";s:5:"class";s:12:"inlineobject";s:4:"type";b:0;}s:11:"_properties";i:4;}}s:4:"_tag";s:6:"object";s:5:"_attr";a:5:{s:3:"src";s:0:"";s:3:"alt";s:4:"link";s:5:"title";s:4:"link";s:5:"class";s:12:"inlineobject";s:4:"type";b:0;}s:11:"_properties";i:6;}}i:2;s:0:"";}}', "[ Upload:image.jpg | link ]" => !check_php_version(5) ? 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:15:"Cached_WikiLink":2:{s:5:"_page";s:4:"link";s:6:"_label";O:11:"HtmlElement":4:{s:8:"_content";a:0:{}s:4:"_tag";s:3:"img";s:5:"_attr";a:4:{s:3:"src";s:' . strlen($uplink) . ':"' . $uplink . '";s:3:"alt";s:4:"link";s:5:"title";s:4:"link";s:5:"class";s:11:"inlineimage";}s:11:"_properties";i:7;}}i:2;s:0:"";}}' : 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:15:"Cached_WikiLink":2:{s:5:"_page";s:4:"link";s:6:"_label";O:11:"HtmlElement":4:{s:4:"_tag";s:3:"img";s:5:"_attr";a:4:{s:3:"src";s:' . strlen($uplink) . ':"' . $uplink . '";s:3:"alt";s:4:"link";s:5:"title";s:4:"link";s:5:"class";s:11:"inlineimage";}s:8:"_content";a:0:{}s:11:"_properties";i:7;}}i:2;s:0:"";}}', "[ http://server/image.jpg | link ]" => !check_php_version(5) ? 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:15:"Cached_WikiLink":2:{s:5:"_page";s:4:"link";s:6:"_label";O:11:"HtmlElement":4:{s:8:"_content";a:0:{}s:4:"_tag";s:3:"img";s:5:"_attr";a:4:{s:3:"src";s:23:"http://server/image.jpg";s:3:"alt";s:4:"link";s:5:"title";s:4:"link";s:5:"class";s:11:"inlineimage";}s:11:"_properties";i:7;}}i:2;s:0:"";}}' : 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:15:"Cached_WikiLink":2:{s:5:"_page";s:4:"link";s:6:"_label";O:11:"HtmlElement":4:{s:4:"_tag";s:3:"img";s:5:"_attr";a:4:{s:3:"src";s:23:"http://server/image.jpg";s:3:"alt";s:4:"link";s:5:"title";s:4:"link";s:5:"class";s:11:"inlineimage";}s:8:"_content";a:0:{}s:11:"_properties";i:7;}}i:2;s:0:"";}}', "[ label | http://server/link ]" => 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:19:"Cached_ExternalLink":2:{s:4:"_url";s:18:"http://server/link";s:6:"_label";s:5:"label";}i:2;s:0:"";}}', "[ label | Upload:link ]" => 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:20:"Cached_InterwikiLink":2:{s:5:"_link";s:11:"Upload:link";s:6:"_label";s:5:"label";}i:2;s:0:"";}}', "[ label | phpwiki:action=link ]" => 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:17:"Cached_PhpwikiURL":2:{s:4:"_url";s:19:"phpwiki:action=link";s:6:"_label";s:5:"label";}i:2;s:0:"";}}', "Upload:image.jpg" => 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:20:"Cached_InterwikiLink":1:{s:5:"_link";s:16:"Upload:image.jpg";}i:2;s:0:"";}}', "http://server/image.jpg" => 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:19:"Cached_ExternalLink":1:{s:4:"_url";s:23:"http://server/image.jpg";}i:2;s:0:"";}}', "http://server/link" => 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:19:"Cached_ExternalLink":1:{s:4:"_url";s:18:"http://server/link";}i:2;s:0:"";}}', "[http:/server/~name/]" => 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:19:"Cached_ExternalLink":1:{s:4:"_url";s:18:"http:/server/name/";}i:2;s:0:"";}}', "http:/server/~name/" => 'O:10:"XmlContent":1:{s:8:"_content";a:3:{i:0;s:0:"";i:1;O:19:"Cached_ExternalLink":1:{s:4:"_url";s:18:"http:/server/name/";}i:2;s:0:"";}}');
//$i = 0;
foreach ($tests as $wiki => $expected) {
//print $i++ . " .. ";
$xml = TransformInline($wiki);
$this->assertTrue(isa($xml, 'XmlContent'));
$actual = serialize($xml);
if (!check_php_version(5)) {
$expected = strtolower($expected);
$actual = strtolower($actual);
}
$this->assertEquals($expected, $actual);
}
}
示例14: wp_eMember_members
function wp_eMember_members()
{
echo '<div class="wrap"><h2>WP eMembers - Members v' . WP_EMEMBER_VERSION . '</h2>';
echo check_php_version();
echo eMember_admin_submenu_css();
$_GET['members_action'] = isset($_GET['members_action']) ? $_GET['members_action'] : "";
switch ($_GET['members_action']) {
case 'add_edit':
build_menu(2);
wp_eMember_add_memebers();
break;
case 'manage_list':
build_menu(3);
wp_eMember_manage_memebers_lists();
break;
case 'edit_ip_lock':
build_menu(1);
wp_eMember_edit_ip_lock();
break;
case 'add_wp_members':
build_menu(4);
wp_eMember_add_wp_members();
break;
case 'manage_blacklist':
build_menu(5);
wp_eMember_manage_blackList();
break;
case 'manage_upgrade':
build_menu(6);
wp_eMember_manage_upgrade();
break;
case 'manage':
default:
build_menu(1);
wp_eMember_manage_members();
break;
}
echo '</div>';
}
示例15: checkPass
/** A BogoLoginUser requires no password at all
* But if there's one stored, we override it with the PersonalPagePassUser instead
*/
function checkPass($submitted_password)
{
if ($this->_prefs->get('passwd')) {
if (isset($this->_prefs->_method) and $this->_prefs->_method == 'HomePage') {
$user = new _PersonalPagePassUser($this->_userid, $this->_prefs);
if ($user->checkPass($submitted_password)) {
if (!check_php_version(5)) {
eval("\$this = \$user;");
}
// /*PHP5 patch*/$this = $user;
$user = UpgradeUser($this, $user);
$this->_level = WIKIAUTH_USER;
return $this->_level;
} else {
$this->_level = WIKIAUTH_ANON;
return $this->_level;
}
} else {
$stored_password = $this->_prefs->get('passwd');
if ($this->_checkPass($submitted_password, $stored_password)) {
$this->_level = WIKIAUTH_USER;
return $this->_level;
} elseif (USER_AUTH_POLICY === 'strict') {
$this->_level = WIKIAUTH_FORBIDDEN;
return $this->_level;
} else {
return $this->_tryNextPass($submitted_password);
}
}
}
if (isWikiWord($this->_userid)) {
$this->_level = WIKIAUTH_BOGO;
} else {
$this->_level = WIKIAUTH_ANON;
}
return $this->_level;
}