• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JProfiler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: run

 /**
  * Execute the task
  *
  * @param   array $taskData Task data
  *
  * @return bool True on success, false otherwise
  */
 public function run($taskData)
 {
     $languages = NenoHelper::getLanguages();
     $defaultLanguage = NenoSettings::get('source_language');
     $profiler = new JProfiler();
     foreach ($languages as $language) {
         if ($language->lang_code !== $defaultLanguage) {
             $profiler->mark('Before create job' . $language->lang_code . ' Method: Machine');
             $machineJob = NenoJob::createJob($language->lang_code, NenoContentElementTranslation::MACHINE_TRANSLATION_METHOD);
             $profiler->mark('After create job' . $language->lang_code . ' Method: Machine');
             // If there are translations for this language and for this translation method
             if ($machineJob !== null) {
                 NenoLog::add(count($machineJob->getTranslations()) . ' translations have been found to translate through machine translation');
             }
             $proJob = NenoJob::createJob($language->lang_code, NenoContentElementTranslation::PROFESSIONAL_TRANSLATION_METHOD);
             // If there are translations for this language and for this translation method
             if ($proJob !== null) {
                 NenoLog::add(count($proJob->getTranslations()) . ' translations have been found to translate through professional translation');
             }
             if ($machineJob !== null || $proJob !== null) {
                 NenoTaskMonitor::addTask('job_sender');
             }
         }
     }
 }
开发者ID:andresmaeso,项目名称:neno,代码行数:32,代码来源:scanner.php


示例2: _doCheck

 public static function _doCheck()
 {
     jimport('joomla.error.profiler');
     // creating the profiler object will start the counter
     $profiler = JProfiler::getInstance('sh404sef_analytics_profiler');
     // if not set to auto check and not forced to do so
     // when user click on "check updates" button
     // we don't actually try to get updates info
     $sefConfig =& Sh404sefFactory::getConfig();
     // check if allowed to auto check, w/o user clicking on button
     if (!$sefConfig->autoCheckNewAnalytics && !self::$_options['forced']) {
         // prepare a default response object
         $response = new stdClass();
         $response->status = true;
         $response->statusMessage = JText::_('COM_SH404SEF_CLICK_TO_CHECK_ANALYTICS');
         $response->note = '';
         return $response;
     }
     // calculate adapted class name
     $className = 'Sh404sefAdapterAnalytics' . strtolower($sefConfig->analyticsType);
     $handler = new $className();
     // ask specialized class to fetch analytics data
     $response = $handler->fetchAnalytics($sefConfig, self::$_options);
     // done; send response back
     return $response;
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:26,代码来源:analytics.php


示例3: retrieve

 /**
  * Retrieve the storage content.
  *
  * @param   string  $lang       E.g. de-DE, es-ES etc.
  * @param   string  $extension  E.g. joomla, com_weblinks, com_easycreator etc.
  * @param   string  $domain     Must be 'admin' or 'site'.
  *
  * @throws G11nException
  * @return \g11n\Support\Store
  */
 public function retrieve($lang, $extension, $domain = '')
 {
     if (self::$storage == 'off') {
         return false;
     }
     $profiler = JProfiler::getInstance('LangDebug');
     $profiler->mark('start: ' . $extension);
     $this->query->clear('where');
     $this->query->where('extension = ' . $this->db->quote($extension));
     $this->query->where('lang = ' . $this->db->quote($lang));
     $this->query->where('scope = ' . $this->db->quote($this->scope));
     $this->db->setQuery($this->query);
     $e = $this->db->loadObject();
     if (empty($e->strings)) {
         $profiler->mark('<span style="color: red;">langload db failed ****</span>' . $this->query);
         $this->setError($this->db->getError());
         return false;
     }
     $strings = json_decode($e->strings, true);
     $profiler->mark('<span style="color: green;">*Loaded db*</span>');
     $this->strings = array_merge($this->strings, $strings);
     // Language overrides
     $this->strings = array_merge($this->strings, $this->override);
     $this->paths[$extension][$fileName] = true;
     return true;
 }
开发者ID:elkuku,项目名称:g11n,代码行数:36,代码来源:Mysql.php


示例4: plgSh404sefAnalyticsCustomVars

function plgSh404sefAnalyticsCustomVars(&$customVars, $sefConfig)
{
    // add custom variable : page creation time
    if ($sefConfig->analyticsEnableTimeCollection) {
        $profiler =& JProfiler::getInstance('sh404sef_profiler');
        $profiler->mark('');
        $pageCreationTime = $profiler->getBuffer();
        //extract Data
        $pageCreationTime = str_replace('sh404sef_profiler : ', '', $pageCreationTime[0]);
        $tmp = explode(', ', $pageCreationTime);
        // we may have memory report attached
        $time = str_replace(' seconds', '', $tmp[0]);
        // classify exact time into predefined categories for encoding
        $time = Sh404sefHelperAnalytics::classifyTime($time);
        // same for memory used
        $memory = empty($tmp[1]) ? 0 : sh404sefHelperAnalytics::classifyMemory(str_replace(' MB', '', trim($tmp[1])));
        // store results into incoming array
        $customVars[SH404SEF_ANALYTICS_TIME_CUSTOM_VAR]->name = 'Page creation time and ram';
        $customVars[SH404SEF_ANALYTICS_TIME_CUSTOM_VAR]->value = ($time << 4) + $memory;
    }
    // add custom variable : user logged in
    if ($sefConfig->analyticsEnableUserCollection) {
        $user = JFactory::getUser();
        $customVars[SH404SEF_ANALYTICS_USER_CUSTOM_VAR]->name = 'Logged-in user';
        $userType = empty($user->usertype) ? 'anonymous' : $user->usertype;
        $customVars[SH404SEF_ANALYTICS_USER_CUSTOM_VAR]->value = htmlentities($userType, ENT_QUOTES, 'UTF-8');
    }
    return true;
}
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:29,代码来源:sh404sefanalytics.php


示例5: templates

 /**
  * Display the template list.
  *
  * @return void
  */
 private function templates()
 {
     $input = JFactory::getApplication()->input;
     $profiling = false;
     if ($profiling) {
         //            jimport('joomla.error.profiler');
         $this->profiler = JProfiler::getInstance('EasyCreator');
     }
     $this->task = $input->get('task');
     $this->ecr_project = $input->get('ecr_project');
     $this->path = ECRPATH_EXTENSIONTEMPLATES;
     $this->file_path = $input->getPath('file_path');
     $this->file_name = $input->getPath('file_name');
     $this->com_type = $input->get('com_type');
     $this->template = $input->get('template');
     $this->comTypes = EcrProjectHelper::getProjectTypes();
     $cache = JFactory::getCache();
     $cache->setCaching(1);
     if ($profiling) {
         $this->profiler->mark('start get templates');
     }
     $this->templates = EcrProjectTemplateHelper::getTemplateList();
     if ($profiling) {
         $this->profiler->mark('end get cached templates');
     }
     if ($profiling) {
         echo '<pre>' . print_r($this->profiler->getBuffer(), true) . '</pre>';
     }
     $this->setLayout('templates');
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:35,代码来源:view.html.php


示例6: __construct

 public function __construct($context)
 {
     $this->context = $context;
     if (JvrelInit::getCfg('debug')) {
         $this->profiler = JProfiler::getInstance('Application');
     }
     $this->eopsob = new JvrelativesEopsob();
 }
开发者ID:site4com,项目名称:prometheus,代码行数:8,代码来源:class.plugin.php


示例7: postflight

 /**
  * Called after any type of action
  *
  * @param     string              $route      Which action is happening (install|uninstall|discover_install)
  * @param     jadapterinstance    $adapter    The object responsible for running this script
  *
  * @return    boolean                         True on success
  */
 public function postflight($route, JAdapterInstance $adapter)
 {
     if (JDEBUG) {
         JProfiler::getInstance('Application')->mark('after' . ucfirst($route) . 'Projectfork');
         $buffer = JProfiler::getInstance('Application')->getBuffer();
         $app = JFactory::getApplication();
         foreach ($buffer as $mark) {
             $app->enqueueMessage($mark, 'debug');
         }
     }
     return true;
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:20,代码来源:pkg_projectfork.script.php


示例8: __destruct

 /**
  * Adds application response time and memory usage to Chrome Inspector with ChromeLogger extension
  *
  * See: https://chrome.google.com/webstore/detail/chrome-logger/noaneddfkdjfnfdakjjmocngnfkfehhd
  */
 public function __destruct()
 {
     if (JDEBUG && !headers_sent()) {
         $buffer = JProfiler::getInstance('Application')->getBuffer();
         if ($buffer) {
             $data = strip_tags(end($buffer));
             $row = array(array($data), null, 'info');
             $header = array('version' => '4.1.0', 'columns' => array('log', 'backtrace', 'type'), 'rows' => array($row));
             header('X-ChromeLogger-Data: ' . base64_encode(utf8_encode(json_encode($header))));
         }
     }
 }
开发者ID:daodaoliang,项目名称:nooku-framework,代码行数:17,代码来源:koowa.php


示例9: getApplication

 /**
  * Returns a Joomla application with a root user logged in
  *
  * @param string $base Base path for the Joomla installation
  * @param int    $client_id Application client id to spoof. Defaults to admin.
  *
  * @return Application
  */
 public static function getApplication($base, $client_id = self::ADMIN)
 {
     $_SERVER['SERVER_PORT'] = 80;
     if (!self::$_application) {
         self::bootstrap($base);
         $options = array('root_user' => 'root', 'client_id' => $client_id);
         self::$_application = new Application($options);
         $credentials = array('name' => 'root', 'username' => 'root', 'groups' => array(8), 'email' => '[email protected]');
         self::$_application->authenticate($credentials);
         // If there are no marks in JProfiler debug plugin performs a division by zero using count($marks)
         \JProfiler::getInstance('Application')->mark('Hello world');
     }
     return self::$_application;
 }
开发者ID:eitamar,项目名称:joomlatools-console,代码行数:22,代码来源:Bootstrapper.php


示例10: store

 /**
  * Stores the strings into a storage.
  *
  * @param   string  $lang       E.g. de-DE, es-ES etc.
  * @param   string  $extension  E.g. joomla, com_weblinks, com_easycreator etc.
  * @param   string  $domain     Must be 'admin' or 'site'.
  *
  * @throws G11nException
  * @return boolean
  */
 public function store($lang, $extension, $domain = '')
 {
     if (self::$storage == 'off') {
         return false;
     }
     $profiler = JProfiler::getInstance('LangDebug');
     $profiler->mark('store: ' . $extension);
     //        #		$fileNames = JFolder::files(JPATH_ADMINISTRATOR, '.sys.ini', false, true);
     $strings = self::parseFile($fileName);
     $path = self::$cacheDir . '/' . $lang . '.' . $extension . '.txt';
     $jsonString = json_encode($strings);
     if (!JFile::write($path, $jsonString)) {
         throw new G11nException('Unable to write language storage file');
     }
     $profiler->mark('<span style="color: blue;">wrote file</span>: ' . str_replace(JPATH_ROOT, 'J', $path));
     $profiler->mark('store SUCCESS ++++: ' . $extension);
     return true;
 }
开发者ID:elkuku,项目名称:g11n,代码行数:28,代码来源:Txt.php


示例11: getApplication

 /**
  * Returns a Joomla application with a root user logged in
  *
  * @param string $base Base path for the Joomla installation
  * @return Application
  */
 public static function getApplication($base)
 {
     $_SERVER['SERVER_PORT'] = 80;
     if (!defined('_JEXEC')) {
         $_SERVER['HTTP_HOST'] = 'localhost';
         $_SERVER['HTTP_USER_AGENT'] = 'joomla-cli/1.0.0';
         define('_JEXEC', 1);
         define('DS', DIRECTORY_SEPARATOR);
         define('JPATH_BASE', realpath($base));
         require_once JPATH_BASE . '/includes/defines.php';
         require_once JPATH_BASE . '/includes/framework.php';
         require_once JPATH_LIBRARIES . '/import.php';
         require_once JPATH_LIBRARIES . '/cms.php';
     }
     $credentials = array('name' => 'root', 'username' => 'root', 'groups' => array(8), 'email' => '[email protected]');
     $application = new Application(array('root_user' => 'root'));
     $application->authenticate($credentials);
     // If there are no marks in JProfiler debug plugin performs a division by zero using count($marks)
     \JProfiler::getInstance('Application')->mark('Hello world');
     return $application;
 }
开发者ID:mvanduijker,项目名称:joomla-cli,代码行数:27,代码来源:Bootstrapper.php


示例12: onAfterInitialise

 /**
  * Converting the site URL to fit to the HTTP request.
  *
  * @return  void
  *
  * @since   1.5
  */
 public function onAfterInitialise()
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     if ($app->isAdmin()) {
         return;
     }
     if (count($app->getMessageQueue())) {
         return;
     }
     if ($user->get('guest') && $app->input->getMethod() == 'GET') {
         $this->_cache->setCaching(true);
     }
     $data = $this->_cache->get($this->_cache_key);
     if ($data !== false) {
         // Set cached body.
         $app->setBody($data);
         echo $app->toString();
         if (JDEBUG) {
             JProfiler::getInstance('Application')->mark('afterCache');
         }
         $app->close();
     }
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:31,代码来源:cache.php


示例13: array

} else {
    $_view = 'others';
}
$show_in_views = $params->get('show_in_views', array());
$show_in_views = !is_array($show_in_views) ? array($show_in_views) : $show_in_views;
$views_show_mod = !count($show_in_views) || in_array($_view, $show_in_views);
if ($params->get('enable_php_rule', 0)) {
    $php_show_mod = eval($params->get('php_rule'));
    $show_mod = $params->get('combine_show_rules', 'AND') == 'AND' ? $views_show_mod && $php_show_mod : $views_show_mod || $php_show_mod;
} else {
    $show_mod = $views_show_mod;
}
if ($show_mod) {
    global $modfc_jprof;
    jimport('joomla.error.profiler');
    $modfc_jprof = new JProfiler();
    $modfc_jprof->mark('START: FLEXIcontent Filter-Search Module');
    // load english language file for 'mod_flexifilter' module then override with current language file
    JFactory::getLanguage()->load('mod_flexifilter', JPATH_SITE, 'en-GB', true);
    JFactory::getLanguage()->load('mod_flexifilter', JPATH_SITE, null, true);
    // initialize various variables
    $document = JFactory::getDocument();
    $caching = $app->getCfg('caching', 0);
    // include the helper only once
    require_once dirname(__FILE__) . DS . 'helper.php';
    // Other parameters
    $moduleclass_sfx = $params->get('moduleclass_sfx', '');
    $layout = $params->get('layout', 'default');
    $add_ccs = $params->get('add_ccs', 1);
    $add_tooltips = $params->get('add_tooltips', 1);
    $autosubmit = $params->get('filter_autosubmit', 0);
开发者ID:noxidsoft,项目名称:flexicontent-cck,代码行数:31,代码来源:mod_flexifilter.php


示例14: process

 /**
  * Process the form
  * Inline edit save routed here (not in raw)
  *
  * @return  null
  */
 public function process()
 {
     $profiler = JProfiler::getInstance('Application');
     JDEBUG ? $profiler->mark('controller process: start') : null;
     $app = JFactory::getApplication();
     $package = $app->getUserState('com_fabrik.package', 'fabrik');
     $input = $app->input;
     if ($input->get('format', '') == 'raw') {
         error_reporting(error_reporting() ^ (E_WARNING | E_NOTICE));
     }
     $viewName = $input->get('view', 'form');
     $view = $this->getView($viewName, JFactory::getDocument()->getType());
     if ($model = $this->getModel('form', 'FabrikFEModel')) {
         $view->setModel($model, true);
     }
     $model->setId($input->getInt('formid', 0));
     $model->packageId = $input->getInt('packageId');
     $this->isMambot = $input->get('isMambot', 0);
     $form = $model->getForm();
     $model->rowId = $input->get('rowid', '', 'string');
     /**
      * $$$ hugh - need this in plugin manager to be able to treat a "Copy" form submission
      * as 'new' for purposes of running plugins.  Rob's comment in model process() seems to
      * indicate that origRowId was for this purposes, but it doesn't work, 'cos always has a value.
      */
     if ($input->get('Copy', 'no') !== 'no') {
         $model->copyingRow(true);
     }
     // Check for request forgeries
     if ($model->spoofCheck()) {
         JSession::checkToken() or die('Invalid Token');
     }
     JDEBUG ? $profiler->mark('controller process validate: start') : null;
     if (!$model->validate()) {
         $this->handleError($view, $model);
         return;
     }
     JDEBUG ? $profiler->mark('controller process validate: end') : null;
     // Reset errors as validate() now returns ok validations as empty arrays
     $model->clearErrors();
     try {
         $model->process();
     } catch (Exception $e) {
         $model->errors['process_error'] = true;
         JError::raiseWarning(500, $e->getMessage());
     }
     if ($input->getInt('elid', 0) !== 0) {
         // Inline edit show the edited element - ignores validations for now
         $inlineModel = $this->getModel('forminlineedit', 'FabrikFEModel');
         $inlineModel->setFormModel($model);
         echo $inlineModel->showResults();
         return;
     }
     // Check if any plugin has created a new validation error
     if ($model->hasErrors()) {
         FabrikWorker::getPluginManager()->runPlugins('onError', $model);
         $this->handleError($view, $model);
         return;
     }
     /**
      * If debug submit is requested (&fabrikdebug=2, and J! debug on, and Fabrik debug allowed),
      * bypass any and all redirects, so we can see the profile for the submit
      */
     if (FabrikHelperHTML::isDebugSubmit()) {
         return;
     }
     $listModel = $model->getListModel();
     $listModel->set('_table', null);
     $url = $this->getRedirectURL($model);
     $msg = $this->getRedirectMessage($model);
     // @todo -should get handed off to the json view to do this
     if ($input->getInt('fabrik_ajax') == 1) {
         // $$$ hugh - adding some options for what to do with redirect when in content plugin
         // Should probably do this elsewhere, but for now ...
         $redirect_opts = array('msg' => $msg, 'url' => $url, 'baseRedirect' => $this->baseRedirect, 'rowid' => $input->get('rowid', '', 'string'), 'suppressMsg' => !$model->showSuccessMsg());
         if (!$this->baseRedirect && $this->isMambot) {
             $session = JFactory::getSession();
             $context = $model->getRedirectContext();
             $redirect_opts['redirect_how'] = $session->get($context . 'redirect_content_how', 'popup');
             $redirect_opts['width'] = (int) $session->get($context . 'redirect_content_popup_width', '300');
             $redirect_opts['height'] = (int) $session->get($context . 'redirect_content_popup_height', '300');
             $redirect_opts['x_offset'] = (int) $session->get($context . 'redirect_content_popup_x_offset', '0');
             $redirect_opts['y_offset'] = (int) $session->get($context . 'redirect_content_popup_y_offset', '0');
             $redirect_opts['title'] = $session->get($context . 'redirect_content_popup_title', '');
             $redirect_opts['reset_form'] = $session->get($context . 'redirect_content_reset_form', '1') == '1';
         } elseif (!$this->baseRedirect && !$this->isMambot) {
             /**
              * $$$ hugh - I think this case only happens when we're a popup form from a list
              * in which case I don't think "popup" is realy a valid option.  Anyway, need to set something,
              * so for now just do the same as we do for isMambot, but default redirect_how to 'samepage'
              */
             $session = JFactory::getSession();
             $context = $model->getRedirectContext();
             $redirect_opts['redirect_how'] = $session->get($context . 'redirect_content_how', 'samepage');
//.........这里部分代码省略.........
开发者ID:ankaau,项目名称:GathBandhan,代码行数:101,代码来源:form.php


示例15: displayQueries


//.........这里部分代码省略.........
                 $title = '<span class="dbg-noprofile">' . $title . '</span>';
             }
             $htmlProfile = $info[$id]->profile ? $info[$id]->profile : JText::_('PLG_DEBUG_NO_PROFILE');
             // Backtrace and call stack.
             $htmlCallStack = '';
             if (isset($callStacks[$id])) {
                 $htmlCallStackElements = array();
                 foreach ($callStacks[$id] as $functionCall) {
                     if (isset($functionCall['file']) && isset($functionCall['line']) && strpos($functionCall['file'], '/libraries/joomla/database/') === false) {
                         $htmlFile = htmlspecialchars($functionCall['file']);
                         $htmlLine = htmlspecialchars($functionCall['line']);
                         $htmlCallStackElements[] = '<span class="dbg-log-called-from">' . $this->formatLink($htmlFile, $htmlLine) . '</span>';
                     }
                 }
                 $htmlCallStack = '<div class="dbg-query-table"><div>' . implode('</div><div>', $htmlCallStackElements) . '</div></div>';
                 if (!$this->linkFormat) {
                     $htmlCallStack .= '<div>[<a href="http://xdebug.org/docs/all_settings#file_link_format" target="_blank">';
                     $htmlCallStack .= JText::_('PLG_DEBUG_LINK_FORMAT') . '</a>]</div>';
                 }
             }
             $htmlAccordions = JHtml::_('bootstrap.startAccordion', 'dbg_query_' . $id, array('active' => $info[$id]->hasWarnings ? 'dbg_query_explain_' . $id : ''));
             $htmlAccordions .= JHtml::_('bootstrap.addSlide', 'dbg_query_' . $id, JText::_('PLG_DEBUG_EXPLAIN'), 'dbg_query_explain_' . $id) . $info[$id]->explain . JHtml::_('bootstrap.endSlide');
             $htmlAccordions .= JHtml::_('bootstrap.addSlide', 'dbg_query_' . $id, $title, 'dbg_query_profile_' . $id) . $htmlProfile . JHtml::_('bootstrap.endSlide');
             if ($htmlCallStack) {
                 $htmlAccordions .= JHtml::_('bootstrap.addSlide', 'dbg_query_' . $id, JText::_('PLG_DEBUG_CALL_STACK'), 'dbg_query_callstack_' . $id) . $htmlCallStack . JHtml::_('bootstrap.endSlide');
             }
             $htmlAccordions .= JHtml::_('bootstrap.endAccordion');
             $did = md5($query);
             if (isset($duplicates[$did])) {
                 $dups = array();
                 foreach ($duplicates[$did] as $dup) {
                     if ($dup != $id) {
                         $dups[] = '<a href="#dbg-query-' . ($dup + 1) . '">#' . ($dup + 1) . '</a>';
                     }
                 }
                 $htmlQuery = '<div class="alert alert-error">' . JText::_('PLG_DEBUG_QUERY_DUPLICATES') . ': ' . implode('&nbsp; ', $dups) . '</div>' . '<pre class="alert hasTooltip" title="' . JHtml::tooltipText('PLG_DEBUG_QUERY_DUPLICATES_FOUND') . '">' . $text . '</pre>';
             } else {
                 $htmlQuery = '<pre>' . $text . '</pre>';
             }
             $list[] = '<a name="dbg-query-' . ($id + 1) . '"></a>' . $htmlTiming . $htmlBar . $htmlQuery . $htmlAccordions;
         } else {
             $list[] = '<pre>' . $text . '</pre>';
         }
     }
     $totalTime = 0;
     foreach (JProfiler::getInstance('Application')->getMarks() as $mark) {
         $totalTime += $mark->time;
     }
     if ($totalQueryTime > $totalTime * 0.25) {
         $labelClass = 'label-important';
     } elseif ($totalQueryTime < $totalTime * 0.15) {
         $labelClass = 'label-success';
     } else {
         $labelClass = 'label-warning';
     }
     if ($this->totalQueries == 0) {
         $this->totalQueries = $db->getCount();
     }
     $html = array();
     $html[] = '<h4>' . JText::sprintf('PLG_DEBUG_QUERIES_LOGGED', $this->totalQueries) . sprintf(' <span class="label ' . $labelClass . '">%.1f&nbsp;ms</span>', $totalQueryTime) . '</h4><br />';
     if ($total_duplicates) {
         $html[] = '<div class="alert alert-error">' . '<h4>' . JText::sprintf('PLG_DEBUG_QUERY_DUPLICATES_TOTAL_NUMBER', $total_duplicates) . '</h4>';
         foreach ($duplicates as $dups) {
             $links = array();
             foreach ($dups as $dup) {
                 $links[] = '<a href="#dbg-query-' . ($dup + 1) . '">#' . ($dup + 1) . '</a>';
             }
             $html[] = '<div>' . JText::sprintf('PLG_DEBUG_QUERY_DUPLICATES_NUMBER', count($links)) . ': ' . implode('&nbsp; ', $links) . '</div>';
         }
         $html[] = '</div>';
     }
     $html[] = '<ol><li>' . implode('<hr /></li><li>', $list) . '<hr /></li></ol>';
     if (!$this->params->get('query_types', 1)) {
         return implode('', $html);
     }
     // Get the totals for the query types.
     $totalSelectQueryTypes = count($selectQueryTypeTicker);
     $totalOtherQueryTypes = count($otherQueryTypeTicker);
     $totalQueryTypes = $totalSelectQueryTypes + $totalOtherQueryTypes;
     $html[] = '<h4>' . JText::sprintf('PLG_DEBUG_QUERY_TYPES_LOGGED', $totalQueryTypes) . '</h4>';
     if ($totalSelectQueryTypes) {
         $html[] = '<h5>' . JText::_('PLG_DEBUG_SELECT_QUERIES') . '</h5>';
         arsort($selectQueryTypeTicker);
         $list = array();
         foreach ($selectQueryTypeTicker as $query => $occurrences) {
             $list[] = '<pre>' . JText::sprintf('PLG_DEBUG_QUERY_TYPE_AND_OCCURRENCES', $this->highlightQuery($query), $occurrences) . '</pre>';
         }
         $html[] = '<ol><li>' . implode('</li><li>', $list) . '</li></ol>';
     }
     if ($totalOtherQueryTypes) {
         $html[] = '<h5>' . JText::_('PLG_DEBUG_OTHER_QUERIES') . '</h5>';
         arsort($otherQueryTypeTicker);
         $list = array();
         foreach ($otherQueryTypeTicker as $query => $occurrences) {
             $list[] = '<pre>' . JText::sprintf('PLG_DEBUG_QUERY_TYPE_AND_OCCURRENCES', $this->highlightQuery($query), $occurrences) . '</pre>';
         }
         $html[] = '<ol><li>' . implode('</li><li>', $list) . '</li></ol>';
     }
     return implode('', $html);
 }
开发者ID:deenison,项目名称:joomla-cms,代码行数:101,代码来源:debug.php


示例16: array

} else {
    $_view = 'others';
}
$show_in_views = $params->get('show_in_views', array());
$show_in_views = !is_array($show_in_views) ? array($show_in_views) : $show_in_views;
$views_show_mod = !count($show_in_views) || in_array($_view, $show_in_views);
if ($params->get('enable_php_rule', 0)) {
    $php_show_mod = eval($params->get('php_rule'));
    $show_mod = $params->get('combine_show_rules', 'AND') == 'AND' ? $views_show_mod && $php_show_mod : $views_show_mod || $php_show_mod;
} else {
    $show_mod = $views_show_mod;
}
if ($show_mod) {
    global $modfc_jprof;
    jimport('joomla.error.profiler');
    $modfc_jprof = new JProfiler();
    $modfc_jprof->mark('START: FLEXIcontent Module');
    global $mod_fc_run_times;
    $mod_fc_run_times = array();
    // Logging Info variables
    global $fc_content_plg_microtime;
    $fc_content_plg_microtime = 0;
    // load english language file for 'mod_flexicontent' module then override with current language file
    JFactory::getLanguage()->load('mod_flexicontent', JPATH_SITE, 'en-GB', true);
    JFactory::getLanguage()->load('mod_flexicontent', JPATH_SITE, null, true);
    // initialize various variables
    global $globalcats;
    $document = JFactory::getDocument();
    $caching = $app->getCfg('caching', 0);
    // include the helper only once
    require_once dirname(__FILE__) . DS . 'helper.php';
开发者ID:jakesyl,项目名称:flexicontent,代码行数:31,代码来源:mod_flexicontent.php


示例17: renderModule

 /**
  * Render the module.
  *
  * @param   object  $module   A module object.
  * @param   array   $attribs  An array of attributes for the module (probably from the XML).
  *
  * @return  string  The HTML content of the module output.
  *
  * @since   11.1
  */
 public static function renderModule($module, $attribs = array())
 {
     static $chrome;
     if (constant('JDEBUG')) {
         JProfiler::getInstance('Application')->mark('beforeRenderModule ' . $module->module . ' (' . $module->title . ')');
     }
     $app = JFactory::getApplication();
     // Record the scope.
     $scope = $app->scope;
     // Set scope to component name
     $app->scope = $module->module;
     // Get module parameters
     $params = new JRegistry();
     $params->loadString($module->params);
     // Get module path
     $module->module = preg_replace('/[^A-Z0-9_\\.-]/i', '', $module->module);
     $path = JPATH_BASE . '/modules/' . $module->module . '/' . $module->module . '.php';
     // Load the module
     if (file_exists($path)) {
         $lang = JFactory::getLanguage();
         // 1.5 or Core then 1.6 3PD
         $lang->load($module->module, JPATH_BASE, null, false, false) || $lang->load($module->module, dirname($path), null, false, false) || $lang->load($module->module, JPATH_BASE, $lang->getDefault(), false, false) || $lang->load($module->module, dirname($path), $lang->getDefault(), false, false);
         $content = '';
         ob_start();
         include $path;
         $module->content = ob_get_contents() . $content;
         ob_end_clean();
     }
     // Load the module chrome functions
     if (!$chrome) {
         $chrome = array();
     }
     include_once JPATH_THEMES . '/system/html/modules.php';
     $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/modules.php';
     if (!isset($chrome[$chromePath])) {
         if (file_exists($chromePath)) {
             include_once $chromePath;
         }
         $chrome[$chromePath] = true;
     }
     // Make sure a style is set
     if (!isset($attribs['style'])) {
         $attribs['style'] = 'none';
     }
     // Dynamically add outline style
     if ($app->input->getBool('tp') && JComponentHelper::getParams('com_templates')->get('template_positions_display')) {
         $attribs['style'] .= ' outline';
     }
     foreach (explode(' ', $attribs['style']) as $style) {
         $chromeMethod = 'modChrome_' . $style;
         // Apply chrome and render module
         if (function_exists($chromeMethod)) {
             $module->style = $attribs['style'];
             ob_start();
             $chromeMethod($module, $params, $attribs);
             $module->content = ob_get_contents();
             ob_end_clean();
         }
     }
     // Revert the scope
     $app->scope = $scope;
     if (constant('JDEBUG')) {
         JProfiler::getInstance('Application')->mark('afterRenderModule ' . $module->module . ' (' . $module->title . ')');
     }
     return $module->content;
 }
开发者ID:rdiaztushman,项目名称:joomla-platform,代码行数:76,代码来源:helper.php


示例18: substr

             $ids .= (int) $items[$i]->pid . ',';
             $pks .= (int) $items[$i]->pk . ',';
         }
         $ids = substr($ids, 0, -1);
         $pks = substr($pks, 0, -1);
     }
     $config['ids'] = $ids;
     $config['pks'] = $pks;
 }
 // Pagination
 if ($limitstart != -1 && $limitend > 0 && !($preconfig['limit2'] > 0)) {
     $items = array_splice($items, $limitstart, $limitend);
 }
 // -------- -------- -------- -------- -------- -------- -------- -------- // Do List
 if ($doDebug) {
     $profiler = JProfiler::getInstance();
 }
 if ($preconfig['show_list']) {
     $config['infinite'] = $isInfinite;
     $target = 'search';
     if (isset($preconfig['search2']) && $preconfig['search2'] != '') {
         $target = 'search2';
         $search2 = CCK_List::getSearch($preconfig['search2'], $id);
         $search->content = $search2->content;
     }
     if ($total) {
         if (isset($preconfig['idx'])) {
             $config['idx'] = $preconfig['idx'];
             if (!isset($app->cck_idx)) {
                 $app->cck_idx = array();
             }
开发者ID:kenyonjohnston,项目名称:hott_theater,代码行数:31,代码来源:list_inc.php


示例19: define

/**
 * NOTE: This file should remain compatible with PHP 5.2 to allow us to run our PHP minimum check and show a friendly error message
 */
/**
 * Define the application's minimum supported PHP version as a constant so it can be referenced within the application.
 */
define('JOOMLA_MINIMUM_PHP', '5.5.9');
if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) {
    die('Your host needs to use PHP ' . JOOMLA_MINIMUM_PHP . ' or higher to run this version of Joomla!');
}
// Saves the start time and memory usage.
$startTime = microtime(1);
$startMem = memory_get_usage();
/**
 * Constant that is checked in included files to prevent direct access.
 */
define('_JEXEC', 1);
if (file_exists(__DIR__ . '/defines.php')) {
    include_once __DIR__ . '/defines.php';
}
if (!defined('_JDEFINES')) {
    define('JPATH_BASE', __DIR__);
    require_once JPATH_BASE . '/includes/defines.php';
}
require_once JPATH_BASE . '/includes/framework.php';
// Set profiler start time and memory usage and mark afterLoad in the profiler.
JDEBUG ? JProfiler::getInstance('Application')->setStart($startTime, $startMem)->mark('afterLoad') : null;
// Instantiate the application.
$app = JFactory::getApplication('administrator');
// Execute the application.
$app->execute();
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:31,代码来源:index.php


示例20: getState

 /**
  * Method to get the indexer state.
  *
  * @return  object  The indexer state object.
  *
  * @since   2.5
  */
 public static function getState()
 {
     // First, try to load from the internal state.
     if (!empty(self::$state)) {
         return self::$state;
     }
     // If we couldn't load from the internal state, try the session.
     $session = JFactory::getSession();
     $data = $session->get('_finder.state', null);
     // If the state is empty, load the values for the first time.
     if (empty($data)) {
         $data = new JObject();
         // Load the default configuration options.
         $data->options = JComponentHelper::getParams('com_finder');
         // Setup the weight lookup information.
         $data->weights = array(self::TITLE_CONTEXT => round($data->options->get('title_multiplier', 1.7), 2), self::TEXT_CONTEXT => round($data->options->get('text_multiplier', 0.7), 2), self::META_CONTEXT => round($data->options->get('meta_multiplier', 1.2), 2), self::PATH_CONTEXT => round($data->options->get('path_multiplier', 2.0), 2), self::MISC_CONTEXT => round($data->options->get('misc_multiplier', 0.3), 2));
         // Set the current time as the start time.
         $data->startTime = JFactory::getDate()->toSql();
         // Set the remaining default values.
         $data->batchSize = (int) $data->options->get('batch_size', 50);
         $data->batchOffset = 0;
         $data->totalItems = 0;
         $data->pluginState = array();
     }
     // Setup the profiler if debugging is enabled.
     if (JFactory::getApplication()->get('debug')) {
         self::$profiler = JProfiler::getInstance('FinderIndexer');
     }
     // Setup the stemmer.
     if ($data->options->get('stem', 1) && $data->options->get('stemmer', 'porter_en')) {
         FinderIndexerHelper::$stemmer = FinderIndexerStemmer::getInstance($data->options->get('stemmer', 'porter_en'));
     }
     // Set the state.
     self::$state = $data;
     return self::$state;
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:43,代码来源:indexer.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JROUTE类代码示例发布时间:2022-05-23
下一篇:
PHP JPluginHelper类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap