本文整理汇总了PHP中stopProfile函数的典型用法代码示例。如果您正苦于以下问题:PHP stopProfile函数的具体用法?PHP stopProfile怎么用?PHP stopProfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stopProfile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: _checkAuthorization
protected function _checkAuthorization()
{
startProfile('ChromePHP: ' . __CLASS__ . ' / ' . __FUNCTION__);
if ($this->_getAuthorization()->getAuthorization()) {
$this->_enableChrome();
}
stopProfile('ChromePHP: ' . __CLASS__ . ' / ' . __FUNCTION__);
}
示例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");
}
示例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');
}
示例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;
}
示例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");
}
示例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;
}
示例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");
}
示例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;
}
示例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;
}
示例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');
}
示例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;
}
示例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;
}
示例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);
}
示例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');
}