本文整理汇总了PHP中wfDebugDieBacktrace函数的典型用法代码示例。如果您正苦于以下问题:PHP wfDebugDieBacktrace函数的具体用法?PHP wfDebugDieBacktrace怎么用?PHP wfDebugDieBacktrace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wfDebugDieBacktrace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PageArchive
function PageArchive(&$title)
{
if (is_null($title)) {
wfDebugDieBacktrace('Archiver() given a null title.');
}
$this->title =& $title;
}
示例2: oaiDatestamp
/**
* @return string
*/
function oaiDatestamp($timestamp, $granularity = 'YYYY-MM-DDThh:mm:ssZ')
{
$formats = array('YYYY-MM-DD' => '$1-$2-$3', 'YYYY-MM-DDThh:mm:ssZ' => '$1-$2-$3T$4:$5:$6Z');
if (!isset($formats[$granularity])) {
wfDebugDieBacktrace('oaiFormatDate given illegal output format');
}
return preg_replace('/^(....)(..)(..)(..)(..)(..)$/', $formats[$granularity], wfTimestamp(TS_MW, $timestamp));
}
示例3: initialize
/**
* Initialization of ... everything
@return Article either the object to become $wgArticle, or NULL
*/
function initialize(&$title, &$output, &$user, $request)
{
wfProfileIn('MediaWiki::initialize');
$this->preliminaryChecks($title, $output, $request);
$article = NULL;
if (!$this->initializeSpecialCases($title, $output, $request)) {
$article = $this->initializeArticle($title, $request);
if (is_object($article)) {
$this->performAction($output, $article, $title, $user, $request);
} elseif (is_string($article)) {
$output->redirect($article);
} else {
wfDebugDieBacktrace("Shouldn't happen: MediaWiki::initializeArticle() returned neither an object nor a URL");
}
}
wfProfileOut('MediaWiki::initialize');
return $article;
}
示例4: processLoginRequest
function processLoginRequest($user, $pass)
{
global $wgUser, $wgRequest;
$userlogin = new LoginForm($wgRequest);
$userlogin->mName = $user;
$userlogin->mPassword = $pass;
//$auth = $userlogin->authenticateUserData();
//$r= new AjaxResponse($auth);
//return $r;
$msg = '';
switch ($userlogin->authenticateUserData()) {
case LoginForm::SUCCESS:
$wgUser->setCookies();
$msg = wfMsgWikiHtml('loginsuccess', $wgUser->getName());
break;
case LoginForm::NO_NAME:
case LoginForm::ILLEGAL:
$msg = wfMsgWikiHtml('noname');
break;
case LoginForm::WRONG_PLUGIN_PASS:
$msg = wfMsgWikiHtml('wrongpassword');
break;
case LoginForm::NOT_EXISTS:
$msg = wfMsgWikiHtml('nosuchuser', htmlspecialchars($user));
break;
case LoginForm::WRONG_PASS:
$msg = wfMsgWikiHtml('wrongpassword');
break;
case LoginForm::EMPTY_PASS:
$msg = wfMsgWikiHtml('wrongpasswordempty');
break;
case LoginForm::RESET_PASS:
$msg = wfMsgWikiHtml('resetpass_announce');
break;
default:
wfDebugDieBacktrace("Unhandled case value");
}
return new AjaxResponse('<div class="pBody">' . $msg . '</div>');
}
示例5: extCreateObject
/**
* Equivalent of wfCreateObject
*/
function extCreateObject($name, $p)
{
$p = array_values($p);
switch (count($p)) {
case 0:
return new $name();
case 1:
return new $name($p[0]);
case 2:
return new $name($p[0], $p[1]);
case 3:
return new $name($p[0], $p[1], $p[2]);
case 4:
return new $name($p[0], $p[1], $p[2], $p[3]);
case 5:
return new $name($p[0], $p[1], $p[2], $p[3], $p[4]);
case 6:
return new $name($p[0], $p[1], $p[2], $p[3], $p[4], $p[5]);
default:
wfDebugDieBacktrace("Too many arguments to constructor in extCreateObject");
}
}
示例6: error
function error()
{
wfDebugDieBacktrace("Attempt to call member function of FakeTitle\n");
}
示例7: HTCPPurge
static function HTCPPurge($urlArr)
{
global $wgHTCPMulticastAddress, $wgHTCPMulticastTTL, $wgHTCPPort;
$fname = 'SquidUpdate::HTCPPurge';
wfProfileIn($fname);
$htcpOpCLR = 4;
// HTCP CLR
// FIXME PHP doesn't support these socket constants (include/linux/in.h)
if (!defined("IPPROTO_IP")) {
define("IPPROTO_IP", 0);
define("IP_MULTICAST_LOOP", 34);
define("IP_MULTICAST_TTL", 33);
}
// pfsockopen doesn't work because we need set_sock_opt
$conn = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
if ($conn) {
// Set socket options
socket_set_option($conn, IPPROTO_IP, IP_MULTICAST_LOOP, 0);
if ($wgHTCPMulticastTTL != 1) {
socket_set_option($conn, IPPROTO_IP, IP_MULTICAST_TTL, $wgHTCPMulticastTTL);
}
foreach ($urlArr as $url) {
if (!is_string($url)) {
wfDebugDieBacktrace('Bad purge URL');
}
$url = SquidUpdate::expand($url);
// Construct a minimal HTCP request diagram
// as per RFC 2756
// Opcode 'CLR', no response desired, no auth
$htcpTransID = rand();
$htcpSpecifier = pack('na4na*na8n', 4, 'HEAD', strlen($url), $url, 8, 'HTTP/1.0', 0);
$htcpDataLen = 8 + 2 + strlen($htcpSpecifier);
$htcpLen = 4 + $htcpDataLen + 2;
// Note! Squid gets the bit order of the first
// word wrong, wrt the RFC. Apparently no other
// implementation exists, so adapt to Squid
$htcpPacket = pack('nxxnCxNxxa*n', $htcpLen, $htcpDataLen, $htcpOpCLR, $htcpTransID, $htcpSpecifier, 2);
// Send out
wfDebug("Purging URL {$url} via HTCP\n");
socket_sendto($conn, $htcpPacket, $htcpLen, 0, $wgHTCPMulticastAddress, $wgHTCPPort);
}
} else {
$errstr = socket_strerror(socket_last_error());
wfDebug("SquidUpdate::HTCPPurge(): Error opening UDP socket: {$errstr}\n");
}
wfProfileOut($fname);
}
示例8: delete
/**
* DELETE query wrapper
*
* Use $conds == "*" to delete all rows
*/
function delete($table, $conds, $fname = 'Database::delete')
{
if (!$conds) {
wfDebugDieBacktrace('Database::delete() called with no conditions');
}
$table = $this->tableName($table);
$sql = "DELETE FROM {$table}";
if ($conds != '*') {
$sql .= ' WHERE ' . $this->makeList($conds, LIST_AND);
}
return $this->query($sql, $fname);
}
示例9: checkTitleEncoding
/**
* @param $s string
* @return string
*/
function checkTitleEncoding($s)
{
if (is_array($s)) {
wfDebugDieBacktrace('Given array to checkTitleEncoding.');
}
# Check for non-UTF-8 URLs
$ishigh = preg_match('/[\\x80-\\xff]/', $s);
if (!$ishigh) {
return $s;
}
$isutf8 = preg_match('/^([\\x00-\\x7f]|[\\xc0-\\xdf][\\x80-\\xbf]|' . '[\\xe0-\\xef][\\x80-\\xbf]{2}|[\\xf0-\\xf7][\\x80-\\xbf]{3})+$/', $s);
if ($isutf8) {
return $s;
}
return $this->iconv($this->fallback8bitEncoding(), 'utf-8', $s);
}
示例10: checkTitleEncoding
/**
* @param $s string
* @return string
*/
function checkTitleEncoding($s)
{
if (is_array($s)) {
wfDebugDieBacktrace('Given array to checkTitleEncoding.');
}
if (StringUtils::isUtf8($s)) {
return $s;
}
return $this->iconv($this->fallback8bitEncoding(), 'utf-8', $s);
}
示例11: checkDBSchema
function checkDBSchema(&$db)
{
# img_name must be unique
if (!$db->indexUnique('image', 'img_name') && !$db->indexExists('image', 'PRIMARY')) {
wfDebugDieBacktrace('Database schema not up to date, please run maintenance/archives/patch-image_name_unique.sql');
}
#new fields must exist
if (!$db->fieldExists('image', 'img_media_type') || !$db->fieldExists('image', 'img_metadata') || !$db->fieldExists('image', 'img_width')) {
wfDebugDieBacktrace('Database schema not up to date, please run maintenance/update.php');
}
}
示例12: processLogin
function processLogin()
{
global $wgUser, $wgAuth;
switch ($this->authenticateUserData()) {
case self::SUCCESS:
# We've verified now, update the real record
if ((bool) $this->mRemember != (bool) $wgUser->getOption('rememberpassword')) {
$wgUser->setOption('rememberpassword', $this->mRemember ? 1 : 0);
$wgUser->saveSettings();
} else {
$wgUser->invalidateCache();
}
$wgUser->setCookies();
if ($this->hasSessionCookie()) {
if ($this->mAutoRedirect != "") {
$title = Title::newFromText(urldecode($this->mAutoRedirect));
if ($title && is_object($title) && ($this->mFromSite || $this->shouldFollow($title))) {
return $this->successfulLogin($title->getLocalURL(), true, true);
}
}
return $this->successfulLogin(wfMsg('loginsuccess_owl', $wgUser->getName()));
} else {
return $this->cookieRedirectCheck('login');
}
break;
case self::NO_NAME:
case self::ILLEGAL:
$this->mainLoginForm(wfMsg('noname'), 'error_username');
break;
case self::WRONG_PLUGIN_PASS:
$this->mainLoginForm(wfMsg('wrongpassword'), 'error_password');
break;
case self::NOT_EXISTS:
if ($wgUser->isAllowed('createaccount')) {
$this->mainLoginForm(wfMsg('nosuchuser', htmlspecialchars($this->mName)), 'error_username');
} else {
$this->mainLoginForm(wfMsg('nosuchusershort', htmlspecialchars($this->mName)), 'error_username');
}
break;
// XXADDED
// XXADDED
case self::NO_EMAIL:
$this->mainLoginForm(wfMsg('noemail_login'), 'error_username');
break;
case self::MULTIPLE_EMAILS:
$this->mainLoginForm(wfMsg('multipleemails_login'), 'error_username');
break;
case self::WRONG_PASS:
$this->mainLoginForm(wfMsg('wrongpassword'), 'error_password');
break;
case self::EMPTY_PASS:
$this->mainLoginForm(wfMsg('wrongpasswordempty'), 'error_password');
break;
case self::RESET_PASS:
$this->resetLoginForm(wfMsg('resetpass_announce'), 'error_password');
break;
default:
wfDebugDieBacktrace("Unhandled case value");
}
}
示例13: getTagAttributeCallback
/**
* Pick the appropriate attribute value from a match set from the
* MW_ATTRIBS_REGEX matches.
*
* @param array $set
* @return string
* @access private
*/
function getTagAttributeCallback($set)
{
if (isset($set[6])) {
# Illegal #XXXXXX color with no quotes.
return $set[6];
} elseif (isset($set[5])) {
# No quotes.
return $set[5];
} elseif (isset($set[4])) {
# Single-quoted
return $set[4];
} elseif (isset($set[3])) {
# Double-quoted
return $set[3];
} elseif (!isset($set[2])) {
# In XHTML, attributes must have a value.
# For 'reduced' form, return explicitly the attribute name here.
return $set[1];
} else {
wfDebugDieBacktrace("Tag conditions not met. This should never happen and is a bug.");
}
}
示例14: delete
/** Delete a group */
function delete()
{
global $wgMemc;
if (Group::getStaticGroups()) {
wfDebugDieBacktrace("Can't modify groups in static mode");
}
if ($this->id == 0) {
return;
}
$fname = 'Group::delete';
$dbw =& wfGetDB(DB_MASTER);
// First remove all users from the group
$dbw->delete('user_group', array('ug_group' => $this->id), $fname);
// Now delete the group
$dbw->delete('groups', array('gr_id' => $this->id), $fname);
$wgMemc->delete(Group::getCacheKey($this->id));
}
示例15: MwRdfGetModel
function MwRdfGetModel($article, $modelnames = null)
{
global $wgRdfModelFunctions, $wgRdfDefaultModels;
if ($modelnames == null) {
$modelnames = $wgRdfDefaultModels;
}
$fullModel = ModelFactory::getDefaultModel();
$title = $article->mTitle;
$uri = $title->getFullURL();
$fullModel->setBaseURI($uri);
foreach ($modelnames as $modelname) {
$modelfunc = $wgRdfModelFunctions[$modelname];
if (!$modelfunc) {
wfDebugDieBacktrace("MwRdf: No RDF model named '{$modelname}'.");
} elseif (!function_exists($modelfunc)) {
wfDebugDieBacktrace("MwRdf: No function named '{$modelfunc}' " . " for model '{$modelname}'.");
}
# Check the cache...
$model = MwRdfGetCache($title, $modelname);
# If it's not there, regenerate.
if (!isset($model) || !$model) {
$model = $modelfunc($article);
MwRdfSetCache($title, $modelname, $model);
}
if (isset($model)) {
$fullModel->addModel($model);
}
}
return $fullModel;
}