本文整理汇总了PHP中system::id方法的典型用法代码示例。如果您正苦于以下问题:PHP system::id方法的具体用法?PHP system::id怎么用?PHP system::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system
的用法示例。
在下文中一共展示了system::id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkonlineuser
/**
* checkonlineuser
*
* @param mixed $ip
* @param mixed $type
* @access public
* @return void
*/
public function checkonlineuser($ip, $type)
{
$timestamp = time();
$timeout = time() - 300;
$online_user = ORM::factory('system_online');
$online_user->system_id = system::id();
$online_user->timestamp = $timestamp;
$online_user->ip = $ip;
$online_user->file = $_SERVER['PHP_SELF'];
$online_user->type = $type;
$online_user->save();
$online_user->deleteold($timeout);
}
示例2: add
/**
* add
*
* @param mixed $type
* @param mixed $action
* @static
* @access public
* @return void
*/
public static function add($type, $action)
{
if (Auth::instance()->logged_in('admin')) {
$user_type = ':admin';
$user_id = Auth::instance()->get_user()->id;
} elseif (Auth::instance()->logged_in('cliente')) {
$user_type = ':cliente';
$user_id = Auth::instance()->get_user()->id;
} else {
$user_type = ':visitante';
$user_id = null;
}
$model = ORM::factory('Log');
$model->system_id = system::id();
$model->ip = ORM::factory('Online')->get_ip();
$model->type = $type;
$model->action = $action;
$model->user_id = $user_id;
$model->user_type = $user_type;
$model->save();
}
示例3: layout_dir
/**
* layout_dir
*
* @static
* @access public
* @return void
*/
public static function layout_dir()
{
$theme_id = ORM::factory('system_system', system::id())->find()->systems_theme_id;
return ORM::factory('system_theme', $theme_id)->find()->layout_dir;
}