本文整理汇总了PHP中eZDebug::writeNotice方法的典型用法代码示例。如果您正苦于以下问题:PHP eZDebug::writeNotice方法的具体用法?PHP eZDebug::writeNotice怎么用?PHP eZDebug::writeNotice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZDebug
的用法示例。
在下文中一共展示了eZDebug::writeNotice方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateClassAttributeHTTPInput
function validateClassAttributeHTTPInput($http, $base, $classAttribute)
{
//checking if the recaptcha key is set up if recaptcha is enabled
$ini = eZINI::instance('ezcomments.ini');
$fields = $ini->variable('FormSettings', 'AvailableFields');
if (in_array('recaptcha', $fields)) {
$publicKey = $ini->variable('RecaptchaSetting', 'PublicKey');
$privateKey = $ini->variable('RecaptchaSetting', 'PrivateKey');
if ($publicKey === '' || $privateKey === '') {
eZDebug::writeNotice('reCAPTCHA key is not set up. For help please visit http://projects.ez.no/ezcomments', __METHOD__);
}
}
if ($http->hasPostVariable('StoreButton') || $http->hasPostVariable('ApplyButton')) {
// find the class and count how many Comments dattype
$cond = array('contentclass_id' => $classAttribute->attribute('contentclass_id'), 'version' => eZContentClass::VERSION_STATUS_TEMPORARY, 'data_type_string' => $classAttribute->attribute('data_type_string'));
$classAttributeList = eZContentClassAttribute::fetchFilteredList($cond);
// if there is more than 1 comment attribute, return it as INVALID
if (!is_null($classAttributeList) && count($classAttributeList) > 1) {
if ($classAttributeList[0]->attribute('id') == $classAttribute->attribute('id')) {
eZDebug::writeNotice('There are more than 1 comment attribute in the class.', __METHOD__);
return eZInputValidator::STATE_INVALID;
}
}
}
return eZInputValidator::STATE_ACCEPTED;
}
示例2: updateAutoload
function updateAutoload($tpl = null)
{
$autoloadGenerator = new eZAutoloadGenerator();
try {
$autoloadGenerator->buildAutoloadArrays();
$messages = $autoloadGenerator->getMessages();
foreach ($messages as $message) {
eZDebug::writeNotice($message, 'eZAutoloadGenerator');
}
$warnings = $autoloadGenerator->getWarnings();
foreach ($warnings as &$warning) {
eZDebug::writeWarning($warning, "eZAutoloadGenerator");
// For web output we want to mark some of the important parts of
// the message
$pattern = '@^Class\\s+(\\w+)\\s+.* file\\s(.+\\.php).*\\n(.+\\.php)\\s@';
preg_match($pattern, $warning, $m);
$warning = str_replace($m[1], '<strong>' . $m[1] . '</strong>', $warning);
$warning = str_replace($m[2], '<em>' . $m[2] . '</em>', $warning);
$warning = str_replace($m[3], '<em>' . $m[3] . '</em>', $warning);
}
if ($tpl !== null) {
$tpl->setVariable('warning_messages', $warnings);
}
} catch (Exception $e) {
eZDebug::writeError($e->getMessage());
}
}
示例3: execute
function execute($process, $event)
{
$parameters = $process->attribute('parameter_list');
$http = eZHTTPTool::instance();
eZDebug::writeNotice($parameters, "parameters");
$orderID = $parameters['order_id'];
$order = eZOrder::fetch($orderID);
if (empty($orderID) || get_class($order) != 'ezorder') {
eZDebug::writeWarning("Can't proceed without a Order ID.", "SimpleStockCheck");
return eZWorkflowEventType::STATUS_FETCH_TEMPLATE_REPEAT;
}
// Decrement the quantitity field
$order = eZOrder::fetch($orderID);
$productCollection = $order->productCollection();
$ordereditems = $productCollection->itemList();
foreach ($ordereditems as $item) {
$contentObject = $item->contentObject();
$contentObjectVersion = $contentObject->version($contentObject->attribute('current_version'));
$contentObjectAttributes = $contentObjectVersion->contentObjectAttributes();
foreach (array_keys($contentObjectAttributes) as $key) {
$contentObjectAttribute = $contentObjectAttributes[$key];
$contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
// Each attribute has an attribute identifier called 'quantity' that identifies it.
if ($contentClassAttribute->attribute("identifier") == "quantity") {
$contentObjectAttribute->setAttribute("data_int", $contentObjectAttribute->attribute("value") - $item->ItemCount);
$contentObjectAttribute->store();
}
}
}
return eZWorkflowEventType::STATUS_ACCEPTED;
}
示例4: getXMLString
function getXMLString($name = false, $data, $ret = false, $debug = false)
{
// given string $data, will return the text string content of the $name attribute content of a given valid xml document.
if ($debug) {
ezDebug::writeNotice($name, 'getXMLString:name');
}
// get information out of eZXML
$xml = new eZXML();
$xmlDoc = $data;
if ($debug) {
ezDebug::writeNotice($data, 'getXMLString:data');
}
// continue only with content
if ($xmlDoc != null and $name != null) {
$dom = $xml->domTree($xmlDoc);
$element = $dom->elementsByName("{$name}");
if (is_object($element[0])) {
$string = $element[0]->textContent();
$ret = $string;
} else {
eZDebug::writeNotice('Key "' . $name . '" does not exist.', 'wrap_operator');
}
}
if ($debug) {
ezDebug::writeNotice($ret, 'getXMLString:ret');
}
return $ret;
}
示例5: setDiffEngineType
function setDiffEngineType($diffEngineType)
{
if (isset($diffEngineType)) {
$this->DiffEngine = $diffEngineType;
eZDebug::writeNotice("Changing diff engine to type: " . $diffEngineType, 'eZDiff');
}
}
示例6: createClass
static function createClass( $tpl,
$module,
$stepArray,
$basePath,
$storageName = false,
$metaData = false )
{
if ( !$storageName )
{
$storageName = 'eZWizard';
}
if ( !$metaData )
{
$http = eZHTTPTool::instance();
$metaData = $http->sessionVariable( $storageName . '_meta' );
}
if ( !isset( $metaData['current_step'] ) ||
$metaData['current_step'] < 0 )
{
$metaData['current_step'] = 0;
eZDebug::writeNotice( 'Setting wizard step to : ' . $metaData['current_step'], __METHOD__ );
}
$currentStep = $metaData['current_step'];
if ( count( $stepArray ) <= $currentStep )
{
eZDebug::writeError( 'Invalid wizard step count: ' . $currentStep, __METHOD__ );
return false;
}
$filePath = $basePath . $stepArray[$currentStep]['file'];
if ( !file_exists( $filePath ) )
{
eZDebug::writeError( 'Wizard file not found : ' . $filePath, __METHOD__ );
return false;
}
include_once( $filePath );
$className = $stepArray[$currentStep]['class'];
eZDebug::writeNotice( 'Creating class : ' . $className, __METHOD__ );
$returnClass = new $className( $tpl, $module, $storageName );
if ( isset( $stepArray[$currentStep]['operation'] ) )
{
$operation = $stepArray[$currentStep]['operation'];
return $returnClass->$operation();
eZDebug::writeNotice( 'Running : "' . $className . '->' . $operation . '()". Specified in StepArray', __METHOD__ );
}
if ( isset( $metaData['current_stage'] ) )
{
$returnClass->setMetaData( 'current_stage', $metaData['current_stage'] );
eZDebug::writeNotice( 'Setting wizard stage to : ' . $metaData['current_stage'], __METHOD__ );
}
return $returnClass;
}
示例7: getProductCategory
/**
* Determine object's product category.
*
* \private
* \static
*/
function getProductCategory($object)
{
$ini = eZINI::instance('shop.ini');
if (!$ini->hasVariable('VATSettings', 'ProductCategoryAttribute')) {
eZDebug::writeError("Cannot find product category: please specify its attribute identifier " . "in the following setting: shop.ini.[VATSettings].ProductCategoryAttribute");
return null;
}
$categoryAttributeName = $ini->variable('VATSettings', 'ProductCategoryAttribute');
if (!$categoryAttributeName) {
eZDebug::writeError("Cannot find product category: empty attribute name specified " . "in the following setting: shop.ini.[VATSettings].ProductCategoryAttribute");
return null;
}
$productDataMap = $object->attribute('data_map');
if (!isset($productDataMap[$categoryAttributeName])) {
eZDebug::writeError("Cannot find product category: there is no attribute '{$categoryAttributeName}' in object '" . $object->attribute('name') . "' of class '" . $object->attribute('class_name') . "'.");
return null;
}
$categoryAttribute = $productDataMap[$categoryAttributeName];
$productCategory = $categoryAttribute->attribute('content');
if ($productCategory === null) {
eZDebug::writeNotice("Product category is not specified in object '" . $object->attribute('name') . "' of class '" . $object->attribute('class_name') . "'.");
return null;
}
return $productCategory;
}
示例8: generateMarkup
public function generateMarkup()
{
$ttlInfos = $this->parseTTL();
$markup = '<esi:include src="' . $this->Src . '" ttl="' . $ttlInfos['ttl_value'] . $ttlInfos['ttl_unit'] . '" onerror="continue"/>';
eZDebug::writeNotice($markup, __METHOD__);
return $markup;
}
示例9: attribute
public function attribute($key)
{
if ($this->hasAttribute($key)) {
switch ($key) {
case 'object':
return $this->getObject();
break;
case 'node':
return $this->getNode();
break;
default:
return $this->data[$key];
}
}
eZDebug::writeNotice("Attribute {$key} does not exist");
}
示例10: mkDir
private function mkDir($path)
{
$dirList = explode("/", $path);
$path = "";
foreach ($dirList as $dir) {
$path .= "/" . $dir;
if (!@ftp_chdir($this->ConnectionResource, $path)) {
@ftp_chdir($this->ConnectionResource, "/");
if (!@ftp_mkdir($this->ConnectionResource, $path)) {
return false;
}
eZDebug::writeNotice('Creating ' . $path, __METHOD__);
}
}
// returning to root folder : lots of moves but cleaner
ftp_chdir($this->ConnectionResource, "/");
return true;
}
示例11: clearCache
public static function clearCache()
{
eZDebug::writeNotice("Clear calendar taxonomy cache", __METHOD__);
$ini = eZINI::instance();
if ($ini->hasVariable('SiteAccessSettings', 'RelatedSiteAccessList') && ($relatedSiteAccessList = $ini->variable('SiteAccessSettings', 'RelatedSiteAccessList'))) {
if (!is_array($relatedSiteAccessList)) {
$relatedSiteAccessList = array($relatedSiteAccessList);
}
$relatedSiteAccessList[] = $GLOBALS['eZCurrentAccess']['name'];
$siteAccesses = array_unique($relatedSiteAccessList);
} else {
$siteAccesses = $ini->variable('SiteAccessSettings', 'AvailableSiteAccessList');
}
$cacheBaseDir = eZDir::path(array(eZSys::cacheDirectory(), self::cacheDirectory()));
$fileHandler = eZClusterFileHandler::instance();
$fileHandler->fileDeleteByDirList($siteAccesses, $cacheBaseDir, '');
$fileHandler = eZClusterFileHandler::instance($cacheBaseDir);
$fileHandler->purge();
}
示例12: send
/**
* @param EntityEnclosingRequest|EntityEnclosingRequest[]
* @return array|\Guzzle\Http\Message\Response
* @throws \Exception
* @throws \Guzzle\Common\Exception\ExceptionCollection
* @throws mixed
*/
public function send($requests)
{
if ( is_array($requests) && count($requests) > 1 )
{
\eZDebug::writeError( 'Should not receive multiple guzzle requests', __CLASS__.'::'.__METHOD__ );
return parent::send($requests);
}
/* @var $request EntityEnclosingRequest */
$request = is_array($requests) ? $requests[0] : $requests;
if ( $request->getMethod() !== 'POST' )
{
\eZDebug::writeNotice( 'Not POST method used ('.$request->getMethod().'). Falling back to default Guzzle behaviour' );
return parent::send($requests);
}
return GuzzleCurlHelper::sendRequest( $request );
}
示例13: appendLogEntry
/**
* Logs the string $logString to the logfile webservices.log
* in the current log directory (usually var/log).
* If logging is disabled, nothing is done.
*
* In dev mode, also writes to the eZP logs to ease debugging (this happens
* regardless of the logging level set for the extension itself)
*/
static function appendLogEntry($logString, $debuglevel)
{
$ini = eZINI::instance('site.ini');
if ($ini->variable('DebugSettings', 'DebugOutput') == 'enabled' && $ini->variable('TemplateSettings', 'DevelopmentMode') == 'enabled') {
switch ($debuglevel) {
case 'info':
case 'notice':
eZDebug::writeNotice($logString, 'ggwebservices');
break;
case 'debug':
eZDebug::writeDebug($logString, 'ggwebservices');
break;
case 'warning':
eZDebug::writeWarning($logString, 'ggwebservices');
break;
case 'error':
case 'critical':
eZDebug::writeError($logString, 'ggwebservices');
break;
}
}
if (!self::isLoggingEnabled($debuglevel)) {
return false;
}
$varDir = eZSys::varDirectory();
$logDir = 'log';
$logName = 'webservices.log';
$fileName = $varDir . '/' . $logDir . '/' . $logName;
if (!file_exists($varDir . '/' . $logDir)) {
//include_once( 'lib/ezfile/classes/ezdir.php' );
eZDir::mkdir($varDir . '/' . $logDir, 0775, true);
}
if ($logFile = fopen($fileName, 'a')) {
$nowTime = date("Y-m-d H:i:s : ");
$text = $nowTime . $logString;
/*if ( $label )
$text .= ' [' . $label . ']';*/
fwrite($logFile, $text . "\n");
fclose($logFile);
}
}
示例14: gmapStaticImageGetData
protected static function gmapStaticImageGetData($args)
{
extract($args);
$markers = array();
$query = array();
foreach ($parameters as $key => $value) {
if (is_array($value)) {
foreach ($value as $markerProperties) {
$latLngArray = array();
$markerQuery = array();
$markerPositions = array();
foreach ($markerProperties as $markerPropertyKey => $markerPropertyValue) {
if ($markerPropertyKey == '_positions') {
foreach ($markerPropertyValue as $position) {
if ($position['lat'] > 0 && $position['lng'] > 0) {
$markerPositions[] = "{$position['lat']},{$position['lng']}";
}
}
} else {
$markerQuery[] = "{$markerPropertyKey}:{$markerPropertyValue}";
}
}
if (empty($markerPositions)) {
throw new Exception("Positions not found in parameters " . var_export($parameters, 1));
} else {
//markers=color:blue|46.067618,11.117315
$query[] = "markers=" . implode('|', $markerQuery) . '|' . implode('|', $markerPositions);
}
}
} else {
//zoom=13 size=600x300 maptype=roadmap
$query[] = "{$key}={$value}";
}
}
$stringQuery = implode('&', $query);
$baseUrl = 'http://maps.googleapis.com/maps/api/staticmap';
$url = "{$baseUrl}?{$stringQuery}";
$data = eZHTTPTool::getDataByURL($url);
eZDebug::writeNotice("Generate static map for attribute {$attribute->attribute('id')}: {$url}", __METHOD__);
return 'data:image/PNG;base64,' . base64_encode($data);
}
示例15: parseText
function parseText($text)
{
$returnArray = array();
$pos = 0;
while ($pos < strlen($text)) {
// find the next tag
$tagStart = strpos($text, "<", $pos);
if ($tagStart !== false) {
if ($tagStart - $pos >= 1) {
$textChunk = substr($text, $pos, $tagStart - $pos);
$pos += $tagStart - $pos;
if (strlen(trim($textChunk)) != 0) {
$returnArray[] = array("Type" => eZTextInputParser::CHUNK_TEXT, "Text" => $textChunk, "TagName" => "#text");
eZDebug::writeNotice($textChunk, "New text chunk in input");
}
}
// get the tag
$tagEnd = strpos($text, ">", $pos);
$tagChunk = substr($text, $pos, $tagEnd - $pos + 1);
$tagName = preg_replace("#^\\<(.+)?(\\s.*|\\>)#m", "\\1", $tagChunk);
// check for end tag
if ($tagName[0] == "/") {
print "endtag";
}
$returnArray[] = array("Type" => eZTextInputParser::CHUNK_TAG, "TagName" => $tagName, "Text" => $tagChunk);
$pos += $tagEnd - $pos;
eZDebug::writeNotice($tagChunk, "New tag chunk in input");
} else {
// just plain text in the rest
$textChunk = substr($text, $pos, strlen($text));
eZDebug::writeNotice($textChunk, "New text chunk in input");
if (strlen(trim($textChunk)) != 0) {
$returnArray[] = array("Type" => eZTextInputParser::CHUNK_TEXT, "Text" => $textChunk, "TagName" => "#text");
}
$pos = strlen($text);
}
$pos++;
}
return $returnArray;
}