本文整理汇总了PHP中LogManager类的典型用法代码示例。如果您正苦于以下问题:PHP LogManager类的具体用法?PHP LogManager怎么用?PHP LogManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LogManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getChildCompanyStuctures
public function getChildCompanyStuctures($companyStructId)
{
$childIds = array();
$childIds[] = $companyStructId;
$nodeIdsAtLastLevel = $childIds;
$count = 0;
do {
$count++;
$companyStructTemp = new CompanyStructure();
if (empty($nodeIdsAtLastLevel) || empty($childIds)) {
break;
}
$idQuery = "parent in (" . implode(",", $nodeIdsAtLastLevel) . ") and id not in(" . implode(",", $childIds) . ")";
LogManager::getInstance()->debug($idQuery);
$list = $companyStructTemp->Find($idQuery, array());
if (!$list) {
LogManager::getInstance()->debug($companyStructTemp->ErrorMsg());
}
$nodeIdsAtLastLevel = array();
foreach ($list as $item) {
$childIds[] = $item->id;
$nodeIdsAtLastLevel[] = $item->id;
}
} while (count($list) > 0 && $count < 10);
return $childIds;
}
开发者ID:jpbalderas17,项目名称:hris,代码行数:26,代码来源:ActiveEmployeeReport.php
示例2: cancel
public function cancel($req)
{
$employee = $this->baseService->getElement('Employee', $this->getCurrentProfileId(), null, true);
$class = $this->getModelClass();
$itemName = $this->getItemName();
$obj = new $class();
$obj->Load("id = ?", array($req->id));
if ($obj->id != $req->id) {
return new IceResponse(IceResponse::ERROR, "{$itemName} record not found");
}
if ($this->user->user_level != 'Admin' && $this->getCurrentProfileId() != $obj->employee) {
return new IceResponse(IceResponse::ERROR, "Only an admin or owner of the {$itemName} can do this");
}
if ($obj->status != 'Approved') {
return new IceResponse(IceResponse::ERROR, "Only an approved {$itemName} can be cancelled");
}
$obj->status = 'Cancellation Requested';
$ok = $obj->Save();
if (!$ok) {
LogManager::getInstance()->error("Error occurred while cancelling the {$itemName}:" . $obj->ErrorMsg());
return new IceResponse(IceResponse::ERROR, "Error occurred while cancelling the {$itemName}. Please contact admin.");
}
$this->baseService->audit(IceConstants::AUDIT_ACTION, "Expense cancellation | start:" . $obj->date_start . "| end:" . $obj->date_end);
$notificationMsg = $employee->first_name . " " . $employee->last_name . " cancelled a expense. Visit expense management module to approve";
$this->baseService->notificationManager->addNotification($employee->supervisor, $notificationMsg, '{"type":"url","url":"' . $this->getModuleTabUrl() . '"}', $this->getModuleTabUrl(), null, false, true);
return new IceResponse(IceResponse::SUCCESS, $obj);
}
开发者ID:DevlJs,项目名称:icehrm,代码行数:27,代码来源:ApproveActionManager.php
示例3: execute
protected function execute($report, $query, $parameters)
{
//var_dump($query);
//return;
$report->DB()->SetFetchMode(ADODB_FETCH_ASSOC);
LogManager::getInstance()->debug("Query: " . $query);
LogManager::getInstance()->debug("Parameters: " . json_encode($parameters));
$rs = $report->DB()->Execute($query, $parameters);
if (!$rs) {
LogManager::getInstance()->info($report->DB()->ErrorMsg());
return array("ERROR", "Error generating report");
}
$reportNamesFilled = false;
$columnNames = array();
$reportData = array();
foreach ($rs as $rowId => $row) {
$reportData[] = array();
if (!$reportNamesFilled) {
$countIt = 0;
foreach ($row as $name => $value) {
$countIt++;
$columnNames[$countIt] = $name;
$reportData[count($reportData) - 1][] = $value;
}
$reportNamesFilled = true;
} else {
foreach ($row as $name => $value) {
$reportData[count($reportData) - 1][] = $this->transformData($name, $value);
}
}
}
array_unshift($reportData, $columnNames);
return $reportData;
}
开发者ID:jpbalderas17,项目名称:hris,代码行数:34,代码来源:ReportBuilder.php
示例4: init
public function init()
{
//Add Employee time sheets if it is not already created for current week
$empId = $this->getCurrentProfileId();
if (date('w', strtotime("now")) == 0) {
$start = date("Y-m-d", strtotime("now"));
} else {
$start = date("Y-m-d", strtotime("last Sunday"));
}
if (date('w', strtotime("now")) == 6) {
$end = date("Y-m-d", strtotime("now"));
} else {
$end = date("Y-m-d", strtotime("next Saturday"));
}
$timeSheet = new EmployeeTimeSheet();
$timeSheet->Load("employee = ? and date_start = ? and date_end = ?", array($empId, $start, $end));
if ($timeSheet->date_start == $start && $timeSheet->employee == $empId) {
} else {
if (!empty($empId)) {
$timeSheet->employee = $empId;
$timeSheet->date_start = $start;
$timeSheet->date_end = $end;
$timeSheet->status = "Pending";
$ok = $timeSheet->Save();
if (!$ok) {
LogManager::getInstance()->info("Error creating time sheet : " . $timeSheet->ErrorMsg());
}
}
}
//Generate missing timesheets
}
开发者ID:jpbalderas17,项目名称:hris,代码行数:31,代码来源:Time_sheetsInitialize.php
示例5: getWhereQuery
public function getWhereQuery($request)
{
$employeeList = array();
if (!empty($request['employee'])) {
$employeeList = json_decode($request['employee'], true);
}
if (in_array("NULL", $employeeList)) {
$employeeList = array();
}
if (!empty($employeeList) && ($request['project'] != "NULL" && !empty($request['project']))) {
$query = "where employee in (" . implode(",", $employeeList) . ") and date_start >= ? and date_end <= ? and project = ?;";
$params = array($request['date_start'], $request['date_end'], $request['project']);
} else {
if (!empty($employeeList)) {
$query = "where employee in (" . implode(",", $employeeList) . ") and date_start >= ? and date_end <= ?;";
$params = array($request['date_start'], $request['date_end']);
} else {
if ($request['project'] != "NULL" && !empty($request['project'])) {
$query = "where project = ? and date_start >= ? and date_end <= ?;";
$params = array($request['project'], $request['date_start'], $request['date_end']);
} else {
$query = "where date_start >= ? and date_end <= ?;";
$params = array($request['date_start'], $request['date_end']);
}
}
}
LogManager::getInstance()->info("Query:" . $query);
LogManager::getInstance()->info("Params:" . json_encode($params));
return array($query, $params);
}
开发者ID:ahmedalaahagag,项目名称:ICEPROHRM,代码行数:30,代码来源:EmployeeTimesheetReport.php
示例6: sendWelcomeUserEmail
public function sendWelcomeUserEmail($user, $password, $profile = NULL)
{
$params = array();
if (!empty($profile)) {
$params['name'] = $profile->first_name . " " . $profile->last_name;
} else {
$params['name'] = $user->username;
}
$params['url'] = CLIENT_BASE_URL;
$params['password'] = $password;
$params['email'] = $user->email;
$params['username'] = $user->username;
$email = $this->subActionManager->getEmailTemplate('welcomeUser.html');
$emailTo = null;
if (!empty($user)) {
$emailTo = $user->email;
}
if (!empty($emailTo)) {
if (!empty($this->emailSender)) {
LogManager::getInstance()->info("[sendWelcomeUserEmail] sending email to {$emailTo} : " . $email);
$this->emailSender->sendEmail("Your IceHrm account is ready", $emailTo, $email, $params);
}
} else {
LogManager::getInstance()->info("[sendWelcomeUserEmail] email is empty");
}
}
开发者ID:vccran,项目名称:ice-framework,代码行数:26,代码来源:UsersEmailSender.php
示例7: getLeavesForMeAndSubordinates
public function getLeavesForMeAndSubordinates($req)
{
$map = json_decode('{"employee":["Employee","id","first_name+last_name"],"leave_type":["LeaveType","id","name"]}');
$employee = $this->baseService->getElement('Employee', $this->getCurrentProfileId(), null, true);
$employeeLeave = new EmployeeLeave();
$startDate = date("Y-m-d H:i:s", $req->start);
$endDate = date("Y-m-d H:i:s", $req->end);
$list = $employeeLeave->Find("status in ('Approved','Pending') and ((date_start >= ? and date_start <= ? ) or (date_end >= ? and date_end <= ?))", array($startDate, $endDate, $startDate, $endDate));
if (!$list) {
LogManager::getInstance()->info($employeeLeave->ErrorMsg());
}
if (!empty($map)) {
$list = $this->baseService->populateMapping($list, $map);
}
$data = array();
$leaveType = new LeaveType();
$leaveTypesTemp = $leaveType->Find("1=1");
$leaveTypes = array();
foreach ($leaveTypesTemp as $leaveType) {
$leaveTypes[$leaveType->name] = $leaveType;
}
foreach ($list as $leave) {
$data[] = $this->leaveToEvent($leave, $leaveTypes);
}
$holiday = new HoliDay();
$holidays = $holiday->Find("1=1", array());
foreach ($holidays as $holiday) {
$data[] = $this->holidayToEvent($holiday);
}
echo json_encode($data);
exit;
}
开发者ID:ranjithamca,项目名称:icehrm,代码行数:32,代码来源:LeavecalActionManager.php
示例8: getLeavesForMeAndSubordinates
public function getLeavesForMeAndSubordinates($req){
$shareCalendar = $this->baseService->settingsManager->getSetting("Leave: Share Calendar to Whole Company");
$map = json_decode('{"employee":["Employee","id","first_name+last_name"],"leave_type":["LeaveType","id","name"]}');
$employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
if($shareCalendar != "1"){
$subordinate = new Employee();
$subordinates = $subordinate->Find("supervisor = ?",array($employee->id));
$subordinatesIds = $employee->id;
foreach($subordinates as $sub){
if($subordinatesIds != ""){
$subordinatesIds.=",";
}
$subordinatesIds.=$sub->id;
}
$employeeLeave = new EmployeeLeave();
$startDate = date("Y-m-d H:i:s",$req->start);
$endDate = date("Y-m-d H:i:s",$req->end);
$list = $employeeLeave->Find("employee in (".$subordinatesIds.") and status in ('Approved','Pending') and ((date_start >= ? and date_start <= ? ) or (date_end >= ? and date_end <= ?))",array($startDate,$endDate,$startDate,$endDate));
}else{
$employeeLeave = new EmployeeLeave();
$startDate = date("Y-m-d H:i:s",$req->start);
$endDate = date("Y-m-d H:i:s",$req->end);
$list = $employeeLeave->Find("status in ('Approved','Pending') and ((date_start >= ? and date_start <= ? ) or (date_end >= ? and date_end <= ?))",array($startDate,$endDate,$startDate,$endDate));
}
if(!$list){
LogManager::getInstance()->info($employeeLeave->ErrorMsg());
}
if(!empty($map)){
$list = $this->baseService->populateMapping($list,$map);
}
$data = array();
foreach($list as $leave){
$data[] = $this->leaveToEvent($leave);
}
$holiday = new HoliDay();
$holidays = $holiday->Find("1=1",array());
foreach($holidays as $holiday){
$data[] = $this->holidayToEvent($holiday);
}
echo json_encode($data);
exit();
}
开发者ID:IrisDande,项目名称:icehrm,代码行数:60,代码来源:LeavecalActionManager.php
示例9: getInstance
/**
* @static
* @return LogManager
*/
public static function getInstance()
{
if (!isset(self::$instance)) {
$c = __CLASS__;
self::$instance = new $c();
}
return self::$instance;
}
开发者ID:vrkansagara,项目名称:web-doc-editor,代码行数:12,代码来源:LogManager.php
示例10: getInstance
public static function getInstance()
{
if (empty(self::$me)) {
self::$me = new LogManager();
self::$me->log = new Logger(APP_NAME);
self::$me->log->pushHandler(new StreamHandler(ini_get('error_log'), LOG_LEVEL));
}
return self::$me;
}
开发者ID:bravokeyl,项目名称:ems,代码行数:9,代码来源:LogManager.php
示例11: init
public function init()
{
if (SettingsManager::getInstance()->getSetting("Api: REST Api Enabled") == "1") {
$user = BaseService::getInstance()->getCurrentUser();
$dbUser = new User();
$dbUser->Load("id = ?", array($user->id));
$resp = RestApiManager::getInstance()->getAccessTokenForUser($dbUser);
if ($resp->getStatus() != IceResponse::SUCCESS) {
LogManager::getInstance()->error("Error occured while creating REST Api acces token for " . $user->username);
}
}
}
开发者ID:jpbalderas17,项目名称:hris,代码行数:12,代码来源:SettingsInitialize.php
示例12: getInstance
public static function getInstance()
{
if (empty(self::$me)) {
self::$me = new LogManager();
self::$me->log = new Logger(APP_NAME);
if (is_writable(ini_get('error_log'))) {
self::$me->log->pushHandler(new StreamHandler(ini_get('error_log'), LOG_LEVEL));
} else {
self::$me->log->pushHandler(new StreamHandler(CLIENT_BASE_PATH . 'data/app.log', LOG_LEVEL));
}
}
return self::$me;
}
开发者ID:jpbalderas17,项目名称:hris,代码行数:13,代码来源:LogManager.php
示例13: debug
function debug($message, $file = null, $line = null)
{
$logManager =& LogManager::getInstance();
$logger = $logManager->getLogger('debuglogger');
$options = array('m' => $message, 'N' => 'DEBUG', 'p' => LEVEL_DEBUG);
if ($file) {
$options['f'] = $file;
}
if ($line) {
$options['l'] = $line;
}
$message =& new Message($options);
$logger->log($message);
}
开发者ID:komagata,项目名称:plnet,代码行数:14,代码来源:LogUtils.php
示例14: deleteObject
public function deleteObject($bucket, $key)
{
$res = null;
try {
$res = $this->s3->deleteObject(array('Bucket' => $bucket, 'Key' => $key));
} catch (Exception $e) {
LogManager::getInstance()->info($e->getMessage());
return NULL;
}
LogManager::getInstance()->info("Response from s3:" . print_r($res, true));
$result = $res->get('RequestId');
if (!empty($result)) {
return $result;
}
return NULL;
}
开发者ID:jpbalderas17,项目名称:hris,代码行数:16,代码来源:S3FileSystem.php
示例15: execute
public function execute($cron)
{
$email = new IceEmail();
$emails = $email->Find("status = ? limit 10", array('Pending'));
$emailSender = BaseService::getInstance()->getEmailSender();
foreach ($emails as $email) {
try {
$emailSender->sendEmailFromDB($email);
} catch (Exception $e) {
LogManager::getInstance()->error("Error sending email:" . $e->getMessage());
}
$email->status = 'Sent';
$email->updated = date('Y-m-d H:i:s');
$email->Save();
}
}
开发者ID:DevlJs,项目名称:icehrm,代码行数:16,代码来源:common.cron.tasks.php
示例16: ADODB_Error_Handler
/**
* Default Error Handler. This will be called with the following params
*
* @param $dbms the RDBMS you are connecting to
* @param $fn the name of the calling function (in uppercase)
* @param $errno the native error number from the database
* @param $errmsg the native error msg from the database
* @param $p1 $fn specific parameter - see below
* @param $p2 $fn specific parameter - see below
* @param $thisConn $current connection object - can be false if no connection object created
*/
function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection)
{
if (error_reporting() == 0) {
return;
}
// obey @ protocol
switch ($fn) {
case 'EXECUTE':
$sql = $p1;
$inputparams = $p2;
$s = "{$dbms} error: [{$errno}: {$errmsg}] in {$fn}(\"{$sql}\")\n";
break;
case 'PCONNECT':
case 'CONNECT':
$host = $p1;
$database = $p2;
$s = "{$dbms} error: [{$errno}: {$errmsg}] in {$fn}({$host}, '****', '****', {$database})\n";
break;
default:
$s = "{$dbms} error: [{$errno}: {$errmsg}] in {$fn}({$p1}, {$p2})\n";
break;
}
/*
* Log connection error somewhere
* 0 message is sent to PHP's system logger, using the Operating System's system
* logging mechanism or a file, depending on what the error_log configuration
* directive is set to.
* 1 message is sent by email to the address in the destination parameter.
* This is the only message type where the fourth parameter, extra_headers is used.
* This message type uses the same internal function as mail() does.
* 2 message is sent through the PHP debugging connection.
* This option is only available if remote debugging has been enabled.
* In this case, the destination parameter specifies the host name or IP address
* and optionally, port number, of the socket receiving the debug information.
* 3 message is appended to the file destination
*/
if (defined('ADODB_ERROR_LOG_TYPE')) {
$t = date('Y-m-d H:i:s');
if (defined('ADODB_ERROR_LOG_DEST')) {
LogManager::getInstance()->info("({$t}) {$s}", ADODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST);
} else {
LogManager::getInstance()->info("({$t}) {$s}", ADODB_ERROR_LOG_TYPE);
}
}
//print "<p>$s</p>";
trigger_error($s, ADODB_ERROR_HANDLER_TYPE);
}
开发者ID:vccran,项目名称:ice-framework,代码行数:58,代码来源:adodb-errorhandler.inc.php
示例17: saveUser
public function saveUser($req)
{
$profileVar = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
$profileClass = ucfirst(SIGN_IN_ELEMENT_MAPPING_FIELD_NAME);
if ($this->user->user_level == 'Admin') {
$user = new User();
$user->Load("email = ?", array($req->email));
if ($user->email == $req->email) {
return new IceResponse(IceResponse::ERROR, "User with same email already exists");
}
$user->Load("username = ?", array($req->username));
if ($user->username == $req->username) {
return new IceResponse(IceResponse::ERROR, "User with same username already exists");
}
$user = new User();
$user->email = $req->email;
$user->username = $req->username;
$password = $this->generateRandomString(6);
$user->password = md5($password);
$user->profile = empty($req->profile) || $req->profile == "NULL" ? NULL : $req->profile;
$user->user_level = $req->user_level;
$user->last_login = date("Y-m-d H:i:s");
$user->last_update = date("Y-m-d H:i:s");
$user->created = date("Y-m-d H:i:s");
$profile = null;
if (!empty($user->profile)) {
$profile = $this->baseService->getElement($profileClass, $user->profile, null, true);
}
$ok = $user->Save();
if (!$ok) {
LogManager::getInstance()->info($user->ErrorMsg() . "|" . json_encode($user));
return new IceResponse(IceResponse::ERROR, "Error occured while saving the user");
}
$user->password = "";
$user = $this->baseService->cleanUpAdoDB($user);
if (!empty($this->emailSender)) {
$usersEmailSender = new UsersEmailSender($this->emailSender, $this);
$usersEmailSender->sendWelcomeUserEmail($user, $password, $profile);
}
return new IceResponse(IceResponse::SUCCESS, $user);
}
return new IceResponse(IceResponse::ERROR, "Not Allowed");
}
开发者ID:vccran,项目名称:ice-framework,代码行数:43,代码来源:UsersActionManager.php
示例18: addAudit
public function addAudit($type, $data)
{
$audit = new Audit();
$audit->user = $this->user->id;
$audit->ip = $_SERVER['REMOTE_ADDR'];
$audit->time = date("Y-m-d H:i:s");
$audit->time = gmdate('Y-m-d H:i:s', strtotime($audit->time));
$audit->type = $type;
$audit->details = $data;
$currentEmpId = $this->getCurrentProfileId();
if (!empty($currentEmpId)) {
$employee = $this->baseService->getElement('Employee', $this->getCurrentProfileId(), null, true);
$audit->employee = $employee->first_name . " " . $employee->last_name . " [EmpId = " . $employee->employee_id . "]";
}
$ok = $audit->Save();
if (!$ok) {
LogManager::getInstance()->info("Error adding audit:" . $audit->ErrorMsg());
}
}
开发者ID:ahmedalaahagag,项目名称:ICEPROHRM,代码行数:19,代码来源:AuditActionManager.php
示例19: showIndex
function showIndex()
{
$filter = fvSite::$fvSession->get(fvRequest::getInstance()->getRequestParameter("requestURL") . "/filter");
$query = null;
$params = array();
if (is_array($filter)) {
if (!empty($filter['object_name'])) {
$query .= ($query ? " AND " : '') . "object_name LIKE ?";
$params[] = '%' . $filter['object_name'] . "%";
$this->__assign('filter_object_name', $filter['object_name']);
}
if (!empty($filter['date_from'])) {
$query .= ($query ? " AND " : '') . "date >= ?";
$params[] = $filter['date_from'];
$this->__assign('filter_date_from', $filter['date_from']);
}
if (!empty($filter['date_to'])) {
$query .= ($query ? " AND " : '') . "date <= ?";
$params[] = $filter['date_to'];
$this->__assign('filter_date_to', $filter['date_to']);
}
if (!empty($filter['message'])) {
$query .= ($query ? " AND " : '') . "message LIKE ?";
$params[] = '%' . $filter['message'] . '%';
$this->__assign('filter_message', $filter['message']);
}
if (!empty($filter['operation'])) {
$query .= ($query ? " AND " : '') . "operation = ?";
$params[] = $filter['operation'];
$this->__assign('filter_operation', $filter['operation']);
}
if (!empty($filter['manager_id'])) {
$query .= ($query ? " AND " : '') . "manager_id = ?";
$params[] = $filter['manager_id'];
$this->__assign('filter_manager_id', $filter['manager_id']);
}
}
$pager = new fvPager(LogManager::getInstance());
$this->__assign('Logs', $pager->paginate($query, "date DESC", $params));
$this->__assign('UserManager', UserManager::getInstance());
return $this->__display('log_list.tpl');
}
开发者ID:newnamecomua,项目名称:engineown,代码行数:42,代码来源:module.class.php
示例20: getWhereQuery
public function getWhereQuery($request)
{
$employeeList = array();
if (!empty($request['employee'])) {
$employeeList = json_decode($request['employee'], true);
}
if (in_array("NULL", $employeeList)) {
$employeeList = array();
}
if (!empty($employeeList)) {
$query = "where employee in (" . implode(",", $employeeList) . ") and in_time >= ? and out_time <= ? order by in_time desc;";
$params = array($request['date_start'] . " 00:00:00", $request['date_end'] . " 23:59:59");
} else {
$query = "where in_time >= ? and out_time <= ? order by in_time desc;";
$params = array($request['date_start'] . " 00:00:00", $request['date_end'] . " 23:59:59");
}
LogManager::getInstance()->info("Query:" . $query);
LogManager::getInstance()->info("Params:" . json_encode($params));
return array($query, $params);
}
开发者ID:jpbalderas17,项目名称:hris,代码行数:20,代码来源:EmployeeAttendanceReport+-+Copy.php
注:本文中的LogManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论