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


PHP XenForo_Application::debugMode方法代码示例

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


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

示例1: keepWidgetChanges

 public static function keepWidgetChanges($widgetId, WidgetFramework_DataWriter_Widget $dw, array $newData)
 {
     if (!XenForo_Application::debugMode()) {
         return false;
     }
     foreach ($newData as $key => $value) {
         if ($key == 'options') {
             $existingOptions = $dw->getWidgetOptions(true);
             $options = $dw->getWidgetOptions();
             $optionKeys = array_unique(array_merge(array_keys($existingOptions), array_keys($options)));
             foreach ($optionKeys as $optionKey) {
                 $existingSerialized = null;
                 if (isset($existingOptions[$optionKey])) {
                     $existingSerialized = $existingOptions[$optionKey];
                 }
                 if (!is_string($existingSerialized)) {
                     $existingSerialized = serialize($existingSerialized);
                 }
                 $optionSerialized = null;
                 if (isset($options[$optionKey])) {
                     $optionSerialized = $options[$optionKey];
                 }
                 if (!is_string($optionSerialized)) {
                     $optionSerialized = serialize($optionSerialized);
                 }
                 if ($existingSerialized !== $optionSerialized) {
                     self::$_widgetChanges[$widgetId]['options'][$optionKey] = array($existingSerialized, $optionSerialized);
                 }
             }
         } else {
             self::$_widgetChanges[$widgetId][$key] = array($dw->getExisting($key), $value);
         }
     }
     return true;
 }
开发者ID:maitandat1507,项目名称:bdWidgetFramework,代码行数:35,代码来源:LayoutEditor.php

示例2: actionApi

 public function actionApi()
 {
     $input = $this->_input->filter(array('redirect' => XenForo_Input::STRING, 'timestamp' => XenForo_Input::UINT, 'user_id' => XenForo_Input::STRING));
     $userId = 0;
     if (!empty($input['user_id']) && !empty($input['timestamp'])) {
         try {
             $userId = intval(bdApi_Crypt::decryptTypeOne($input['user_id'], $input['timestamp']));
         } catch (XenForo_Exception $e) {
             if (XenForo_Application::debugMode()) {
                 $this->_response->setHeader('X-Api-Exception', $e->getMessage());
             }
         }
     }
     if ($userId > 0) {
         $this->_response->setHeader('X-Api-Login-User', $userId);
         $this->_getUserModel()->setUserRememberCookie($userId);
         XenForo_Model_Ip::log($userId, 'user', $userId, 'login_api');
         $this->_getUserModel()->deleteSessionActivity(0, $this->_request->getClientIp(false));
         $session = XenForo_Application::get('session');
         $session->changeUserId($userId);
         XenForo_Visitor::setup($userId);
     }
     if (empty($input['redirect'])) {
         $input['redirect'] = $this->getDynamicRedirectIfNot(XenForo_Link::buildPublicLink('login'));
     }
     return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, $input['redirect']);
 }
开发者ID:billyprice1,项目名称:bdApi,代码行数:27,代码来源:Login.php

示例3: actionErrorServer

 public function actionErrorServer()
 {
     $upgradePending = false;
     try {
         $db = XenForo_Application::getDb();
         if ($db->isConnected()) {
             $dbVersionId = $db->fetchOne("SELECT option_value FROM xf_option WHERE option_id = 'currentVersionId'");
             if ($dbVersionId && $dbVersionId != XenForo_Application::$versionId) {
                 $upgradePending = true;
             }
         }
     } catch (Exception $e) {
     }
     if (XenForo_Application::debugMode()) {
         $showDetails = true;
     } else {
         if (XenForo_Visitor::hasInstance() && XenForo_Visitor::getInstance()->is_admin) {
             $showDetails = true;
         } else {
             $showDetails = false;
         }
     }
     if ($upgradePending && !$showDetails) {
         return $this->responseMessage(new XenForo_Phrase('board_currently_being_upgraded'));
     } else {
         if ($showDetails) {
             $view = $this->responseView('XenForo_ViewPublic_Error_ServerError', 'error_server_error', array('exception' => $this->_request->getParam('_exception')));
             $view->responseCode = 500;
             return $view;
         } else {
             return $this->responseError(new XenForo_Phrase('server_error_occurred'), 500);
         }
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:34,代码来源:Error.php

示例4: addDefaultResponse

 /**
  * Adds system information into response data (both XML and JSON)
  *
  * @param array $data
  */
 public static function addDefaultResponse(array &$data)
 {
     if (XenForo_Application::debugMode()) {
         $data['debug'] = XenForo_Debug::getDebugTemplateParams();
         if (!empty($data['debug']['debug_url'])) {
             $data['debug']['debug_url'] = self::safeConvertApiUriToAbsoluteUri($data['debug']['debug_url'], true);
         }
         $session = self::safeGetSession();
         if (!empty($session)) {
             $clientId = $session->getOAuthClientId();
             if (!empty($clientId)) {
                 $data['debug']['client_id'] = $clientId;
                 $oauthToken = $session->getOAuthTokenText();
                 if (!empty($oauthToken)) {
                     $data['debug']['oauth_token'] = $oauthToken;
                 }
             }
             $languageId = $session->get('languageId');
             if (!empty($languageId)) {
                 $data['debug']['language_id'] = $languageId;
             }
         }
     }
     if (XenForo_Visitor::getUserId() > 0) {
         $data['system_info']['visitor_id'] = XenForo_Visitor::getUserId();
         $data['system_info']['time'] = XenForo_Application::$time;
     }
 }
开发者ID:billyprice1,项目名称:bdApi,代码行数:33,代码来源:Core.php

示例5: actionErrorNotFound

 public function actionErrorNotFound()
 {
     $controllerName = $this->_request->getParam('_controllerName');
     $action = $this->_request->getParam('_action');
     if (substr($action, 0, 3) === 'Get') {
         // try to suggest POST entry point if available
         $newControllerName = XenForo_Application::resolveDynamicClass($controllerName, 'controller');
         if (method_exists($newControllerName, 'actionPost' . substr($action, 3))) {
             return $this->responseError(new XenForo_Phrase('bdapi_only_accepts_post_requests'), 400);
         }
     }
     if (is_callable(array($this, 'getNotFoundResponse'))) {
         // XenForo 1.2.0+ has this
         return $this->getNotFoundResponse();
     }
     if (XenForo_Application::debugMode()) {
         $controllerName = $this->_request->getParam('_controllerName');
         if (empty($controllerName)) {
             return $this->responseError(new XenForo_Phrase('controller_for_route_not_found', array('routePath' => $this->_request->getParam('_origRoutePath'))), 404);
         } else {
             return $this->responseError(new XenForo_Phrase('controller_x_does_not_define_action_y', array('controller' => $controllerName, 'action' => $this->_request->getParam('_action'))), 404);
         }
     } else {
         return $this->responseError(new XenForo_Phrase('requested_page_not_found'), 404);
     }
 }
开发者ID:billyprice1,项目名称:bdApi,代码行数:26,代码来源:Error.php

示例6: get

 public static function get($key)
 {
     $options = XenForo_Application::get('options');
     static $keyPrefix = 'Tinhte_XenTag_';
     static $availableAutoTagModes = array(self::AUTO_TAG_MODE_THREAD_TAGS, self::AUTO_TAG_MODE_THREAD_TAGS_FIRST_POST_ONLY, self::AUTO_TAG_MODE_ALL_TAGS, self::AUTO_TAG_MODE_DISALBED);
     switch ($key) {
         case 'cloudLevelCount':
             return 3;
         case 'majorSection':
             return 'forums';
         case 'searchForceUseCache':
             return !XenForo_Application::debugMode();
         case 'autoTagMode':
             $mode = $options->get($keyPrefix . $key);
             if (!in_array($mode, $availableAutoTagModes)) {
                 $mode = self::AUTO_TAG_MODE_THREAD_TAGS_FIRST_POST_ONLY;
             }
             return $mode;
         case 'latestTaggedContentsLimit':
             return 10;
         case 'tagMinLength':
             return $options->get('tagLength', 'min');
     }
     return $options->get($keyPrefix . $key);
 }
开发者ID:maitandat1507,项目名称:Tinhte_XenTag,代码行数:25,代码来源:Option.php

示例7: unreadLinkPost

 /**
  * Checks if the $post is the one specified in the $unreadLink. If the $unreadLink is
  * empty or there is no post id in the link, true will be return asap.
  * Please note that for the entire request, this method only return true once.
  *
  * Usage: {xen:helper wf_unreadLinkPost, $unreadLink, $post, $posts}
  * Recommended position: hook:message_below
  *
  * @param string $unreadLink
  * @param array $post
  * @param array $posts
  * @return bool
  */
 public function unreadLinkPost($unreadLink, $post, $posts)
 {
     static $found = false;
     static $postFragment = '#post-';
     if ($found) {
         // return true once
         return false;
     }
     if (!is_array($post) || !isset($post['post_id']) || !is_array($posts)) {
         // incorrect usage...
         if (XenForo_Application::debugMode()) {
             XenForo_Error::logError('{xen:helper wf_unreadLinkPost} requires (string $unreadLink),' . ' (array $post), (array $posts)');
         }
         $found = true;
     } else {
         $postPos = strpos($unreadLink, $postFragment);
         if ($postPos === false) {
             // wait for the last post and return true
             $postIds = array_keys($posts);
             $lastPostId = array_pop($postIds);
             $found = $lastPostId == $post['post_id'];
         } else {
             // return true for the specified unread post
             $unreadLinkPostId = substr($unreadLink, $postPos + strlen($postFragment));
             $found = $unreadLinkPostId == $post['post_id'];
         }
     }
     return $found;
 }
开发者ID:maitandat1507,项目名称:bdWidgetFramework,代码行数:42,代码来源:Conditional.php

示例8: run

 public function run()
 {
     if ($this->_templateName == "PAGE_CONTAINER" && XenForo_Application::debugMode()) {
         $this->_debugMode();
     }
     return parent::run();
 }
开发者ID:ThemeHouse-XF,项目名称:DebugOnPost,代码行数:7,代码来源:TemplatePostRender.php

示例9: _getModificationAddEditResponse

 protected function _getModificationAddEditResponse(array $modification)
 {
     $addOnModel = $this->_getAddOnModel();
     $modification = $this->_adjustModificationForEdit($modification);
     $viewParams = array('modification' => $modification, 'addOnOptions' => XenForo_Application::debugMode() ? $addOnModel->getAddOnOptionsListIfAvailable() : array(), 'addOnSelected' => isset($modification['addon_id']) ? $modification['addon_id'] : $addOnModel->getDefaultAddOnId(), 'canEdit' => $this->_getModificationModel()->canEditModification($modification));
     return $this->responseView($this->_viewPrefix . 'Edit', $this->_templatePrefix . 'edit', $viewParams);
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:7,代码来源:TemplateModificationAbstract.php

示例10: renderContainer

 /**
  * Renders the container.
  * @see XenForo_ViewRenderer_Abstract::renderContainer()
  *
  * @param string
  * @param array
  *
  * @return string
  */
 public function renderContainer($contents, array $params = array(), array $newParams = array())
 {
     $params['contentTemplate'] = $this->_contentTemplate;
     $params['debugMode'] = XenForo_Application::debugMode();
     $params['serverTimeInfo'] = XenForo_Locale::getDayStartTimestamps();
     if (!empty($params['extraTabs'])) {
         foreach ($params['extraTabs'] as &$group) {
             foreach ($group as &$extraTab) {
                 if (!empty($extraTab['linksTemplate'])) {
                     $extraTab['linksTemplate'] = $this->createTemplateObject($extraTab['linksTemplate'], $extraTab);
                 }
             }
         }
     }
     $params = array_replace_recursive($params, $newParams);
     $templateName = !empty($params['containerTemplate']) ? $params['containerTemplate'] : 'PAGE_CONTAINER';
     $template = $this->createTemplateObject($templateName, $params);
     //if ($contents instanceof XenForo_Template_Abstract)
     //{
     //	$contents = $contents->render();
     //}
     $containerData = $this->_dependencies->getExtraContainerData();
     $template->setParams($containerData);
     $template->setParam('contents', $contents);
     $template->setParam('noH1', isset($containerData['h1']) && $containerData['h1'] === '');
     if ($params['debugMode']) {
         $template->setParams(XenForo_Debug::getDebugTemplateParams());
     }
     $rendered = $template->render();
     return $this->replaceRequiredExternalPlaceholders($template, $rendered);
 }
开发者ID:Troposphir,项目名称:troposphir,代码行数:40,代码来源:HtmlPublicC.php

示例11: renderCss

 public function renderCss()
 {
     // re-implement XenForo_CssOutput::renderCss() so we can change how caching works
     $cacheId = $this->getCacheId();
     if ($cacheObject = XenForo_Application::getCache()) {
         if ($cacheCss = $cacheObject->load($cacheId, true)) {
             return $cacheCss . "\n/* CSS returned from cache. */";
         }
     }
     $this->_prepareForOutput();
     if (XenForo_Application::isRegistered('bbCode')) {
         $bbCodeCache = XenForo_Application::get('bbCode');
     } else {
         $bbCodeCache = XenForo_Model::create('XenForo_Model_BbCode')->getBbCodeCache();
     }
     $params = array('displayStyles' => $this->_displayStyles, 'smilieSprites' => $this->_smilieSprites, 'customBbCodes' => !empty($bbCodeCache['bbCodes']) ? $bbCodeCache['bbCodes'] : array(), 'xenOptions' => XenForo_Application::get('options')->getOptions(), 'dir' => $this->_textDirection, 'pageIsRtl' => $this->_textDirection == 'RTL');
     $templates = array();
     foreach ($this->_cssRequested as $cssName) {
         $cssName = trim($cssName);
         if (!$cssName) {
             continue;
         }
         $templateName = $cssName . '.css';
         if (!isset($templates[$templateName])) {
             $templates[$templateName] = new XenForo_Template_Public($templateName, $params);
         }
     }
     $css = self::renderCssFromObjects($templates, XenForo_Application::debugMode());
     $css = self::prepareCssForOutput($css, $this->_textDirection, XenForo_Application::get('options')->minifyCss && $cacheObject);
     if ($cacheObject) {
         $cacheObject->save($css, $cacheId, array(), 86400);
     }
     return $css;
 }
开发者ID:jackton,项目名称:XenForo-RedisCache,代码行数:34,代码来源:CssOutput.php

示例12: renderContainer

 /**
  * Renders the container.
  * @see XenForo_ViewRenderer_Abstract::renderContainer()
  *
  * @param string
  * @param array
  *
  * @return string
  */
 public function renderContainer($contents, array $params = array())
 {
     $params['contentTemplate'] = $this->_contentTemplate;
     $params['debugMode'] = XenForo_Application::debugMode();
     $params['serverTimeInfo'] = XenForo_Locale::getDayStartTimestamps();
     if (!empty($params['extraTabs'])) {
         foreach ($params['extraTabs'] as &$group) {
             foreach ($group as &$extraTab) {
                 if (!empty($extraTab['linksTemplate'])) {
                     $extraTab['linksTemplate'] = $this->createTemplateObject($extraTab['linksTemplate'], $extraTab + $params);
                 }
             }
         }
     }
     $templateName = !empty($params['containerTemplate']) ? $params['containerTemplate'] : 'PAGE_CONTAINER';
     $template = $this->createTemplateObject($templateName, $params);
     if ($contents instanceof XenForo_Template_Abstract) {
         $contents = $contents->render();
     }
     $containerData = $this->_dependencies->getExtraContainerData();
     $containerData['notices'] = $this->_getNoticesContainerParams($template, $containerData);
     $template->setParams($containerData);
     $template->setParam('contents', $contents);
     $template->setParam('noH1', isset($containerData['h1']) && $containerData['h1'] === '');
     if ($params['debugMode']) {
         $template->setParams(XenForo_Debug::getDebugTemplateParams());
     }
     $rendered = $template->render();
     $rendered = $this->replaceRequiredExternalPlaceholders($template, $rendered);
     $language = XenForo_Visitor::getInstance()->getLanguage();
     if (isset($language['text_direction']) && $language['text_direction'] == 'RTL') {
         $rendered = XenForo_Template_Helper_RightToLeft::replaceRtlEntities($rendered);
     }
     return $rendered;
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:44,代码来源:HtmlPublic.php

示例13: renderRaw

 public function renderRaw()
 {
     $attachment = $this->_params['attachment'];
     if (!headers_sent() && function_exists('header_remove')) {
         header_remove('Expires');
         header('Cache-control: private');
     }
     $extension = XenForo_Helper_File::getFileExtension($attachment['filename']);
     $imageTypes = array('svg' => 'image/svg+xml', 'gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'png' => 'image/png');
     if (isset($imageTypes[$extension]) && ($attachment['width'] && $attachment['height'])) {
         $this->_response->setHeader('Content-type', $imageTypes[$extension], true);
         $this->setDownloadFileName($attachment['filename'], true);
     } else {
         $this->_response->setHeader('Content-type', 'application/octet-stream', true);
         $this->setDownloadFileName($attachment['filename']);
     }
     $this->_response->setHeader('ETag', '"' . $attachment['attach_date'] . '"', true);
     $this->_response->setHeader('Content-Length', $attachment['file_size'], true);
     $this->_response->setHeader('X-Content-Type-Options', 'nosniff');
     $attachmentFile = $this->_params['attachmentFile'];
     $options = XenForo_Application::getOptions();
     if ($options->SV_AttachImpro_XAR) {
         if (SV_AttachmentImprovements_AttachmentHelper::ConvertFilename($attachmentFile)) {
             if (XenForo_Application::debugMode() && $options->SV_AttachImpro_log) {
                 XenForo_Error::debug('X-Accel-Redirect:' . $attachmentFile);
             }
             $this->_response->setHeader('X-Accel-Redirect', $attachmentFile);
             return '';
         }
         if (XenForo_Application::debugMode() && $options->SV_AttachImpro_log) {
             XenForo_Error::debug('X-Accel-Redirect skipped');
         }
     }
     return new XenForo_FileOutput($attachmentFile);
 }
开发者ID:Xon,项目名称:XenForo-AttachmentImprovements,代码行数:35,代码来源:View.php

示例14: get

 public static function get($key)
 {
     $options = XenForo_Application::get('options');
     static $keyPrefix = 'Tinhte_XenTag_';
     static $availablePositions = array('post_below', 'post_message_below', 'post_message_above', 'post_date_after', 'post_permalink_after', 'thread_pagenav_above', 'thread_messages_above', 'thread_qr_above', 'thread_qr_below');
     static $availableAutoTagModes = array(self::AUTO_TAG_MODE_THREAD_TAGS, self::AUTO_TAG_MODE_THREAD_TAGS_FIRST_POST_ONLY, self::AUTO_TAG_MODE_ALL_TAGS, self::AUTO_TAG_MODE_DISALBED);
     switch ($key) {
         case 'cloudLevelCount':
             return 3;
         case 'majorSection':
             return 'forums';
         case 'searchForceUseCache':
             return !XenForo_Application::debugMode();
         case 'displayPosition':
             $position = $options->get($keyPrefix . $key);
             if (!in_array($position, $availablePositions)) {
                 $position = $availablePositions[0];
             }
             return $position;
         case 'autoTagMode':
             $mode = $options->get($keyPrefix . $key);
             if (!in_array($mode, $availableAutoTagModes)) {
                 $mode = self::AUTO_TAG_MODE_THREAD_TAGS_FIRST_POST_ONLY;
             }
             return $mode;
         case 'latestTaggedContentsLimit':
             return 10;
     }
     return $options->get($keyPrefix . $key);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:30,代码来源:Option.php

示例15: validateRequest

 /**
  * Validates the callback request is valid. If failure happens, the response should
  * tell the processor to retry.
  *
  * @param string $errorString Output error string
  *
  * @return boolean
  */
 public function validateRequest(&$errorString)
 {
     try {
         if ($this->_filtered['test_ipn'] && XenForo_Application::debugMode()) {
             $validator = XenForo_Helper_Http::getClient('http://www.sandbox.paypal.com/cgi-bin/webscr');
         } else {
             $validator = XenForo_Helper_Http::getClient('http://www.paypal.com/cgi-bin/webscr');
         }
         $validator->setParameterPost('cmd', '_notify-validate');
         $validator->setParameterPost($_POST);
         $validatorResponse = $validator->request('POST');
         if (!$validatorResponse || $validatorResponse->getBody() != 'VERIFIED' || $validatorResponse->getStatus() != 200) {
             $errorString = 'Request not validated';
             return false;
         }
     } catch (Zend_Http_Client_Exception $e) {
         $errorString = 'Connection to PayPal failed';
         return false;
     }
     if (strtolower($this->_filtered['business']) != strtolower(XenForo_Application::get('options')->payPalPrimaryAccount)) {
         $errorString = 'Invalid business';
         return false;
     }
     return true;
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:33,代码来源:PayPal.php


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