本文整理汇总了PHP中eZLog类的典型用法代码示例。如果您正苦于以下问题:PHP eZLog类的具体用法?PHP eZLog怎么用?PHP eZLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了eZLog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: writeAudit
/**
* Writes $auditName with $auditAttributes as content
* to file name that will be fetched from ini settings by auditNameSettings() for logging.
*
* @param string $auditName
* @param array $auditAttributes
* @return bool
*/
static function writeAudit($auditName, $auditAttributes = array())
{
$enabled = eZAudit::isAuditEnabled();
if (!$enabled) {
return false;
}
$auditNameSettings = eZAudit::auditNameSettings();
if (!isset($auditNameSettings[$auditName])) {
return false;
}
$ip = eZSys::clientIP();
if (!$ip) {
$ip = eZSys::serverVariable('HOSTNAME', true);
}
$user = eZUser::currentUser();
$userID = $user->attribute('contentobject_id');
$userLogin = $user->attribute('login');
$message = "[{$ip}] [{$userLogin}:{$userID}]\n";
foreach (array_keys($auditAttributes) as $attributeKey) {
$attributeValue = $auditAttributes[$attributeKey];
$message .= "{$attributeKey}: {$attributeValue}\n";
}
$logName = $auditNameSettings[$auditName]['file_name'];
$dir = $auditNameSettings[$auditName]['dir'];
eZLog::write($message, $logName, $dir);
return true;
}
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:35,代码来源:ezaudit.php
示例2: logMessage
/**
* Generic method for logging a message
*
* @param string $msg
* @param bool $bPrintMsg
* @param string $logType
*/
public static function logMessage($msg, $bPrintMsg = true, $logType = self::NOTICELOG)
{
switch ($logType) {
case self::ERRORLOG:
$logFile = self::ERRORLOG_FILE;
if ($bPrintMsg) {
self::writeError($msg);
}
break;
case self::WARNINGLOG:
$logFile = self::WARNINGLOG_FILE;
if ($bPrintMsg) {
self::writeWarning($msg);
}
break;
case self::NOTICELOG:
default:
$logFile = self::NOTICELOG_FILE;
if ($bPrintMsg) {
self::writeNotice($msg);
}
break;
}
eZLog::write($msg, $logFile);
}
开发者ID:lolautruche,项目名称:sqliimport,代码行数:32,代码来源:sqliimportlogger.php
示例3: __construct
/**
* @param int $objectID ContentObjectID
*/
public function __construct($objectID)
{
$userID = eZUser::currentUserID();
$message = ezpI18n::tr('design/standard/error/kernel', 'Access denied') . '. ' . ezpI18n::tr('design/standard/error/kernel', 'You do not have permission to access this area.');
eZLog::write("Access denied to content object #{$objectID} for user #{$userID}", 'error.log');
parent::__construct($message);
}
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:10,代码来源:access_denied.php
示例4: write_invalid_checkcreditcard_log
public static function write_invalid_checkcreditcard_log($order_id, $response = array("errorcode" => "unknown", "errormessage" => "unknown"))
{
$http = eZHTTPTool::instance();
//set fallbacks for direct ajax request
if (!isset($order_id) or is_array($order_id) and count($order_id) == 0) {
$order_id = $http->postVariable('order_id');
}
if (!isset($response) or is_array($response) and count($response) == 0) {
$response = $http->postVariable('response');
}
eZLog::write("FAILED in step 1 ('checkcreditcard') for order ID " . $order_id . " with ERRORCODE " . $response["errorcode"] . " Message: " . $response["errormessage"], $logName = 'xrowpayone.log', $dir = 'var/log');
}
开发者ID:xrowgmbh,项目名称:xrowpayone,代码行数:12,代码来源:xrowpayoneserverfunctions.php
示例5: modify
function modify($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement)
{
switch ($operatorName) {
case 'hashcreate':
$algorithm = $namedParameters['algorithm'];
$hash_array = $namedParameters['hash_array'];
$key = $namedParameters['key'];
$operatorValue = xrowPayoneHelper::generate_hash($algorithm, $hash_array, $key);
break;
case 'payone_info_by_order':
$order = $namedParameters['order'];
$payone_info = array();
if ($order instanceof eZOrder) {
$doc = new DOMDocument('1.0', 'utf-8');
$doc->loadXML($order->DataText1);
//try to fetch txid
$txid_element = $doc->getElementsByTagName('txid');
if ($txid_element->length >= 1) {
$payone_info["txid"] = (string) $txid_element->item(0)->nodeValue;
}
//try to fetch txid
$truncatedcardpan_element = $doc->getElementsByTagName('truncatedcardpan');
if ($txid_element->length >= 1) {
$payone_info["truncatedcardpan"] = (string) $truncatedcardpan_element->item(0)->nodeValue;
}
//try to fetch userid
$userid_element = $doc->getElementsByTagName('userid');
if ($userid_element->length >= 1) {
$payone_info["userid"] = (string) $userid_element->item(0)->nodeValue;
}
//try to fetch 3d secure payment status
$cc3d_reserved_element = $doc->getElementsByTagName('cc3d_reserved');
if ($cc3d_reserved_element->length >= 1) {
$payone_info["cc3d_reserved"] = (string) $cc3d_reserved_element->item(0)->nodeValue;
}
//try to fetch the paymentgateway
$paymentmethod_element = $doc->getElementsByTagName('paymentmethod');
if ($paymentmethod_element->length >= 1) {
$payone_info["paymentmethod"] = (string) $paymentmethod_element->item(0)->nodeValue;
}
} else {
eZLog::write("\$order is not an instance of eZOrder in extension/xrowpayone/autoloads/xrowpayoneoperator.php", $logName = 'xrowpayone.log', $dir = 'var/log');
}
if (count($payone_info) == 0) {
$operatorValue = false;
} else {
$operatorValue = $payone_info;
}
break;
}
}
开发者ID:xrowgmbh,项目名称:xrowpayone,代码行数:51,代码来源:xrowpayoneoperator.php
示例6: __construct
/**
* @param SQLIImportHandlerOptions $options
*/
public function __construct( SQLIImportHandlerOptions $options = null )
{
parent::__construct( $options );
$ftpFolder = 'oscar1';
$modeUAT = false;
$this->startDate = microtime( true );
if ( $this->importINI->hasVariable( 'XMLImportSettings', 'ModeUAT' )
&& $this->importINI->variable( 'XMLImportSettings', 'ModeUAT' ) == 'enabled' )
{
$modeUAT = true;
}
if ( is_object($this->options) )
{
if ( $this->options->hasAttribute( 'reportLevel' ) && is_numeric($reportLevel = $this->options->attribute( 'reportLevel' )) )
XMLImportMonitor::setReportLevel( $reportLevel );
if ( $this->options->hasAttribute( 'ftpFolder' ) && in_array($this->options->attribute( 'ftpFolder' ),array('oscar1','oscar2') ) )
$ftpFolder = $this->options->attribute( 'ftpFolder' );
}
$this->rootImportFolder = $ftpFolder;
// Initialize sqliImportItem Statistics and logs
XMLImportDB::init( $this->importINI );
XMLImportMapping::init( $this->importINI );
eZLog::setMaxLogSize( 2000000 );
eZLog::setLogrotateFiles( 20 );
XMLImportMonitor::setOrigin($ftpFolder);
XMLImportMonitor::setSQLiImportItem( $this->getCurrentSQLiImportItem() );
XMLImportMonitor::pushStatistic( 'start_date', time() );
$this->fileHandler = XMLImportFileHandler::instance($this->importINI, $ftpFolder, $modeUAT);
XMLImportDataHandler::setIni ( $this->importINI );
XMLImportDataHandler::setFileHandler ( $this->fileHandler );
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:41,代码来源:oscarXmlImportHandler.php
示例7: generateCustomErrorString
public function generateCustomErrorString($order, $response)
{
$payoneINI = eZINI::instance('xrowpayone.ini');
$custom_error_node_id = $payoneINI->variable('GeneralSettings', 'CustomErrorNode');
$error_fallback = $payoneINI->variable('GeneralSettings', 'CustomErrorFallback');
$error_fallback = ezpI18n::tr('extension/xrowpayone', $error_fallback);
if ($custom_error_node_id !== "disabled") {
if (is_numeric($custom_error_node_id)) {
$custom_error_node = eZContentObjectTreeNode::fetch($custom_error_node_id);
if (isset($custom_error_node) and $custom_error_node instanceof eZContentObjectTreeNode) {
$error_code = $response["errorcode"];
$data_map = $custom_error_node->dataMap();
$matrix_identifier = $payoneINI->variable('GeneralSettings', 'CustomErrorNodeMatrixIdentifier');
if (isset($data_map[$matrix_identifier])) {
$matrix_attribute_content = $data_map[$matrix_identifier]->content();
$matrix_data = $matrix_attribute_content->Matrix;
$matrix_rows = $matrix_data["rows"];
$matrix_rows = $matrix_rows["sequential"];
foreach ($matrix_rows as $row) {
//now map the error code to the matrix code
if ($row["columns"]["0"] == $error_code) {
$custom_errormessage = $row["columns"]["1"];
//return the translated code from object
return $custom_errormessage;
}
}
} else {
eZLog::write("No attribute identifier named " . $matrix_identifier . " found. Please check your configuration 'xrowpayone.ini', GeneralSettings', 'CustomErrorNode'", $logName = 'xrowpayone.log', $dir = 'var/log');
}
} else {
eZLog::write("Could not fetch node from settings 'xrowpayone.ini', GeneralSettings', 'CustomErrorNode' please check your configuration", $logName = 'xrowpayone.log', $dir = 'var/log');
}
}
}
//the worst fallback
return $error_fallback;
}
开发者ID:xrowgmbh,项目名称:xrowpayone,代码行数:37,代码来源:xrowpayonehelper.php
示例8: loadCache
function loadCache($reset = true, $placement = false)
{
eZDebug::accumulatorStart('ini', 'ini_load', 'Load cache');
if ($reset) {
$this->reset();
}
$cachedDir = self::CONFIG_CACHE_DIR;
$inputFileTime = 0;
$fileName = $this->cacheFileName($placement);
$cachedFile = $cachedDir . $fileName;
if ($placement) {
$this->PlacementCacheFile = $cachedFile;
} else {
$this->CacheFile = $cachedFile;
}
$loadCache = false;
if (file_exists($cachedFile)) {
$loadCache = true;
}
$useCache = false;
if ($loadCache) {
$useCache = true;
if (eZINI::isDebugEnabled()) {
eZDebug::writeNotice("Loading cache '{$cachedFile}' for file '" . $this->FileName . "'", __METHOD__);
}
include $cachedFile;
if (!isset($data) || !isset($data['rev']) || $data['rev'] != eZINI::CONFIG_CACHE_REV) {
if (eZINI::isDebugEnabled()) {
eZDebug::writeNotice("Old structure in cache file used, recreating '{$cachedFile}' to new structure", __METHOD__);
}
unset($data);
$this->reset();
$useCache = false;
} else {
if (self::$checkFileMtime === true || self::$checkFileMtime === $this->FileName) {
eZDebug::accumulatorStart('ini_check_mtime', 'ini_load', 'Check MTime');
$currentTime = time();
$cacheCreatedTime = strtotime($data['created']);
$iniFile = $data['file'];
$inputFiles = $data['files'];
foreach ($inputFiles as $inputFile) {
$fileTime = filemtime($inputFile);
if ($currentTime < $fileTime) {
eZDebug::writeError('Input file "' . $inputFile . '" has a timestamp higher then current time, ignoring to avoid infinite recursion!', __METHOD__);
} else {
if ($fileTime === false || $fileTime > $cacheCreatedTime) {
unset($data);
$this->reset();
$useCache = false;
break;
}
}
}
eZDebug::accumulatorStop('ini_check_mtime');
}
}
}
if ($useCache && isset($data)) {
$this->Charset = $data['charset'];
$this->ModifiedBlockValues = array();
if ($placement) {
$this->BlockValuesPlacement = $data['val'];
} else {
$this->BlockValues = $data['val'];
}
unset($data);
} else {
if (!isset($inputFiles)) {
eZDebug::accumulatorStart('ini_find_files', 'ini_load', 'Find INI Files');
$this->findInputFiles($inputFiles, $iniFile);
eZDebug::accumulatorStop('ini_find_files');
if (count($inputFiles) === 0) {
eZDebug::accumulatorStop('ini');
return false;
}
}
eZDebug::accumulatorStart('ini_files_parse', 'ini_load', 'Parse');
$this->parse($inputFiles, $iniFile, false, $placement);
eZDebug::accumulatorStop('ini_files_parse');
eZDebug::accumulatorStart('ini_files_save', 'ini_load', 'Save Cache');
$cacheSaved = $this->saveCache($cachedDir, $cachedFile, $placement ? $this->BlockValuesPlacement : $this->BlockValues, $inputFiles, $iniFile);
eZDebug::accumulatorStop('ini_files_save');
if ($cacheSaved) {
// Write log message to storage.log
eZLog::writeStorageLog($fileName, $cachedDir);
}
}
eZDebug::accumulatorStop('ini');
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:89,代码来源:ezini.php
示例9: defaultExceptionHandler
/**
* Installs the default Exception handler
*
* @params Exception the exception
* @return void
*/
static public function defaultExceptionHandler( Exception $e )
{
if( PHP_SAPI != 'cli' )
{
header( 'HTTP/1.x 500 Internal Server Error' );
header( 'Content-Type: text/html' );
echo "An unexpected error has occurred. Please contact the webmaster.<br />";
if( eZDebug::isDebugEnabled() )
{
echo $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine();
}
}
else
{
$cli = eZCLI::instance();
$cli->error( "An unexpected error has occurred. Please contact the webmaster.");
if( eZDebug::isDebugEnabled() )
{
$cli->error( $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine() );
}
}
eZLog::write( 'Unexpected error, the message was : ' . $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine(), 'error.log' );
eZExecution::cleanup();
eZExecution::setCleanExit();
exit( 1 );
}
开发者ID:nottavi,项目名称:ezpublish,代码行数:37,代码来源:ezexecution.php
示例10: array
<?php
$Module =& $Params['Module'];
$order_id = $Params["orderID"];
if (isset($order_id)) {
eZLog::write("PENDING in step 2 ('preauthorisation') ::3D Secure Card password ACCEPTED :: for order ID " . $order_id, $logName = 'xrowpayone.log', $dir = 'var/log');
//create the payment gateway - not the best position but at least it works here :)
$payment = xrowPaymentObject::createNew((int) $order_id, xrowPayoneCreditCardGateway::GATEWAY_STRING);
$payment->store();
//store paymentobject and approve it (required to finish the order)
$paymentObj = xrowPaymentObject::fetchByOrderID($order_id);
$paymentObj->approve();
eZLog::write("PENDING in step 2 ('preauthorisation') ::3D Secure Card password REDIRECTING to orderview :: for order ID " . $order_id, $logName = 'xrowpayone.log', $dir = 'var/log');
//redirect into the shopping process => finishing the order!
$Module->redirectTo('/shop/checkout/');
} else {
return $Module->handleError(1, 'kernel');
}
$Result = array();
开发者ID:xrowgmbh,项目名称:xrowpayone,代码行数:19,代码来源:successurl.php
示例11: setToken
/**
* @return string
*/
private function setToken()
{
$token = array();
$staticDir = StaticData::directory();
$outputFile = $staticDir.'/'.$this->tokenFileName;
if( file_exists( $outputFile ) )
{
$token = json_decode( file_get_contents($outputFile), true );
}
if( !file_exists( $outputFile ) || !isset($token['expiresIn']) || !isset($token['accessToken']) || ($token['expiresIn'] < time()) )
{
if( file_exists( $outputFile ) )
{
unlink($outputFile);
}
$requestData = array(
"clientId" => $this->clientId,
"clientSecret" => $this->clientSecret
);
$query = http_build_query( $requestData );
$smsApiUrl = "{$this->tokenRequestUrl}?{$query}";
eZLog::write( "Sending request to: {$smsApiUrl}", 'sms.log' );
$curl = curl_init($this->tokenRequestUrl);
curl_setopt_array($curl, array(
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $requestData,
CURLOPT_RETURNTRANSFER => true,
)
);
$token = curl_exec( $curl );
if( $token && isset($token['accessToken']) )
{
$logMessage = 'Recieved SMS Service responses: ' . var_export($token, true);
eZLog::write( $logMessage, 'sms.log' );
$token = json_decode($token, TRUE);
$token['expiresIn'] += time() + 300;
curl_close( $curl );
file_put_contents($outputFile, json_encode($token));
$this->smsToken = $token['accessToken'];
return true;
}
else
{
$logMessage = 'Error - Problem with recieved SMS Service responses: ' . var_export($token, true);
eZLog::write( $logMessage, 'sms.log' );
return false;
}
}
$this->smsToken = $token['accessToken'];
return true;
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:62,代码来源:mmsms.php
示例12: write
public function write($message)
{
eZLog::write($message, $this->logFile, $this->logDir);
}
开发者ID:legende91,项目名称:ez,代码行数:4,代码来源:log.php
示例13: rotateLog
static function rotateLog($fileName)
{
$maxLogrotateFiles = eZLog::maxLogrotateFiles();
if ($maxLogrotateFiles == 0) {
return;
}
for ($i = $maxLogrotateFiles; $i > 0; --$i) {
$logRotateName = $fileName . '.' . $i;
if (file_exists($logRotateName)) {
if ($i == $maxLogrotateFiles) {
@unlink($logRotateName);
} else {
$newLogRotateName = $fileName . '.' . ($i + 1);
eZFile::rename($logRotateName, $newLogRotateName);
}
}
}
if (file_exists($fileName)) {
$newLogRotateName = $fileName . '.' . 1;
eZFile::rename($fileName, $newLogRotateName);
return true;
}
return false;
}
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:24,代码来源:ezlog.php
示例14: store
function store($sub_dir = false, $suffix = false, $mimeData = false)
{
if (!$this->IsTemporary) {
eZDebug::writeError("Cannot store non temporary file: " . $this->Filename, "eZHTTPFile");
return false;
}
$this->IsTemporary = false;
$ini = eZINI::instance();
// $storage_dir = $ini->variable( "FileSettings", "VarDir" ) . '/' . $ini->variable( "FileSettings", "StorageDir" );
$storage_dir = eZSys::storageDirectory();
if ($sub_dir !== false) {
$dir = $storage_dir . "/{$sub_dir}/";
} else {
$dir = $storage_dir . "/";
}
if ($mimeData) {
$dir = $mimeData['dirpath'];
}
if (!$mimeData) {
$dir .= $this->MimeCategory;
}
if (!file_exists($dir)) {
if (!eZDir::mkdir($dir, false, true)) {
return false;
}
}
$suffixString = false;
if ($suffix != false) {
$suffixString = ".{$suffix}";
}
if ($mimeData) {
$dest_name = $mimeData['url'];
} else {
$dest_name = $dir . "/" . md5(basename($this->Filename) . microtime() . mt_rand()) . $suffixString;
}
if (!move_uploaded_file($this->Filename, $dest_name)) {
eZDebug::writeError("Failed moving uploaded file " . $this->Filename . " to destination {$dest_name}");
unlink($dest_name);
$ret = false;
} else {
$ret = true;
$this->Filename = $dest_name;
$perm = $ini->variable("FileSettings", "StorageFilePermissions");
$oldumask = umask(0);
chmod($dest_name, octdec($perm));
umask($oldumask);
// Write log message to storage.log
$storageDir = $dir . "/";
eZLog::writeStorageLog(basename($this->Filename), $storageDir);
}
return $ret;
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:52,代码来源:ezhttpfile.php
示例15: startCacheGeneration
/**
* Starts cache generation for the current file.
*
* This is done by creating a file named by the original file name, prefixed
* with '.generating'.
*
* @return bool false if the file is being generated, true if it is not
**/
public function startCacheGeneration()
{
$generatingFilePath = $this->filePath . '.generating';
$ret = $this->backend->_startCacheGeneration($this->filePath, $generatingFilePath);
// generation granted
if ($ret['result'] == 'ok') {
$this->realFilePath = $this->filePath;
$this->filePath = $generatingFilePath;
$this->generationStartTimestamp = $ret['mtime'];
return true;
} elseif ($ret['result'] == 'ko') {
return $ret['remaining'];
} else {
eZLog::write("An error occured starting cache generation on '{$generatingFilePath}'", 'cluster.log');
return false;
}
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:25,代码来源:ezdbfilehandler.php
示例16: fileLog
/**
* Writes a file log (severity below warning)
* @param string $message Message to log
* @param string $severity Severity of the log message
*/
protected static function fileLog($message, $severity)
{
if (!empty(self::$file))
{
$messages = explode("\n", $message);
foreach ($messages as $index => $m)
{
$messages[$index] = 'F : ' . self::$file . ' - P : ' . self::$publisher . " | $m";
}
}
else
return;
$index = array_search($severity, self::$severities);
if ($index >= self::$reportLevel)
{
foreach ($messages as $message)
{
eZLog::write($message, self::$prefixLog . "$severity.log");
}
}
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:29,代码来源:xmlimportmonitor.php
示例17: loadCache
//.........这里部分代码省略.........
$cachedDir = self::CONFIG_CACHE_DIR;
$fileName = $this->cacheFileName( $placement );
$cachedFile = $cachedDir . $fileName;
if ( $placement )
{
$this->PlacementCacheFile = $cachedFile;
}
else
{
$this->CacheFile = $cachedFile;
}
$data = false;// this will contain cache data if cache data is valid
if ( file_exists( $cachedFile ) )
{
if ( self::isDebugEnabled() )
eZDebug::writeNotice( "Loading cache '$cachedFile' for file '" . $this->FileName . "'", __METHOD__ );
include( $cachedFile );
if ( !isset( $data['rev'] ) || $data['rev'] != eZINI::CONFIG_CACHE_REV )
{
if ( self::isDebugEnabled() )
eZDebug::writeNotice( "Old structure in cache file used, recreating '$cachedFile' to new structure", __METHOD__ );
$data = false;
$this->reset();
}
else if ( self::$checkFileMtime === true || self::$checkFileMtime === $this->FileName )
{
eZDebug::accumulatorStart( 'ini_check_mtime', 'Ini load', 'Check MTime' );
$currentTime = time();
$cacheCreatedTime = strtotime( $data['created'] );
$iniFile = $data['file'];// used by findInputFiles further down
$inputFiles = $data['files'];
foreach ( $inputFiles as $inputFile )
{
$fileTime = file_exists( $inputFile ) ? filemtime( $inputFile ) : false;
if ( $fileTime === false )// Refresh cache & input files if file is gone
{
unset( $inputFiles );
$data = false;
$this->reset();
break;
}
else if ( $fileTime > $currentTime )
{
eZDebug::writeError( 'Input file "' . $inputFile . '" has a timestamp higher then current time, ignoring to avoid infinite recursion!', __METHOD__ );
}
else if ( $fileTime > $cacheCreatedTime )// Refresh cache if file has been changed
{
$data = false;
$this->reset();
break;
}
}
eZDebug::accumulatorStop( 'ini_check_mtime' );
}
}
if ( $data )// if we have cache data on this point, use it
{
$this->Charset = $data['charset'];
$this->ModifiedBlockValues = array();
if ( $placement )
$this->BlockValuesPlacement = $data['val'];
else
$this->BlockValues = $data['val'];
unset( $data );
}
else
{
if ( !isset( $inputFiles ) )// use $inputFiles from cache if defined
{
eZDebug::accumulatorStart( 'ini_find_files', 'Ini load', 'Find INI Files' );
$this->findInputFiles( $inputFiles, $iniFile );
eZDebug::accumulatorStop( 'ini_find_files' );
if ( count( $inputFiles ) === 0 )
{
eZDebug::accumulatorStop( 'ini' );
return false;
}
}
eZDebug::accumulatorStart( 'ini_files_parse', 'Ini load', 'Parse' );
$this->parse( $inputFiles, $iniFile, false, $placement );
eZDebug::accumulatorStop( 'ini_files_parse' );
eZDebug::accumulatorStart( 'ini_files_save', 'Ini load', 'Save Cache' );
$cacheSaved = $this->saveCache( $cachedDir, $cachedFile, $placement ? $this->BlockValuesPlacement : $this->BlockValues, $inputFiles, $iniFile );
eZDebug::accumulatorStop( 'ini_files_save' );
if ( $cacheSaved )
{
// Write log message to storage.log
eZLog::writeStorageLog( $fileName, $cachedDir );
}
}
eZDebug::accumulatorStop( 'ini' );
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:101,代码来源:ezini.php
示例18: startCacheGeneration
/**
* Starts cache generation for the current file.
*
* This is done by creating a file named by the original file name, prefixed
* with '.generating'.
*
* @return bool false if the file is being generated, true if it is not
*/
public function startCacheGeneration()
{
$generatingFilePath = $this->filePath . '.generating';
$ret = self::$dbbackend->_startCacheGeneration( $this->filePath, $generatingFilePath );
// generation granted
if ( $ret['result'] == 'ok' )
{
eZClusterFileHandler::addGeneratingFile( $this );
$this->realFilePath = $this->filePath;
$this->filePath = $generatingFilePath;
$this->generationStartTimestamp = $ret['mtime'];
return true;
}
// failure: the file is being generated
elseif ( $ret['result'] == 'ko' )
{
return $ret['remaining'];
}
// unhandled error case, should not happen
else
{
eZLog::write( "An error occured starting cache generation on '$generatingFilePath'", 'cluster.log' );
return false;
}
}
开发者ID:nottavi,项目名称:ezpublish,代码行数:34,代码来源:ezdbfilehandler.php
示例19: basename
$img_name = basename( $img );
$img_extension = strtolower( substr( strrchr( $img_name, "." ), 1 ) );
switch( $file_extension )
{
case "gif":
$img_type = "image/gif";
break;
case "png":
$img_type = "image/png";
break;
case "jpeg":
case "jpg":
$img_type = "image/jpg";
break;
default:
$img_type = "image/jpg";
}
$fp = fopen( $img, 'rb' );
header( 'Content-Type: ' . $img_type );
header( 'Content-Length: ' . filesize( $img ) );
fpassthru( $fp );
if( !file_exists( $img ) )
eZLog::write( "Image not found: $img", 'warning.log' );
eZExecution::cleanExit();
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:image.php
示例20: execute
function execute($process, $event)
{
$http = eZHTTPTool::instance();
$siteINI = eZINI::instance('site.ini');
$shopINI = eZINI::instance('shop.ini');
$payoneINI = eZINI::instance('xrowpayone.ini');
$processParams = $process->attribute('parameter_list');
$errors = array();
$process_id = $process->ID;
//get the current order
$order_id = $processParams['order_id'];
$order = eZOrder::fetch($order_id);
//checking if its only a redirect and so the preauthorisation is already finished
$paymentObj = xrowPaymentObject::fetchByOrderID($order_id);
if (is_object($paymentObj) && $paymentObj->approved()) {
//now disapprove again because its 3d CC payment and its only paid when capture is successful
$paymentObj->reject();
xrowPayoneCreditCardGateway::setPaymentMethod($order);
eZLog::write("SUCCESS in step 2 ('preauthorisation') ::3D Secure Card detected - FINISHED :: for order ID " . $order_id, $logName = 'xrowpayone.log', $dir = 'var/log');
return eZWorkflowType::STATUS_ACCEPTED;
}
//STEP 2: preauthorisation
if ($http->hasPostVariable('pseudocardpan')) {
//fetching settings
$pseudocardpan = $http->postVariable('pseudocardpan');
$site_url = $siteINI->variable('SiteSettings', 'SiteURL');
$aid = $payoneINI->variable('GeneralSettings', 'AID');
$mid = $payoneINI->variable('GeneralSettings', 'MID');
$portal_id = $payoneINI->variable('GeneralSettings', 'PortalID');
$mode = $payoneINI->variable('GeneralSettings', 'Mode');
$key = $payoneINI->variable('GeneralSettings', 'Key');
$algorithm = $payoneINI->variable('GeneralSettings', 'Algorithm');
$api_version = $payoneINI->variable('GeneralSettings', 'APIVersion');
$response_type = $payoneINI->variable('GeneralSettings', 'ResponseType');
$cc_3d_secure_enabled = $payoneINI->variable('CC3DSecure', 'Enabled');
$error_url = $payoneINI->variable('CC3DSecure', 'ErrorURL');
$success_url = $payoneINI->variable('CC3DSecure', 'SuccessURL');
$siteaccess = $GLOBALS['eZCurrentAccess'];
$siteaccess = $siteaccess["name"];
//prepare some parameter values
$error_url = "https://" . $site_url . "/" . $siteaccess . "/" . $error_url . "/orderID/" . $order_id;
$success_url = "https://" . $site_url . "/" . $siteaccess . "/" . $success_url . "/orderID/" . $order_id;
$order_total_in_cent = (string) $order->totalIncVAT() * 100;
$currency_code = $order->currencyCode();
$order_xml = simplexml_load_string($order->DataText1);
$country_alpha3 = (string) $order_xml->country;
$country = eZCountryType::fetchCountry($country_alpha3, "Alpha3");
$country_alpha2 = $country["Alpha2"];
$last_name = (string) $order_xml->last_name;
//create hash array
$hash_array["aid"] = $aid;
$hash_array["mid"] = $mid;
$hash_array["portalid"] = $portal_id;
$hash_array["api_version"] = $api_version;
$hash_array["mode"] = $mode;
$hash_array["request"] = "preauthorization";
$hash_array["responsetype"] = $response_type;
$hash_array["clearingtype"] = "cc";
$hash_array["reference"] = $order_id;
$hash_array["amount"] = $order_total_in_cent;
$hash_array["currency"] = $currency_code;
if ($cc_3d_secure_enabled == "true") {
$hash_array["successurl"] = $success_url;
$hash_array["errorurl"] = $error_url;
}
//please note: country, lastname and pseudocardpan are not needed to be added to the hash because they are not allwoed (p.25 client doc)
//create param array
$param_array["aid"] = $aid;
$param_array["mid"] = $mid;
$param_array["portalid"] = $portal_id;
$param_array["api_version"] = $api_version;
$param_array["mode"] = $mode;
$param_array["request"] = "preauthorization";
$param_array["responsetype"] = $response_type;
$param_array["hash"] = xrowPayoneHelper::generate_hash($algorithm, $hash_array, $key);
$param_array["clearingtype"] = "cc";
$param_array["reference"] = $order_id;
$param_array["amount"] = $order_total_in_cent;
$param_array["currency"] = $currency_code;
$param_array["lastname"] = urlencode($last_name);
$param_array["country"] = $country_alpha2;
$param_array["pseudocardpan"] = $pseudocardpan;
if ($cc_3d_secure_enabled == "true") {
$param_array["successurl"] = $success_url;
$param_array["errorurl"] = $error_url;
}
//sort params in alphabetic order
ksort($param_array);
$parameter_string = "?";
foreach ($param_array as $key => $parameter) {
$parameter_string .= $key . "=" . $parameter . "&";
}
$url = "https://secure.pay1.de/client-api" . $parameter_string;
if ($siteINI->hasVariable('ProxySettings', 'ProxyServer') && $siteINI->variable('ProxySettings', 'ProxyServer') != "") {
$proxyserver = $siteINI->variable('ProxySettings', 'ProxyServer');
//now get the proxy url
if (strpos($proxyserver, "://") !== false) {
$proxy_parts = explode("://", $proxyserver);
$proxyserver = $proxy_parts[1];
}
//.........这里部分代码省略.........
开发者ID:xrowgmbh,项目名称:xrowpayone,代码行数:101,代码来源:xrowpayonecreditcardgateway.php
注:本文中的eZLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论