本文整理汇总了PHP中Trace类的典型用法代码示例。如果您正苦于以下问题:PHP Trace类的具体用法?PHP Trace怎么用?PHP Trace使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Trace类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($TraceURI, $ModelName)
{
$this->TraceURI = $TraceURI;
$this->ModelName = $ModelName;
$Trace = new Trace($TraceURI);
$this->BaseURI = $Trace->getBaseURI();
//$this->BaseURI="http://ktbs.univ-lyon1.fr/semasema34/";
$this->Obsels = $Trace->getObsels();
//$TraceInfo = RestfulHelper::getInfo($TraceURI);
//$this->BaseURI= json_decode($TraceInfo,true)['inBase'];
//$ObselListInfo = RestfulHelper::getInfo(json_decode($TraceInfo,true)['hasObselList']);
// $this->Obsels = json_decode($ObselListInfo,true)['obsels'];
}
示例2: __construct
function __construct($BaseURI, $TraceName, $TraceSourceName, $ModelURI)
{
$this->TraceName = $TraceName;
$this->BaseURI = $BaseURI;
$this->TraceSourceName = $TraceSourceName;
$this->TraceURI = $this->BaseURI . $this->TraceName;
if ($ModelURI == null) {
$trace = new Trace($this->TraceURI);
$this->ModelURI = $trace->getModel();
} else {
$this->ModelURI = $ModelURI;
}
}
示例3: handle
function handle(Trace $trace)
{
$controllerName = $trace->getRequiredParameter(self::PARAMETER_CONTROLLER_NAME);
$controllerClassName = $this->getControllerClassName($controllerName);
if (!class_exists($controllerClassName, true)) {
throw new TraceException(sprintf('unknown controller %s', $controllerClassName), $trace);
}
if (!in_array('IController', class_implements($controllerClassName, true))) {
throw new TraceException(sprintf('%s is not a controller due it does not implement IController', $controllerClassName), $trace);
}
$controllerObject = $this->getControllerInstance($controllerClassName, $trace);
$controllerObject->handle($trace);
}
示例4: checkCredentials
protected function checkCredentials(Trace $trace)
{
if (!$this->clientToken) {
$this->clientToken = new ClientToken($trace->getWebContext()->getServer()->getClientHash(true));
$request = $trace->getWebContext()->getRequest();
try {
$authkey = $request[self::ADMIN_AUTHORIZED_COOKIE_NAME];
$this->clientToken->getData($authkey);
$this->setAdminAuthorized();
} catch (Exception $e) {
$this->setAdminNotAuthorized();
}
}
}
示例5: fatalErrorHandler
public function fatalErrorHandler()
{
$error = error_get_last();
$code = $this->getArrayValue($error, "type");
if ($code === E_ERROR) {
$message = $error["message"];
$file = $error["file"];
$line = $error["line"];
$traces = [];
$trace = new Trace();
$trace->setFile($file);
$trace->setLine($line);
$traces[] = $trace;
$this->log($message, $traces);
}
}
示例6: Show
public static function Show()
{
$viewName = "";
$includeHeaderAndFooter = true;
for ($i = 0; $i < func_num_args(); $i++) {
$testArg = func_get_arg($i);
if (is_string($testArg) && $i == 0) {
$viewName = $testArg;
} else {
if (is_bool($testArg)) {
$includeHeaderAndFooter = $testArg;
} else {
$_ViewData = $testArg;
}
}
}
$callTrace = Trace::GetLastMethodCall();
$viewPath = self::parseViewPath($viewName, $callTrace);
if (self::verifyView($viewPath)) {
if ($includeHeaderAndFooter) {
self::includeHeader();
}
include $viewPath;
if ($includeHeaderAndFooter) {
self::includeFooter();
}
} else {
Router::UnknownResource();
}
}
示例7: saveImg
public function saveImg()
{
Trace::output($this->traceID, "saveImg");
//----------------------------------------------------------
//init var
//----------------------------------------------------------
$chk = array("bool" => 1);
//----------------------------------------------------------
$img = str_replace('data:image/png;base64,', '', $this->img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$date = new DateTime();
//----------------------------------------------------------
if (is_null($imgName) || $encrypt) {
$imgName = alphaID($date->getTimestamp()) . ".png";
}
//----------------------------------------------------------
if (file_exists($this->dir)) {
FileFolder::file_put_contents($this->dir . $imgName, $data);
$chk["result"] = $this->fullURL . $imgName;
} else {
$chk['bool'] = false;
$chk['message'] = $this->fullURL . " does no exist!!";
}
//----------------------------------------------------------
return $chk;
}
示例8: __construct
function __construct($conf)
{
Trace::add_trace('construct class', __METHOD__);
self::$conf = $conf;
self::$conn = new DB($conf);
$this->Func = new Func();
}
示例9: dojetDidStart
public function dojetDidStart()
{
if (MRuntime::currentRuntime() === C_RUNTIME_SAE) {
Trace::setDelegate(new LibSAETrace());
}
parent::dojetDidStart();
}
示例10: getData
public static function getData($file)
{
Trace::output(self::$traceID, "getData");
//----------------------------------------------------------
//init var
//----------------------------------------------------------
$chk = array("bool" => true, 'traceID' => "getData");
//----------------------------------------------------------
$swfheader = new swfheader($file);
$file_swf = new File_SWF($file);
//----------------------------------------------------------
if ($file_swf->is_valid()) {
$stat = $file_swf->stat();
$fileSize = $stat['fileSize'][0];
$swfheader->size = $fileSize;
$chk['result'] = $swfheader;
} else {
$chk['bool'] = false;
$chk['error'] = true;
$chk['message'] = "swf was no valid";
}
//----------------------------------------------------------
$chk['output'] = Trace::$output;
//----------------------------------------------------------
return $chk;
}
示例11: load
/** Load Dictionary
*
* @param Array $load - Dictionary array
*
*/
public static function load($load)
{
Trace::add_trace('construct class', __METHOD__);
self::$dic = isset($load['dic']) ? $load['dic'] : array();
self::$hooks = isset($load['js']) ? $load['js'] : array();
self::$lang = isset($load['lang']) ? $load['lang'] : array();
}
示例12: testExecute
public function testExecute()
{
$instance = new Trace('');
$session = $this->getMock('Pry\\Session', ['getCallStack'], [__FILE__]);
$callStack = $this->getMock('Pry\\CallStack', ['getTrace']);
$trace = [['class' => 'A', 'type' => '->', 'function' => 'a', 'args' => ['one', 'two'], 'file' => '/a.php', 'line' => 1337], ['function' => 'b', 'args' => ['one'], 'file' => '/b.php', 'line' => 321], ['class' => 'C', 'type' => '::', 'function' => 'c', 'args' => [], 'file' => '/c.php', 'line' => 42]];
$callStack->expects($this->once())->method('getTrace')->will($this->returnValue($trace));
$session->expects($this->once())->method('getCallStack')->will($this->returnValue($callStack));
ob_start();
$status = $instance->execute($session);
$actual = ob_get_contents();
ob_end_clean();
$expected = [' A->a($0,$1) /a.php 1337 ', ' b($0) /b.php 321 ', ' C::c() /c.php 42 ', ''];
$this->assertTrue($status);
$this->assertEquals(implode(PHP_EOL, $expected), $actual);
# @TODO check $actual for correct contents
}
示例13: __construct
public function __construct($urlInfo = array())
{
parent::__construct();
//
if (!empty($urlInfo)) {
$this->aUrlInfo = $urlInfo;
}
$this->addGet('id', 'show');
Trace::addMessage('DB', '<strong>Старт контроллера</strong>');
}
示例14: trace
/**
* Esta función recibe el tipo de Trace y el mensaje para guardar el registro en la base de datos
* @param string $controller
* @param string $action
* @param int $date
* @param int $ip
*/
public function trace($status, $msg)
{
$controller = $this->dispatcher->getControllerName();
$action = $this->dispatcher->getActionName();
$date = time();
$ip = $_SERVER['REMOTE_ADDR'];
$user = 1;
$operation = $controller . '::' . $action;
Trace::createTrace($user, $status, $operation, $msg, $date, $ip);
}
示例15: record
/**
* 记录日志 并且会过滤未经设置的级别
* @param string $message 日志信息
* @param string $level 日志级别
* @param boolean $record 是否强制记录
* @return void
*/
static function record($message, $level = self::ERR, $record = false)
{
if ($record || in_array($level, config('LOG_RECORD_LEVEL'))) {
$now = date(self::$format);
self::$log[] = "{$now} {$level}: {$message}\r\n";
if (config('APP_DEBUG')) {
//如果为debug模式的话
loadCore('Trace');
Trace::addLog("{$now} {$level}: {$message}");
}
}
}