本文整理汇总了PHP中log_message函数的典型用法代码示例。如果您正苦于以下问题:PHP log_message函数的具体用法?PHP log_message怎么用?PHP log_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
//error_reporting(E_ALL);
log_message('debug', "Weixinapi Class Initialized.");
$this->CI =& get_instance();
$this->valid();
}
示例2: __construct
function __construct()
{
parent::__construct();
// Load language relations file
$this->config->load('languages');
$this->lang_path = APPPATH . '../lang';
$this->langname = $this->config->item('default_language');
if (!is_dir($this->lang_path)) {
log_message('ERROR', 'Language path is not a directory');
die;
}
// Defined language?
$lang_rels = $this->config->item('lang_rels');
if (!isset($lang_rels[$this->langname])) {
log_message('ERROR', 'Language ' . $this->langname . ' not registered');
$this->langname = 'en';
}
$this->lang_relations = $lang_rels[$this->langname];
if (FALSE === ($this->lang_contents = $this->parse_language($this->langname))) {
$this->extended_logs->message('ERROR', 'Language ' . $this->langname . ' not found');
$this->langname = 'en';
$this->lang_contents = $this->parse_language($this->langname);
}
// Locale
$this->setlocale();
// Set CodeIgniter language
$this->set_ci_language();
}
示例3: __construct
/**
* Class constructor
* @return void
*/
public function __construct()
{
$CFG =& load_class('Config', 'core');
log_message('info', 'Hooks Class Initialized');
if ($CFG->item('enable_hooks') === FALSE) {
return;
}
if (file_exists(COMMONPATH . 'config/hooks.php')) {
include COMMONPATH . 'config/hooks.php';
}
if (file_exists(COMMONPATH . 'config/' . ENVIRONMENT . '/hooks.php')) {
include COMMONPATH . 'config/' . ENVIRONMENT . '/hooks.php';
}
if (file_exists(APPPATH . 'config/hooks.php')) {
include APPPATH . 'config/hooks.php';
}
if (file_exists(APPPATH . 'config/' . ENVIRONMENT . '/hooks.php')) {
include APPPATH . 'config/' . ENVIRONMENT . '/hooks.php';
}
if (!isset($hook) || !is_array($hook)) {
return;
}
$this->hooks =& $hook;
$this->enabled = TRUE;
}
示例4: db_connect
/**
* Non-persistent database connection
*
* @param bool $persistent
* @return resource
*/
public function db_connect($persistent = FALSE)
{
$error = NULL;
$conn_id = $persistent === TRUE ? sqlite_popen($this->database, 0666, $error) : sqlite_open($this->database, 0666, $error);
isset($error) && log_message('error', $error);
return $conn_id;
}
示例5: extension
/**
* Load Extension
*
* This function loads the specified extension.
*
* @access public
* @param array $extensions specified extension
* @return void
*/
public function extension($extensions = array())
{
if (!is_array($extensions)) {
$extensions = array($extensions);
}
foreach ($extensions as $extension) {
$plugin = strtolower(str_replace('.php', '', $extension));
// If the extension is already loaded, continue on.
if (isset($this->_ci_extensions[$extension])) {
continue;
}
// Attempt to load the extension.
if (file_exists($extension_path = sprintf(APPPATH . 'extend/%s/main.php', $extension))) {
include $extension_path;
} else {
if (file_exists($extension_path = sprintf(BASEPATH . 'extend/%s/main.php', $extension))) {
include $extension_path;
} else {
show_error(sprintf('Unable to load the requested file: extend/%s/main.php', $extension));
}
}
// Initialize the plugin and log it.
$this->_ci_extensions[$extension] = new $plugin();
log_message('debug', sprintf('Extension loaded: %s', $plugin));
}
}
示例6: __construct
/**
* Constructor - Sets Preferences
*
* The constructor can be passed an array of config values
*/
public function __construct($config = array())
{
if (count($config) > 0) {
$this->initialize($config);
}
log_message('debug', "FTP Class Initialized");
}
示例7: CI_Pagination
/**
* Constructor
*
* @access public
* @param array initialization parameters
*/
function CI_Pagination($params = array())
{
if (count($params) > 0) {
$this->initialize($params);
}
log_message('debug', "Pagination Class Initialized");
}
示例8: load
/**
* Load a language file
*
* @access public
* @param mixed the name of the language file to be loaded. Can be an array
* @param string the language (english, etc.)
* @return mixed
*/
function load($langfile = '', $idiom = '', $return = FALSE)
{
$langfile = str_replace(EXT, '', str_replace('_lang.', '', $langfile)) . '_lang' . EXT;
if (in_array($langfile, $this->is_loaded, TRUE)) {
return;
}
if ($idiom == '') {
$CI =& get_instance();
$deft_lang = $CI->config->item('language');
$idiom = $deft_lang == '' ? 'english' : $deft_lang;
}
// Determine where the language file is and load it
if (file_exists(APPPATH . 'language/' . $idiom . '/' . $langfile)) {
include APPPATH . 'language/' . $idiom . '/' . $langfile;
} else {
if (file_exists(BASEPATH . 'language/' . $idiom . '/' . $langfile)) {
include BASEPATH . 'language/' . $idiom . '/' . $langfile;
} else {
show_error('Unable to load the requested language file: language/' . $idiom . '/' . $langfile);
}
}
if (!isset($lang)) {
log_message('error', 'Language file contains no data: language/' . $idiom . '/' . $langfile);
return;
}
if ($return == TRUE) {
return $lang;
}
$this->is_loaded[] = $langfile;
$this->language = array_merge($this->language, $lang);
unset($lang);
log_message('debug', 'Language file loaded: language/' . $idiom . '/' . $langfile);
return TRUE;
}
示例9: info_post
public function info_post()
{
//{{{
$this->load->library('user_auth');
$this->load->model('Follow', 'follow_m', TRUE);
try {
if (!$this->user_auth->is_user_login()) {
$this->response(array('error' => 'user did not login yet.'), 500);
} else {
$object_user_id = $this->session->userdata('user_id');
$user_id = $this->post('user_id', TRUE);
$has_follow = $this->post('has_follow', TRUE);
switch ($has_follow) {
case false:
$func_name = 'do_follow';
break;
case true:
$func_name = 'do_follow';
break;
}
$this->follow_m->{$func_name}($user_id, $object_user_id);
$this->response(array(), 200);
}
} catch (Exception $e) {
log_message('error', $e->getMessage());
$this->response(array('error' => ''), 500);
}
}
示例10: __construct
/**
* 构造函数
*
* @access public
* @return void
*/
public function __construct()
{
parent::__construct();
/** 主题皮肤所在路径 */
$this->themes_dir = FCPATH . ST_THEMES_DIR . DIRECTORY_SEPARATOR;
log_message('debug', "STBLOG: Themes Model Class Initialized");
}
示例11: get_access_token
public function get_access_token($provider, $grant = 'authorization_code', $code){
if (! $provider) {
log_message('error', __FILE__.' '.__LINE__.' Provider details not provided by the client for fetching Acess Token.');
return FALSE;
}
$params = [
'grant_type' => $grant,
'client_id' => self::$SOCIAL_MEDIA_CREDENTIALS[$provider]['client_id'],
'client_secret' => self::$SOCIAL_MEDIA_CREDENTIALS[$provider]['client_secret'],
'redirect_uri' => $this->redirect_url,
'code' => $code
];
$params_string = http_build_query($params,'','&');
$access_token_url = self::$SOCIAL_MEDIA_CREDENTIALS[$provider]['graph_url'].'oauth/access_token';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $access_token_url);
curl_setopt($ch, CURLOPT_POST, count($params));
curl_setopt($ch, CURLOPT_POSTFIELDS, $params_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_FAILONERROR, FALSE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 100);
$output = curl_exec($ch);
curl_close($ch);
parse_str($output, $output_arr);
return $output_arr;
}
示例12: buy_product
public function buy_product($id, $amount, $product, $user_id, $user_money)
{
//Market Update
$this->db->set('amount', 'amount -' . $amount, FALSE);
$this->db->where('id', $id);
$this->db->update('market');
//Company Update
$this->db->select('money');
$query = $this->db->get_where('companies', array('id' => $product->company_id), 1);
if ($query->num_rows() === 1) {
foreach ($query->result() as $company) {
}
} else {
$return = NULL;
log_message('error', 'function buy_product() in /megapublik/models/market_m.php has received bad data for $product->company_id.');
}
$company_money = unserialize($company->money);
$currency_money = money($company_money, $product->currency);
$new_money[$product->currency] = round($currency_money + $amount * $product->price, 2);
$company_money = array_merge($company_money, $new_money);
$this->db->set('money', serialize($company_money));
$this->db->where('id', $product->company_id);
$this->db->update('companies');
//User Update
$currency_money = money($user_money, $product->currency);
$new_money[$product->currency] = round($currency_money - $amount * $product->price, 2);
$user_money = array_merge($user_money, $new_money);
$this->db->set('money', serialize($user_money));
$this->db->where('id', $user_id);
$this->db->update('users');
log_message('debug', number_format($amount, 0, '.', ',') . ' products bought with type "' . $product->type . '" and price "' . number_format($product->price, 2, '.', ',') . ' ' . $product->currency . '" by user with ID "' . $user_id . '"');
return TRUE;
}
示例13: index
public function index()
{
// Setup Spark
$vrs = '0.0.1';
// Update to your spark version
$this->load->spark("codeigniter-payments/{$vrs}");
$gateway = 'bluepay';
// Change to reflect the identifier (Transaction ID from previous transaction)
// Required for CAPTURE, REFUND, and VOID
$identifier = '100000000000';
// Only used for AUTH and ONEOFF
$info = array('cc_number' => '4111111111111111', 'cc_code' => '203', 'cc_exp' => '022016', 'amt' => '25.00', 'email' => 'your-email@your-domain.com', 'first_name' => 'Bill', 'last_name' => 'Testing', 'street' => '181 Something Street', 'city' => 'Tompkinsville', 'state' => 'KY', 'country' => 'US', 'postal_code' => '42167');
/**
* INSTRUCTIONS: Uncomment the line below that you want to test out.
*/
$response = 'Uncomment the line you want to test.';
// One Off Payment Example
// $response = $this->payments->oneoff_payment($gateway, $info);
// Auth
// $response = $this->payments->authorize_payment($gateway, $info);
// Capture
//$response = $this->payments->capture_payment($gateway, array('identifier' => $identifier));
// Refund
// $response = $this->payments->refund_payment($gateway, array('identifier' => $identifier));
// Void Payment Example
// $response = $this->payments->void_payment($gateway, array('identifier' => $identifier));
// Display the Outcome
echo "<pre>";
print_r($response);
echo "</pre>";
// Just so you can check it out later
// Probably want to store some of this information in a database
log_message('error', 'GATEWAY RESPONSE!!');
log_message('error', json_encode($response));
}
示例14: authentication_user
function authentication_user($password)
{
try {
log_message('debug', "AUTHENTICATION");
$this->load->model('dto/DtoUser');
$this->load->model('dao/DaoUser');
$user = new DtoUser();
$userDao = new DaoUser();
$user->setUsername($this->input->post('username', TRUE));
$user->setPassword(md5($this->input->post('password', TRUE)));
$result = $userDao->login($user);
if ($result) {
foreach ($result as $row) {
$user->setUsername($row->username);
$user->setUserid($row->userid);
$user->setUsertype($row->usertype);
$this->session->set_userdata('logged_in', $user);
$this->session->set_userdata('username', $this->encryption->encrypt($user->getUsername()));
$this->session->set_userdata('userid', $this->encryption->encrypt($user->getUserid()));
$this->session->set_userdata('usertype', $user->getUsertype());
return TRUE;
}
} else {
$this->form_validation->set_message('authentication_user', 'Invalid username or password. Please try again.');
return false;
}
} catch (Exception $ex) {
log_message('debug', $ex->getMessage());
}
}
示例15: __construct
public function __construct()
{
// Assign the main database object to $this->db
$CI =& get_instance();
$this->db =& $CI->db;
log_message('debug', 'Database Forge Class Initialized');
}