当前位置: 首页>>代码示例>>PHP>>正文


PHP XenForo_Application::setDebugMode方法代码示例

本文整理汇总了PHP中XenForo_Application::setDebugMode方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Application::setDebugMode方法的具体用法?PHP XenForo_Application::setDebugMode怎么用?PHP XenForo_Application::setDebugMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XenForo_Application的用法示例。


在下文中一共展示了XenForo_Application::setDebugMode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initDependencies

 public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
 {
     $xenOptions = XenForo_Application::get('options');
     if ($dependencies instanceof XenForo_Dependencies_Public && $xenOptions->th_disableDebugMode_section != 'admin') {
         XenForo_Application::setDebugMode(false);
     } elseif ($dependencies instanceof XenForo_Dependencies_Admin && $xenOptions->th_disableDebugMode_section != 'public') {
         XenForo_Application::setDebugMode(false);
     }
     $initDependencies = new ThemeHouse_DisableDebug_Listener_InitDependencies($dependencies, $data);
     $initDependencies->run();
 }
开发者ID:ThemeHouse-XF,项目名称:DisableDebug,代码行数:11,代码来源:InitDependencies.php

示例2: _preDispatchFirst

 protected function _preDispatchFirst($action)
 {
     $configFile = XenForo_Application::getInstance()->getConfigDir() . '/config.php';
     if (file_exists($configFile)) {
         XenForo_Application::getInstance()->loadDefaultData();
     } else {
         XenForo_Application::set('config', XenForo_Application::getInstance()->loadDefaultConfig());
     }
     XenForo_Application::setDebugMode(true);
     @set_time_limit(120);
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:11,代码来源:Abstract.php

示例3: actionGetThread


//.........这里部分代码省略.........
             }
         }
         list($text, $nuked_quotes, $images) = parse_post(fr_strip_smilies($this, XenForo_Helper_String::censorString($post['message'])), true);
         if (count($fr_images) > 0) {
             $text .= "<br/>";
             foreach ($fr_images as $attachment) {
                 $text .= "<img src=\"{$attachment['img']}\"/>";
             }
         }
         foreach ($images as $image) {
             $fr_images[] = array('img' => $image);
         }
         $avatarurl = '';
         if ($user !== false) {
             $avatarurl = process_avatarurl(XenForo_Template_Helper_Core::getAvatarUrl($user, 'm'));
             if (strpos($avatarurl, '/xenforo/avatars/avatar_') !== false) {
                 $avatarurl = '';
             }
         }
         $post_page = floor($post['position'] / XenForo_Application::get('options')->messagesPerPage) + 1;
         $out = array('post_id' => $post['post_id'], 'thread_id' => $post['thread_id'], 'forum_id' => $post['node_id'], 'forum_title' => prepare_utf8_string(strip_tags($post['node_title'])), 'username' => prepare_utf8_string(strip_tags($post['username'])), 'joindate' => prepare_utf8_string(XenForo_Locale::date($post['register_date'], 'absolute')), 'usertitle' => strip_tags(XenForo_Template_Helper_Core::helperUserTitle($user)), 'numposts' => $user ? $user['message_count'] : 0, 'userid' => $post['user_id'], 'canlike' => $post['canLike'] ? true : false, 'likes' => $post['like_date'] > 0 ? true : false, 'title' => prepare_utf8_string(XenForo_Helper_String::censorString($post['title'])), 'online' => $is_online, 'post_timestamp' => prepare_utf8_string(XenForo_Locale::dateTime($post['post_date'], 'absolute')), 'post_link' => fr_get_xenforo_bburl() . '/' . XenForo_Link::buildPublicLink('threads', $thread_info, array('page' => $post_page)) . '#post-' . $post['post_id'], 'fr_images' => $fr_images);
         if ($post['canDelete']) {
             $out['candelete'] = true;
         }
         if ($post['likes']) {
             $out['likestext'] = prepare_utf8_string($post_helper->likesHtml($post['post_id'], $post['likes'], $post['like_date'], $post['likeUsers']));
             $like_users = '';
             for ($i = 0; $i < count($post['likeUsers']); $i++) {
                 if ($i != 0) {
                     $like_users .= ', ';
                 }
                 $like_users .= $post['likeUsers'][$i]['username'];
             }
             $out['likesusers'] = prepare_utf8_string($like_users);
         }
         if ($avatarurl != '') {
             $out['avatarurl'] = $avatarurl;
         }
         if ($post['message_state'] == 'deleted') {
             $out += array('deleted' => true, 'del_username' => prepare_utf8_string(strip_tags($post['delete_username'])));
             if ($post['delete_reason']) {
                 $out['del_reason'] = prepare_utf8_string($post['delete_reason']);
             }
         } else {
             if ($post['canEdit']) {
                 $out += array('canedit' => $post['canEdit']);
             }
             $out += array('text' => $text, 'quotable' => $nuked_quotes, 'edittext' => prepare_utf8_string($post['message']));
         }
         if (count($docattach)) {
             $out['docattach'] = $docattach;
         }
         if ($signature) {
             $sig = trim(strip_tags(remove_bbcode($post['signature'], true, true), '<a>'));
             $sig = str_replace(array("\t", "\r"), array('', ''), $sig);
             $sig = str_replace("\n\n", "\n", $sig);
             $out['sig'] = prepare_utf8_string($sig);
         }
         $post_data[] = $out;
     }
     $out = array('posts' => $post_data, 'total_posts' => $thread_info['reply_count'] + 1, 'page' => $page, 'canpost' => $thread_model->canReplyToThread($thread_info, $forum_info), 'canattach' => $forum_model->canUploadAndManageAttachment($forum_info), 'title' => prepare_utf8_string(XenForo_Helper_String::censorString($thread_info['title'])), 'thread_link' => process_avatarurl(XenForo_Link::buildPublicLink('threads', $thread_info, array('page' => $page))), 'subscribed' => $thread_info['thread_is_watched'] ? 1 : 0);
     if ($gotopostid) {
         $out['gotopostid'] = $gotopostid;
     }
     if ($thread_info['discussion_type'] == 'poll') {
         $poll_model = $this->_getPollModel();
         $poll = $poll_model->getPollByContent('thread', $threadid);
         if ($poll) {
             $out['pollid'] = $poll['poll_id'];
         }
     }
     $modbit = 0;
     if (isset($mod['delete']) && $mod['delete']) {
         $modbit |= MOD_DELETEPOST;
     }
     if ($thread_info['sticky'] && isset($thread_mod['unstick']) && $thread_mod['unstick']) {
         $modbit |= MOD_UNSTICK;
     }
     if (!$thread_info['sticky'] && isset($thread_mod['stick']) && $thread_mod['stick']) {
         $modbit |= MOD_STICK;
     }
     if (isset($thread_mod['delete']) && $thread_mod['delete']) {
         $modbit |= MOD_DELETETHREAD;
     }
     XenForo_Application::setDebugMode(true);
     if ($thread_info['discussion_open'] && isset($thread_mod['lock']) && $thread_mod['lock']) {
         $modbit |= MOD_CLOSE;
     }
     if (!$thread_info['discussion_open'] && isset($thread_mod['unlock']) && $thread_mod['unlock']) {
         $modbit |= MOD_OPEN;
     }
     if (isset($thread_mod['move']) && $thread_mod['move']) {
         $modbit |= MOD_MOVETHREAD;
     }
     if (XenForo_Permission::hasPermission($visitor['permissions'], 'general', 'cleanSpam')) {
         $modbit |= MOD_SPAM_CONTROLS;
     }
     $out['mod'] = $modbit;
     return $out;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:101,代码来源:Thread.php

示例4: header

 *      
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
header('content-type: application/json; charset: utf-8');
/**
 * Bridge to XenForo
 */
$startTime = microtime(true);
$fileDir = '../../';
require $fileDir . '/library/XenForo/Autoloader.php';
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);
XenForo_Application::disablePhpErrorHandler();
XenForo_Application::setDebugMode(false);
XenForo_Application::$externalDataPath = $fileDir . '/data';
XenForo_Application::$externalDataUrl = $fileDir . '/data';
XenForo_Application::$javaScriptUrl = $fileDir . '/js';
restore_error_handler();
restore_exception_handler();
$options = XenForo_Application::get('options');
$STEAM_GAMEBANNER = $options->steamDisplayBanner;
if (!empty($_GET['steamids'])) {
    /*
     * Fetch profile data
     */
    $sHelper = new Steam_Helper_Steam();
    $steamProfileAPI = $sHelper->getSteamProfileAPI($_GET['steamids']);
    $fullProfile = $_GET['fullprofile'];
    $contentJson = $sHelper->getJsonData($steamProfileAPI);
开发者ID:WENKz,项目名称:Steam-Authentication-for-XenForo,代码行数:31,代码来源:jsonproxy.php

示例5: die

}
if (php_sapi_name() !== "cli") {
    die("Oops. Please run this script at the command line");
}
$libDir = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR;
$xfPath = $libDir . "XenForo" . DIRECTORY_SEPARATOR;
$autoloaderPath = $xfPath . DIRECTORY_SEPARATOR . "Autoloader.php";
if (!file_exists($autoloaderPath)) {
    ec("Checked " . $libDir . DIRECTORY_SEPARATOR . "Autoloader.php");
    die("This file should be inside the AssociationMc directory in the library directory of a XenForo installation.");
}
/** @noinspection PhpIncludeInspection */
require_once $autoloaderPath;
XenForo_Autoloader::getInstance()->setupAutoloader($libDir);
XenForo_Application::initialize($libDir, $libDir);
XenForo_Application::setDebugMode(true);
$dependencies = new XenForo_Dependencies_Public();
$dependencies->preLoadData();
$db = XenForo_Application::getDb();
/** @var $db Zend_Db_Adapter_Abstract */
// Fun hack so we don't need a new function on the model :P
$records = $db->fetchAll('SELECT *, HEX(minecraft_uuid) FROM xf_association_mc');
$totalRecords = count($records);
ec("{$totalRecords} recoord(s) are to be processed." . PHP_EOL);
$i = 0;
foreach ($records as $record) {
    $hex = $record['HEX(minecraft_uuid)'];
    $xfId = $record['xenforo_id'];
    $lastUsername = $record['last_username'];
    ec("Processing user with id {$xfId}. Their last known username was {$lastUsername}. Their UUID is {$hex}.");
    ec("Requesting names info from Mojang...");
开发者ID:adamjdev,项目名称:XenForo-MCASSOC,代码行数:31,代码来源:updateNames.php


注:本文中的XenForo_Application::setDebugMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。