本文整理汇总了PHP中stopProfile函数的典型用法代码示例。如果您正苦于以下问题:PHP stopProfile函数的具体用法?PHP stopProfile怎么用?PHP stopProfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stopProfile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: smarty_function_oxmultilang
/**
* Smarty function
* -------------------------------------------------------------
* Purpose: Output multilang string
* add [{ oxmultilang ident="..." }] where you want to display content
* -------------------------------------------------------------
*
* @param array $params params
* @param Smarty &$smarty clever simulation of a method
*
* @return string
*/
function smarty_function_oxmultilang($params, &$smarty)
{
startProfile("smarty_function_oxmultilang");
$sIdent = isset($params['ident']) ? $params['ident'] : 'IDENT MISSING';
$iLang = null;
$blAdmin = isAdmin();
$oLang = oxLang::getInstance();
if ($blAdmin) {
$iLang = $oLang->getTplLanguage();
if (!isset($iLang)) {
$iLang = 0;
}
}
try {
$sTranslation = $oLang->translateString($sIdent, $iLang, $blAdmin);
} catch (oxLanguageException $oEx) {
// is thrown in debug mode and has to be caught here, as smarty hangs otherwise!
}
if ($blAdmin && $sTranslation == $sIdent && (!isset($params['noerror']) || !$params['noerror'])) {
$sTranslation = '<b>ERROR : Translation for ' . $sIdent . ' not found!</b>';
}
if ($sTranslation == $sIdent && isset($params['alternative'])) {
$sTranslation = $params['alternative'];
}
stopProfile("smarty_function_oxmultilang");
return $sTranslation;
}
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:39,代码来源:function.oxmultilang.php
示例2: _checkAuthorization
protected function _checkAuthorization()
{
startProfile('ChromePHP: ' . __CLASS__ . ' / ' . __FUNCTION__);
if ($this->_getAuthorization()->getAuthorization()) {
$this->_enableChrome();
}
stopProfile('ChromePHP: ' . __CLASS__ . ' / ' . __FUNCTION__);
}
开发者ID:OXIDprojects,项目名称:debugax,代码行数:8,代码来源:chromephp_oxshopcontrol.php
示例3: autoload
/**
* Includes file, where given class is described.
*
* @param string $class Class Name
*/
public function autoload($class)
{
startProfile("ShopAutoload");
$class = strtolower(basename($class));
if ($classPath = $this->getClassPath($class)) {
include $classPath;
}
stopProfile("ShopAutoload");
}
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:14,代码来源:ShopAutoload.php
示例4: buildActCatList
/**
* Fetches raw categories and does postprocessing for adding depth information.
*
* @param string $id
*/
public function buildActCatList($id)
{
$this->setActCat($id);
startProfile('buildCategoryList');
$this->_blForceFull = false;
$this->_blHideEmpty = false;
$sql = $this->_getSelectString(false);
$this->selectString($sql);
stopProfile('buildCategoryList');
}
开发者ID:jkrug,项目名称:OxidSyncModule,代码行数:15,代码来源:ongr_sync_oxcategorylist.php
示例5: _createArticleCategoryUri
/**
* Returns new seo url including the model no.
*
*
* @param oxArticle $oArticle article object
* @param oxCategory $oCategory category object
* @param int $iLang language to generate uri for
*
* @return string
*/
protected function _createArticleCategoryUri($oArticle, $oCategory, $iLang)
{
startProfile(__FUNCTION__);
$oArticle = $this->_getProductForLang($oArticle, $iLang);
// create title part for uri
$sTitle = $this->_prepareArticleTitle($oArticle);
$sTitle = str_replace($this->_getUrlExtension(), " " . $oArticle->oxarticles__oxartnum->value, $sTitle) . "." . $this->_getUrlExtension();
// writing category path
$sSeoUri = $this->_processSeoUrl($sTitle, $oArticle->getId(), $iLang);
$sCatId = $oCategory->getId();
$this->_saveToDb('oxarticle', $oArticle->getId(), oxUtilsUrl::getInstance()->appendUrl($oArticle->getBaseStdLink($iLang), array('cnid' => $sCatId)), $sSeoUri, $iLang, null, 0, $sCatId);
stopProfile(__FUNCTION__);
return $sSeoUri;
}
开发者ID:ecomstyle,项目名称:oxid-seourlwithmodel,代码行数:24,代码来源:seourlwithmodel.php
示例6: autoload
/**
* Tries to autoload given class. If class was not found in module files array,
* checks module extensions.
*
* @param string $class Class name.
*/
public function autoload($class)
{
startProfile("oxModuleAutoload");
$class = strtolower(basename($class));
if ($classPath = $this->getFilePath($class)) {
include $classPath;
} else {
$class = preg_replace('/_parent$/i', '', $class);
if (!in_array($class, $this->triedClasses)) {
$this->triedClasses[] = $class;
$this->createExtensionClassChain($class);
}
}
stopProfile("oxModuleAutoload");
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:21,代码来源:ModuleAutoload.php
示例7: smarty_function_oxmultilang
/**
* Smarty function
* -------------------------------------------------------------
* Purpose: Output multilang string
* add [{ oxmultilang ident="..." args=... }] where you want to display content
* ident - language constant
* args - array of argument that can be parsed to language constant threw %s
* -------------------------------------------------------------
*
* @param array $params params
* @param Smarty &$smarty clever simulation of a method
*
* @return string
*/
function smarty_function_oxmultilang($params, &$smarty)
{
startProfile("smarty_function_oxmultilang");
$oLang = oxRegistry::getLang();
$oConfig = oxRegistry::getConfig();
$oShop = $oConfig->getActiveShop();
$blAdmin = $oLang->isAdmin();
$sIdent = isset($params['ident']) ? $params['ident'] : 'IDENT MISSING';
$aArgs = isset($params['args']) ? $params['args'] : false;
$sSuffix = isset($params['suffix']) ? $params['suffix'] : 'NO_SUFFIX';
$blShowError = isset($params['noerror']) ? !$params['noerror'] : true;
$iLang = $oLang->getTplLanguage();
if (!$blAdmin && $oShop->isProductiveMode()) {
$blShowError = false;
}
try {
$sTranslation = $oLang->translateString($sIdent, $iLang, $blAdmin);
$blTranslationNotFound = !$oLang->isTranslated();
if ('NO_SUFFIX' != $sSuffix) {
$sSuffixTranslation = $oLang->translateString($sSuffix, $iLang, $blAdmin);
}
} catch (oxLanguageException $oEx) {
// is thrown in debug mode and has to be caught here, as smarty hangs otherwise!
}
if ($blTranslationNotFound && isset($params['alternative'])) {
$sTranslation = $params['alternative'];
$blTranslationNotFound = false;
}
if (!$blTranslationNotFound) {
if ($aArgs !== false) {
if (is_array($aArgs)) {
$sTranslation = vsprintf($sTranslation, $aArgs);
} else {
$sTranslation = sprintf($sTranslation, $aArgs);
}
}
if ('NO_SUFFIX' != $sSuffix) {
$sTranslation .= $sSuffixTranslation;
}
} elseif ($blShowError) {
$sTranslation = 'ERROR: Translation for ' . $sIdent . ' not found!';
}
stopProfile("smarty_function_oxmultilang");
return $sTranslation;
}
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:59,代码来源:function.oxmultilang.php
示例8: selectString
public function selectString($sSql, $values = array())
{
startProfile("loadinglists");
$this->clear();
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
if ($this->_aSqlLimit[0] || $this->_aSqlLimit[1]) {
$rs = $oDb->selectLimit($sSql, $this->_aSqlLimit[1], $this->_aSqlLimit[0], $values);
} else {
$rs = $oDb->select($sSql, $values);
}
if ($rs != false && $rs->recordCount() > 0) {
$oSaved = clone $this->getBaseObject();
while (!$rs->EOF) {
$oListObject = clone $oSaved;
$this->_assignElement($oListObject, $rs->fields);
$this->add($oListObject);
$rs->moveNext();
}
}
stopProfile("loadinglists");
}
开发者ID:styladev,项目名称:oxid,代码行数:21,代码来源:StylaFeed_Articlelist.php
示例9: oxNew
/**
* Creates and returns new object. If creation is not available, dies and outputs
* error message.
*
* @param string $className Name of class
* @param mixed ...$args constructor arguments
* @throws oxSystemComponentException in case that class does not exists
*
* @return object
*/
function oxNew($className)
{
startProfile('oxNew');
$arguments = func_get_args();
$object = call_user_func_array(array(oxUtilsObject::getInstance(), "oxNew"), $arguments);
stopProfile('oxNew');
return $object;
}
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:18,代码来源:oxfunctions.php
示例10: oxNew
/**
* Creates and returns new object. If creation is not available, dies and outputs
* error message.
*
* @param string $sClassName Name of class
*
* @throws oxSystemComponentException in case that class does not exists
*
* @return object
*/
function oxNew($sClassName)
{
startProfile('oxNew');
$aArgs = func_get_args();
$oRes = call_user_func_array(array(oxUtilsObject::getInstance(), "oxNew"), $aArgs);
stopProfile('oxNew');
return $oRes;
}
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:18,代码来源:oxfunctions.php
示例11: getArticleVat
/**
* get VAT for given article, can NOT be null
*
* @param Article $oArticle given article
*
* @return double
*/
public function getArticleVat(Article $oArticle)
{
startProfile("_assignPriceInternal");
// article has its own VAT ?
if (($dArticleVat = $oArticle->getCustomVAT()) !== null) {
stopProfile("_assignPriceInternal");
return $dArticleVat;
}
if (($dArticleVat = $this->_getVatForArticleCategory($oArticle)) !== false) {
stopProfile("_assignPriceInternal");
return $dArticleVat;
}
stopProfile("_assignPriceInternal");
return $this->getConfig()->getConfigParam('dDefaultVAT');
}
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:22,代码来源:VatSelector.php
示例12: parseThroughSmarty
/**
* Runs long description through smarty. If you pass array of data
* to process, array will be returned, if you pass string - string
* will be passed as result
*
* @param mixed $sDesc description or array of descriptions ( array( [] => array( _ident_, _value_to_process_ ) ) )
* @param string $sOxid current object id
* @param oxview $oActView view data to use its view data (optional)
* @param bool $blRecompile force to recompile if found in cache
*
* @return mixed
*/
public function parseThroughSmarty($sDesc, $sOxid = null, $oActView = null, $blRecompile = false)
{
if (oxRegistry::getConfig()->isDemoShop()) {
return $sDesc;
}
startProfile("parseThroughSmarty");
if (!is_array($sDesc) && strpos($sDesc, "[{") === false) {
stopProfile("parseThroughSmarty");
return $sDesc;
}
$iLang = oxRegistry::getLang()->getTplLanguage();
// now parse it through smarty
$oSmarty = clone $this->getSmarty();
// save old tpl data
$sTplVars = $oSmarty->_tpl_vars;
$blForceRecompile = $oSmarty->force_compile;
$oSmarty->force_compile = $blRecompile;
if (!$oActView) {
$oActView = oxNew('oxubase');
$oActView->addGlobalParams();
}
$aViewData = $oActView->getViewData();
foreach (array_keys($aViewData) as $sName) {
$oSmarty->assign_by_ref($sName, $aViewData[$sName]);
}
if (is_array($sDesc)) {
foreach ($sDesc as $sName => $aData) {
$oSmarty->oxidcache = new oxField($aData[1], oxField::T_RAW);
$sRes[$sName] = $oSmarty->fetch("ox:" . $aData[0] . $iLang);
}
} else {
$oSmarty->oxidcache = new oxField($sDesc, oxField::T_RAW);
$sRes = $oSmarty->fetch("ox:{$sOxid}{$iLang}");
}
// restore tpl vars for continuing smarty processing if it is in one
$oSmarty->_tpl_vars = $sTplVars;
$oSmarty->force_compile = $blForceRecompile;
stopProfile("parseThroughSmarty");
return $sRes;
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:52,代码来源:oxutilsview.php
示例13: getViewConfigParam
/**
* Returns current view config parameter
*
* @param string $sName name of parameter to get
*
* @return mixed
*/
public function getViewConfigParam($sName)
{
startProfile('oxviewconfig::getViewConfigParam');
if ($this->_oShop && isset($this->_oShop->{$sName})) {
$sValue = $this->_oShop->{$sName};
} elseif ($this->_aViewData && isset($this->_aViewData[$sName])) {
$sValue = $this->_aViewData[$sName];
} else {
$sValue = isset($this->_aConfigParams[$sName]) ? $this->_aConfigParams[$sName] : null;
}
stopProfile('oxviewconfig::getViewConfigParam');
return $sValue;
}
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:20,代码来源:oxviewconfig.php
示例14: loadPriceArticles
/**
* Loads articles, that price is bigger than passed $dPriceFrom and smaller
* than passed $dPriceTo. Returns count of selected articles.
*
* @param double $dPriceFrom Price from
* @param double $dPriceTo Price to
* @param object $oCategory Active category object
*
* @return integer
*/
public function loadPriceArticles($dPriceFrom, $dPriceTo, $oCategory = null)
{
$sSelect = $this->_getPriceSelect($dPriceFrom, $dPriceTo);
startProfile("loadPriceArticles");
$this->selectString($sSelect);
stopProfile("loadPriceArticles");
if (!$oCategory) {
return $this->count();
}
return oxRegistry::get("oxUtilsCount")->getPriceCatArticleCount($oCategory->getId(), $dPriceFrom, $dPriceTo);
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:21,代码来源:oxarticlelist.php
示例15: loadList
/**
* Fetches raw categories and does postprocessing for adding depth information
*/
public function loadList()
{
startProfile('buildCategoryList');
$this->setLoadFull(true);
$this->selectString($this->_getSelectString(false, null, 'oxparentid, oxsort, oxtitle'));
// build tree structure
$this->_ppBuildTree();
// PostProcessing
// add tree depth info
$this->_ppAddDepthInformation();
stopProfile('buildCategoryList');
}
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:15,代码来源:CategoryList.php
示例16: _getNonCachedFieldNames
/**
* Returns the list of fields. This function is slower and its result is normally cached.
* Basically we have 3 separate cases here:
* 1. We are in admin so we need extended info for all fields (name, field length and field type)
* 2. Object is not lazy loaded so we will return all data fields as simple array, as we need only names
* 3. Object is lazy loaded so we will return empty array as all fields are loaded on request (in __get()).
*
* @param bool $forceFullStructure Whether to force loading of full data structure
*
* @return array
*/
protected function _getNonCachedFieldNames($forceFullStructure = false)
{
//T2008-02-22
//so if this method is executed on cached version we see it when profiling
startProfile('!__CACHABLE__!');
//case 1. (admin)
if ($this->isAdmin()) {
$metaFields = $this->_getAllFields();
foreach ($metaFields as $oneField) {
if ($oneField->max_length == -1) {
$oneField->max_length = 10;
// double or float
}
if ($oneField->type == 'datetime') {
$oneField->max_length = 20;
}
$this->_addField($oneField->name, $this->_getFieldStatus($oneField->name), $oneField->type, $oneField->max_length);
}
stopProfile('!__CACHABLE__!');
return false;
}
//case 2. (just get all fields)
if ($forceFullStructure || !$this->_blUseLazyLoading) {
$metaFields = $this->_getAllFields(true);
/*
foreach ( $aMetaFields as $sFieldName => $sVal) {
$this->_addField( $sFieldName, $this->_getFieldStatus($sFieldName));
}*/
stopProfile('!__CACHABLE__!');
return $metaFields;
}
//case 3. (get only oxid field, so we can fetch the rest of the fields over lazy loading mechanism)
stopProfile('!__CACHABLE__!');
return array('oxid' => 0);
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:46,代码来源:Base.php
示例17: isMultilingualField
/**
* Checks if this field is multlingual
* (returns false if language = 0)
*
* @param string $sFieldName Field name
*
* @return bool
*/
public function isMultilingualField($sFieldName)
{
$sFieldName = strtolower($sFieldName);
if (isset($this->_aFieldNames[$sFieldName])) {
return (bool) $this->_aFieldNames[$sFieldName];
}
//not inited field yet
//and note that this is should be called only in first call after tmp dir is empty
startProfile('!__CACHABLE2__!');
$blIsMultilang = (bool) $this->_getFieldStatus($sFieldName);
stopProfile('!__CACHABLE2__!');
return (bool) $blIsMultilang;
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:21,代码来源:I18n.php
示例18: commitFileCache
/**
* Writes all cache contents to file at once. This method was introduced due to possible
* race conditions. Cache is cleaned up after commit
*/
public function commitFileCache()
{
if (!empty($this->_aLockedFileHandles[LOCK_EX])) {
startProfile("!__SAVING CACHE__! (warning)");
foreach ($this->_aLockedFileHandles[LOCK_EX] as $sKey => $rHandle) {
if ($rHandle !== false && isset($this->_aFileCacheContents[$sKey])) {
// #0002931A truncate file once more before writing
ftruncate($rHandle, 0);
// writing cache
fwrite($rHandle, $this->_processCache($sKey, $this->_aFileCacheContents[$sKey]));
// releasing locks
$this->_releaseFile($sKey);
}
}
stopProfile("!__SAVING CACHE__! (warning)");
//empty buffer
$this->_aFileCacheContents = array();
}
}
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:23,代码来源:Utils.php
示例19: _assignParentFieldValues
/**
* Assigns parent field values to article
*/
protected function _assignParentFieldValues()
{
startProfile('articleAssignParentInternal');
if ($this->oxarticles__oxparentid->value) {
// yes, we are in fact a variant
if (!$this->isAdmin() || $this->_blLoadParentData && $this->isAdmin()) {
foreach ($this->_aFieldNames as $sFieldName => $sVal) {
$this->_assignParentFieldValue($sFieldName);
}
}
}
stopProfile('articleAssignParentInternal');
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:16,代码来源:oxarticle.php
示例20: _executeMaintenanceTasks
/**
* Executes regular maintenance functions..
*
* @return null
*/
protected function _executeMaintenanceTasks()
{
if (isset($this->_blMainTasksExecuted)) {
return;
}
startProfile('executeMaintenanceTasks');
oxNew("oxArticleList")->updateUpcomingPrices();
stopProfile('executeMaintenanceTasks');
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:14,代码来源:ShopControl.php
注:本文中的stopProfile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论