本文整理汇总了PHP中Logger::Notice方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::Notice方法的具体用法?PHP Logger::Notice怎么用?PHP Logger::Notice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logger
的用法示例。
在下文中一共展示了Logger::Notice方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Query
function Query($querid, $query, $postfields = NULL, $extras = NULL)
{
if (!empty($query) && preg_match("/^https?:\\/\\//", $query)) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if ($postfields) {
# $custom_request="POST /boomsvc30/SimpleTxEmail.asmx HTTP/1.1";
# curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $custom_request);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
} else {
curl_setopt($ch, CURLOPT_HTTPGET, 1);
}
if ($extras['timeout']) {
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $extras['timeout']);
}
if ($extras['headers']) {
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array($extras['headers']));
} else {
curl_setopt($ch, CURLOPT_HEADER, 0);
}
#echo "[QUERY]".$query."[QUERY]";
#echo "[POSTFIELDS]".$postfields ."[POSTFIELDS]";
#echo "[HEADERS]".$extras['headers']."[HEADERS]";
Logger::Notice("Remotefile Wrapper requesting URL: {$query}");
if (!empty($postfields)) {
Logger::Debug($postfields);
}
if (!empty($extras['headers'])) {
Logger::Debug($extras['headers']);
}
$ret = curl_exec($ch);
if (curl_errno($ch)) {
$ret = curl_errno($ch) . "<br />" . curl_error($ch);
Logger::Error($ret);
}
curl_close($ch);
}
#echo "[RETURN]".($ret)."[RETURN]";
return $ret;
}
示例2: add
static function add($args)
{
if (empty($args["type"])) {
$args["type"] = "component";
}
$browser = !empty($args["browser"]) ? $args["browser"] : "all";
$priority = !empty($args["priority"]) ? $args["priority"] : 2;
if (!isset(self::$dependencies[$priority]) || !is_array(self::$dependencies[$priority])) {
self::$dependencies[$priority] = array();
}
//self::$dependencies[$args["type"]][] = Dependency::create($args["type"], $args);
$dep = Dependency::create($args["type"], $args);
if (!isset(self::$dependencies[$priority][$browser][$args["type"]][$dep->id()])) {
self::$dependencies[$priority][$browser][$args["type"]][$dep->id()] = $dep;
if (Logger::$enabled) {
Logger::Notice("Added {$args["type"]} dependency ({$browser}): '{$dep->content()}'");
}
}
}
示例3: delete
/**
* This method is used to delete record(s) from
* a table in the db.
*
* @param string the table name
* @param string the where clause condition
* NOTE: this doesn't include the 'where' word.
* Example: 'siteid=:siteid and foo=:foo'
* @param array the bind vars that live in the where clause
* Example: array(':siteid' => 69,
* ':foo' => 'blah blah');
* @return boolean TRUE = success
*/
public function delete($table, $where_condition = NULL, $bind_vars = array())
{
$sql = 'DELETE FROM ' . $table;
if (!is_null($where_condition)) {
$sql .= ' WHERE ' . $where_condition;
Logger::Notice("Execute query: '" . $sql . "' " . print_ln($bind_vars, true));
//we now have to prepare the query
//and bind all of the values.
try {
$stmt = $this->db->prepare($sql);
} catch (PDOException $e) {
//throw new DataBaseException($e->getMessage(), $e->getCode(), $sql, $bind_vars);
throw $e;
}
//ok now bind the parameters
//first bind the user provided vars
if (!empty($bind_vars)) {
$i = 1;
foreach ($bind_vars as $key => $value) {
// determine if this is binding by ? or by :name
$key = $key[0] == ":" ? $key : $i;
$stmt->bindValue($key, $value);
$i++;
}
}
} else {
//we now have to prepare the query
//and bind all of the values.
$stmt = $this->db->prepare($sql);
}
//and now execute it!
$result = $stmt->execute();
Logger::Debug("Database::delete() - {$sql}");
return $result;
}
示例4: LoadModel
function LoadModel()
{
//$cfg = ConfigManager::singleton();
//$fname = $cfg->locations["config"] . "/model/" . $this->name . ".model";
$fname = "./config/model/" . $this->name . ".model";
if (file_exists($fname)) {
$ormfile = file_get_contents($fname);
$filesize = strlen($ormfile);
$modelcfg = json_decode($ormfile);
if (!empty($modelcfg->classes)) {
$this->classes = $modelcfg->classes;
}
} else {
Logger::Notice("OrmModel: Couldn't find model config '{$fname}'");
}
}
示例5: LazyOpen
function LazyOpen($num = 0)
{
if ($this->lazy && empty($this->blacklisted[$num])) {
$pingstatus = $this->Ping($num);
if ($pingstatus) {
$ret = true;
} else {
// Not connected, let's see what we can do
Logger::Notice("Establishing connection: {$this->name} (" . get_class($this) . ")");
if ($this->Open($num)) {
$ret = true;
} else {
$this->blacklisted[$num] = true;
$ret = false;
}
}
} else {
$ret = false;
}
return $ret;
}
示例6: Rollback
static function Rollback($id)
{
Profiler::StartTimer("DataManager::Rollback()");
$queryid = new DatamanagerQueryID($id);
if ($source =& DataManager::PickSource($queryid)) {
$ret = $source->Rollback($queryid);
}
Profiler::StopTimer("DataManager::Rollback()");
Logger::Notice("Rolled back transaction for queryid {$queryid->id}");
return $ret;
}
示例7: create_new_persist_record
/**
* Create a new persist record in the userdata.usersssion table
*/
protected function create_new_persist_record($force = false)
{
// if bot, don't create a db record
if (function_exists("isBot") && isBot()) {
return;
}
// insert a record into userdata.usersession
if ($force || !empty($_SESSION["persist"])) {
$_SESSION["persist"]["has_db_record"] = true;
$pdata_serialize = serialize($_SESSION["persist"]);
$ip = $_SERVER['REMOTE_ADDR'];
Logger::Notice("Creating session in database");
$result = DataManager::QueryInsert($this->sessionsource . "#{$this->fluid}", $this->sessiontable, array($this->fluid => array("fl_uid" => $this->fluid, "data" => $pdata_serialize, "ip_addr" => $ip)));
// set the $_SESSION
$this->has_db_record = true;
}
}
示例8: init
//.........这里部分代码省略.........
// Deal with errant mis-named 'fl_uid' cookies...
// (this code can safely be removed in a year or so, e.g. February 2010)
// ^^^ perhaps not?
if ($fluid_data_recover = explode(",", $_COOKIE['fl_uid'])) {
$this->fluid = any($this->fluid, $fluid_data_recover[0]);
$this->session_count = $fluid_data_recover[1];
$this->last_access = $fluid_data_recover[2];
//setcookie('fl_uid', '', 0, "/", $domain); // delete the errant cookie
}
$this->session_count++;
if (time() > $this->last_access + 86400) {
$this->days_since_last_session = floor((time() - $this->last_access) / 86400);
$this->last_access = time();
$this->first_session_for_day = 1;
}
$fluid_data = $this->fluid . ',' . $this->session_count . ',' . $this->last_access;
if (!headers_sent()) {
setcookie('fl-uid', $fluid_data, time() + 31536000, "/", $domain);
// (update the permanent cookie)
}
}
// debugging
// print "<hr>In SessionManager::init() - cache_obj extended stats = " . print_pre($this->cache_obj->GetExtendedStats());
/**
* First, check to see if there is an entry in the memcache for this fluid.
* If so, use it.
* If not, query the DB to get the persistent session data.
* If not in the DB, create a new session.
*/
$this->flsid = session_id();
//$session_memcache = $this->cache_obj->get($this->flsid);
$session_memcache = DataManager::fetch("memcache.session#{$this->flsid}", $this->flsid);
//$tmpsession = unserialize($session_memcache);
if (!empty($session_memcache["fluid"])) {
$this->fluid = $session_memcache["fluid"];
}
if (empty($session_memcache) && !$this->is_new_user) {
/*
$result = $this->data->Query("db.userdata.usersession.{$this->flsid}:nocache",
"SELECT data FROM usersession.usersession WHERE fl_uid=:fl_uid LIMIT 1",
array(":fl_uid" => $this->fluid));
*/
$result = DataManager::QueryFetch($this->sessionsource . "#{$this->fluid}", $this->sessiontable, array("fl_uid" => $this->fluid));
if ($result && count($result) == 1) {
$data = current($result);
$_SESSION["persist"] = unserialize($data["data"]);
$this->has_db_record = true;
if (!$_SESSION["persist"]["has_db_record"]) {
$_SESSION["persist"]["has_db_record"] = true;
}
}
} else {
$_SESSION = $session_memcache;
//Logger::Error(print_r($_SESSION, true));
}
$this->has_db_record = isset($_SESSION["persist"]) && $_SESSION["persist"]["has_db_record"] ? true : false;
// Store permenant session id, actual (temporary) session id,
// and create pointers to $_SESSION memory space
$this->flsid = session_id();
$this->persist =& $_SESSION["persist"];
$this->temporary =& $_SESSION["temporary"];
// get from the persist session data if this is a new or registered user
$userid = $_SESSION["persist"]["user"]["userid"];
$usertype = $_SESSION["persist"]["user"]["usertype"];
$userTypeArray = User::$usertypes;
if (class_exists("PandoraLog")) {
$pandoraUserTypeNum = any($userTypeArray[$usertype], 0);
// log this into Pandora
$pandora_session = array("timestamp" => time(), "session_id" => $this->flsid, "fluid" => $this->fluid, "is_new_user" => $this->is_new_user, "is_registered_user" => $userid ? 1 : 0, "ip_addr" => $_SERVER['REMOTE_ADDR'], "user_agent" => $_SERVER['HTTP_USER_AGENT'], "referrer_url" => $_SERVER['HTTP_REFERER'], "landing_page_url" => "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], "referrer_id" => $webapp->request["args"]["rid"], "widget_id" => $webapp->request["args"]["wid"], "user_registration_id" => "{$pandoraUserTypeNum}.{$userid}", "version" => 0, "cobrand" => $this->root->cobrand, "first_session_for_day" => $this->first_session_for_day, "session_count" => $this->session_count, "days_since_last_session" => $this->days_since_last_session);
// log this session for data warehouse (once per session)
if (!$has_flsid) {
//store the session start time in session
$_SESSION['session_start_time'] = time();
$pandora->addData("session", $pandora_session);
} else {
Logger::Notice("Pandora: Session already has an flsid. Current start time from session is: " . var_export($_SESSION['session_start_time'], true));
if (!array_key_exists('session_start_time', $_SESSION)) {
$_SESSION['session_start_time'] = time();
$pandora->addData("session", $pandora_session);
} else {
Logger::Notice("Pandora: Session already has an flsid. Current start time from session is: " . var_export($_SESSION['session_start_time'], true));
if (!array_key_exists('session_start_time', $_SESSION)) {
$_SESSION['session_start_time'] = time();
Logger::Warn("Pandora: Set or reset the session start time as one did not exist before. Time is: " . var_export($_SESSION['session_start_time'], true));
} else {
Logger::Notice("Pandora: Session start time was not reset. Time is: " . var_export($_SESSION['session_start_time'], true));
}
}
}
}
//save session data once per session
// if(!array_key_exists('pandora_session_data_added', $_SESSION)) {
// $pandora->addData("session", $pandora_session);
// $_SESSION['pandora_session_data_added'] = true;
// }
$_SESSION["fluid"] = $this->fluid;
// set the script session ID
$this->flssid = $this->generate_fluid();
Profiler::StopTimer("SessionManager::Init()");
}