本文整理汇总了PHP中Debugger::log方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::log方法的具体用法?PHP Debugger::log怎么用?PHP Debugger::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debugger
的用法示例。
在下文中一共展示了Debugger::log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* add method
*
* @return void
*/
public function add()
{
if ($this->request->is('post')) {
//Check to see if the user has selected a file
$this->Upload->set($this->request->data);
if ($this->Upload->validates()) {
//http://milesj.me/code/cakephp/uploader
$this->Uploader = new Uploader(array('tempDir' => TMP, 'baseDir' => WWW_ROOT, 'uploadDir' => 'files/uploads/' . $userFolder . '/', 'maxNameLength' => 200));
if ($data = $this->Uploader->upload('fileName')) {
// Upload successful, do whatever
//debug($data);
//Add pertinent data to the array
$this->request->data['Upload'] = $data;
$this->request->data['Upload']['active'] = 1;
//Disable until the user pays
$this->request->data['Upload']['user_id'] = $this->Upload->User->getLastInsertID();
//$this->request->data['Upload']['caption'] = $this->request->data['Upload']['custom_name'];
$this->Upload->create();
if ($this->Upload->save($this->request->data)) {
//Set the upload id
$this->request->data['Upload']['id'] = $this->Upload->getLastInsertID();
} else {
$this->Session->setFlash(__('Bummer :( Your file could NOT be uploaded.'));
$this->log('The file could not be uploaded.', 'upload_debug');
Debugger::log($data);
}
}
}
}
$works = $this->Upload->Work->find('list');
$this->set(compact('works'));
}
示例2: activate
function activate()
{
$setup = Config::get('RPC');
$class = URL::getPathPart($setup['class']);
$method = URL::getPathPart($setup['method']);
list($action, $type) = explode('.', URL::getPathPart($setup['action']), 2);
$path = $setup["path"] . "/" . $class . "/" . ucwords($method) . ucwords($action) . "Controller";
if (file_exists(Loader::getPath("controller", $path))) {
Debugger::log("CONTROLLER: <span style=\"color: #990000\">" . ucwords($method) . ucwords($action) . "Controller</span>");
$controller = Loader::loadNew("controller", $path);
$controller->activate();
if (is_callable(array($controller, $type))) {
echo $controller->{$type}();
}
return;
}
$controller_class = ucwords($class) . ucwords($method) . ucwords($action) . "Controller";
Debugger::log("CONTROLLER: <span style=\"color: #990000\">{$controller_class}</span>");
if (file_exists(Loader::getPath("controller", "{$setup['path']}/{$controller_class}"))) {
$controller = Loader::loadNew("controller", "{$setup['path']}/{$controller_class}");
$controller->activate();
} else {
Loader::load("utility", "Server");
$ip = Server::getIP();
$self = Server::getSelf();
Debugger::log("Possible RPC Injection: RPC call to non-existent controller at path {$setup["path"]}/{$controller_class} {$ip} {$self}");
error_log("Possible RPC Injection: RPC call to non-existent controller at path {$setup['path']}/{$controller_class} {$ip} {$self}");
}
}
示例3: actionCallback
public function actionCallback($oauth_token)
{
try {
$login_secret = $this->getSession('oauth')->login_secret;
if (!$oauth_token) {
echo "Error! There is no OAuth token!";
exit;
}
if (!$login_secret) {
echo "Error! There is no OAuth secret!";
exit;
}
$this->oauth->enableDebug();
$this->oauth->setToken($oauth_token, $login_secret);
$access_token_info = $this->oauth->getAccessToken(self::ACCESS_TOKEN_URL);
$this->getSession('oauth')->login_secret = false;
$this->getSession('oauth')->token = $access_token_info['oauth_token'];
$this->getSession('oauth')->secret = $access_token_info['oauth_token_secret'];
$this->getUserDetailsAndLoginUser();
} catch (OAuthException $E) {
Debugger::log($E);
//zalogujeme for sichr
echo "OAuth login failed. Please, contact administrator.";
$this->terminate();
}
}
示例4: deleteTag
/**
* Odstraneni konkretniho tagu
* @param \App\Model\Entities\Tag $tag
* @return boolean
*/
public function deleteTag(Entities\Tag $tag)
{
try {
$this->em->remove($tag);
$result = $this->em->flush();
} catch (\Doctrine\ORM\ORMException $e) {
Debugger::log($e, Debugger::INFO);
$result = FALSE;
}
return $result;
}
示例5: route
function route()
{
if (isset($this->router)) {
$router = get_class($this->router);
Config::set('Router', $router);
Debugger::log("ROUTER: <span style=\"color:#72b618;\">{$router}</span>");
$this->router->route();
} else {
Debugger::error(new Exception('Cannot route! No router set.'));
}
}
示例6: activate
function activate()
{
if (!Config::isLive() && file_exists($this->bypass)) {
Debugger::log("<span style='color: #939393'>Follow {$this->type} Redirect to:</span> <br><a href='{$this->url}' style='color: white;'>{$this->url}</a> ");
exit;
} else {
header("Location: {$this->url}", true, $this->type);
exit;
}
return;
}
示例7: __construct
function __construct($dbobject_class_name, Database $db, $table_name, $database_name = null)
{
$reflection = new ReflectionClass($dbobject_class_name);
if ($reflection->isSubclassOf("DBObject")) {
$this->managed_object = $dbobject_class_name;
$this->db = $db;
$this->table = $table_name;
if (isset($database_name)) {
$this->database_name = $database_name;
}
} else {
Debugger::log("cannot create manager from {$dbobject_class_name}");
}
}
示例8: renderDefault
/**
* @param Exception
* @return void
*/
public function renderDefault($exception)
{
if ($this->isAjax()) {
// AJAX request? Just note this error in payload.
$this->payload->error = TRUE;
$this->terminate();
} elseif ($exception instanceof BadRequestException) {
$code = $exception->getCode();
$this->setView(in_array($code, array(403, 404, 405, 410, 500)) ? $code : '4xx');
// load template 403.latte or 404.latte or ... 4xx.latte
} else {
$this->setView('500');
// load template 500.latte
Debugger::log($exception, Debugger::ERROR);
// and log exception
}
}
示例9: login
private function login()
{
Loader::load('utility', 'session/Session');
Loader::load('model', 'com/passinggreen/member/Member');
$member = Member::findMemberWithEmail(addslashes(Request::getPost('email')));
$valid = false;
if (isset($member) && $member->isValid() && ($member->getLevel() == 'admin' || $member->getLevel() == 'superadmin' || $member->getLevel() == 'developer')) {
$valid = $member->validatePassword(Request::getPost('password'));
}
if ($valid) {
$member->recordLogin();
Session::instance()->setModelDefault($member);
Debugger::log('valid');
} else {
Debugger::log('invalid');
$this->setPageData('error', 'Incorrect username or password.');
$this->show_form();
}
}
示例10: detect_fatal_error
function detect_fatal_error()
{
$last_error = error_get_last();
if ($last_error && ($last_error['type'] == E_ERROR || $last_error['type'] == E_PARSE) && class_exists('Loader')) {
try {
Loader::load('utility', 'Template');
if (file_exists(Loader::getPath('view', 'FatalError'))) {
Debugger::log("Type {$last_error["type"]}: {$last_error["message"]} in {$last_error["file"]} on line {$last_error["line"]}");
ob_clean();
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
Template::insert('FatalError');
error_log("[Error Caught] {$last_error['message']} in {$last_error['file']} on line {$last_error['line']}");
ob_end_flush();
}
} catch (Exception $e) {
//echo "We've encountered an error. Please go back and try again.";
}
}
}
示例11: getTokens
public function getTokens()
{
if (!isset($this->tokens)) {
$this->tokens = array();
//build file path - check for absolute path first
$stop_words_full_path = "/var/www/script-repository/{$this->type}";
if (file_exists($stop_words_full_path)) {
$stops = @file($stop_words_full_path);
if (is_array($stops)) {
//scrub stops list
for ($i = 0, $imax = count($stops); $i < $imax; $i++) {
$stops[$i] = trim(strtolower(preg_replace('/\\W/', '', $stops[$i])));
}
$this->tokens = $stops;
}
//end if is_array
} else {
Debugger::log("{$stop_words_full_path} not found!");
}
}
//end if cache var not set
return $this->tokens;
}
示例12: __call
public function __call($name, $arguments)
{
/*
if($this->is_applying_sort($name))
{
$order = strtolower(substr($name,5,9)) == "ascending" ? "ASC" : "DESC";
Debugger::log($order);
$function = array($this->managed_object(), substr($name, $order == "ASC" ? 14 : 15));
Debugger::log($function);
if(method_exists($function[0],$function[1]))
{
Debugger::log($function[0] . "::" . $function[1] ." does exist.");
$this->applySort(call_user_func_array($function,null),$order);
return $this;
}
else
{
Debugger::log($function[0] . "::" . $function[1] ." does not exist.");
error_log($function[0] . "::" . $function[1] ." does not exist.");
}
}
else
*/
if ($this->is_applying_filter($name)) {
//Debugger::log("filter: $name");
$function = array($this->managed_object(), substr($name, 5));
if (method_exists($function[0], $function[1])) {
$this->applyFilter(call_user_func_array($function, $arguments));
return $this;
} else {
Debugger::log($function[0] . "::" . $function[1] . " does not exist.");
error_log($function[0] . "::" . $function[1] . " does not exist.");
}
}
trigger_error("Call to undefined method CassandraObjectManager->{$name}() on {$this->managed_object()}");
}
示例13: parseRedirect
private function parseRedirect($url, $redirect)
{
if (isset(self::$rules['dynamic'])) {
$dynamic = array_search($redirect, self::$rules['dynamic']);
}
$redirect = substr($redirect, 10);
$redirect = self::parsePath($redirect);
$to = $redirect['path'];
if (isset($redirect['scheme']) && isset($redirect['host'])) {
$to = "{$redirect['scheme']}://{$redirect['host']}{$to}";
}
//fix dynamic url
if (isset($redirect['dynamic'])) {
$to = str_replace($dynamic, $redirect['dynamic'], $to);
}
$to_query = array();
// replace any param tokens
if (isset($redirect['params'])) {
foreach ($redirect['params'] as $name => $val) {
if (preg_match('/^\\[(.*)\\]$/', $val, $match) === 1) {
$to_query[$name] = $url['params'][$match[1]];
unset($url['params'][$match[1]]);
}
}
}
// replace any other tokens
if (isset($url['params'])) {
foreach ($url['params'] as $name => $val) {
$to = str_replace("[{$name}]", $val, $to, $count);
if ($count == 1) {
unset($url['params'][$name]);
}
}
}
if (isset($url['params'])) {
$to_query = array_merge($to_query, $url['params']);
}
if (count($to_query) > 0) {
$to .= '?' . http_build_query($to_query);
}
Debugger::log("Redirecting to: {$to}");
Config::set('Redirect', $to);
return '/controller/RedirectController';
}
示例14: testLog
/**
* testLog method
*
* @return void
*/
public function testLog() {
if (file_exists(LOGS . 'debug.log')) {
unlink(LOGS . 'debug.log');
}
Debugger::log('cool');
$result = file_get_contents(LOGS . 'debug.log');
$this->assertRegExp('/DebuggerTest\:\:testLog/i', $result);
$this->assertRegExp("/'cool'/", $result);
unlink(LOGS . 'debug.log');
Debugger::log(array('whatever', 'here'));
$result = file_get_contents(LOGS . 'debug.log');
$this->assertRegExp('/DebuggerTest\:\:testLog/i', $result);
$this->assertRegExp('/\[main\]/', $result);
$this->assertRegExp('/array/', $result);
$this->assertRegExp("/'whatever',/", $result);
$this->assertRegExp("/'here'/", $result);
}
示例15: loadModel
protected function loadModel($model, $args = array(), $class = null)
{
Debugger::log("MODEL: <span style=\"color:#b147bf;\">{$model}</span>");
return Loader::loadNew('model', $model, $args, $class);
}