本文整理汇总了PHP中logMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP logMessage函数的具体用法?PHP logMessage怎么用?PHP logMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了logMessage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: core
/**
*
* @param string $name
* @param bool $instance
* @return object|null Object or NULL
* @throws Exception
*/
public static function core($name, $instance = TRUE)
{
$core_name = ucfirst($name);
if (!class_exists($core_name)) {
try {
$path = APP_DIR . '/core/' . $core_name . '.php';
if (file_exists($path)) {
require $path;
if ($instance === TRUE) {
$exclude_instance = array('View', 'Layout');
if (in_array($core_name, $exclude_instance)) {
return NULL;
}
$instance_name = $core_name == 'Database' ? 'DB' : $core_name;
return new $instance_name();
}
} else {
throw new Exception('Core not found: ' . $core_name);
}
} catch (Exception $e) {
logMessage('error', $e->getMessage(), TRUE);
showError($e->getMessage(), 'Error: Loader', 500);
}
}
return NULL;
}
开发者ID:khalid9th,项目名称:ocAds,代码行数:33,代码来源:Loader.php
示例2: sendReport
private function sendReport($get_parameters, $post_parameters)
{
if (extension_loaded("curl")) {
// create a new cURL resource
$ch = curl_init();
$url = INSTALL_REPORT_URL . '?' . http_build_query($get_parameters);
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
//curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_parameters);
// grab URL and pass it to the browser
$result = curl_exec($ch);
if (!$result) {
logMessage(L_ERROR, 'Failed sending install report ' . curl_error($ch));
} else {
logMessage(L_INFO, 'Sending install report');
}
// close cURL resource, and free up system resources
curl_close($ch);
}
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:25,代码来源:InstallReport.class.php
示例3: startSQLSession
function startSQLSession()
{
global $globalLink;
if (!empty($globalLink)) {
return $globalLink;
}
$link = mysql_connect(HOST, USER, PASSWORD);
if ($link) {
$db_selected = mysql_select_db(DATABASE, $link);
if (!$db_selected) {
logMessage(__FUNCTION__ . " - IMPOSSIBLE DE SE CONNECTER A LA DATABASE", LOG_LEVEL_ERROR);
}
} else {
logMessage(__FUNCTION__ . " - IMPOSSIBLE DE SE CONNECTER AU SERVEUR SQL : " . mysql_error(), LOG_LEVEL_ERROR);
////////////////////////////////////////////////////////////////
sleep(10);
$link = mysql_connect(HOST, USER, PASSWORD);
if ($link) {
$db_selected = mysql_select_db(DATABASE, $link);
if (!$db_selected) {
logMessage(__FUNCTION__ . " - IMPOSSIBLE DE SE CONNECTER A LA DATABASE", LOG_LEVEL_ERROR);
}
}
////////////////////////////////////////////////////////////////
}
$globalLink = $link;
return $link;
}
开发者ID:qcstw-dev,项目名称:qcsasia,代码行数:28,代码来源:sql.inc.php
示例4: update
public function update()
{
// validation check
if (!is_null($this->desirePercent)) {
if ($this->desirePercent > 100.0) {
$this->desirePercent = 100.0;
}
if ($this->desirePercent < 0.0) {
$this->desirePercent = 0.0;
}
$this->desirePercent = round($this->desirePercent);
}
// now onto the update
try {
$dbh = getPDOConnection();
$dbh->beginTransaction();
$stmt = $dbh->prepare("UPDATE shiftpreference SET desirePercent = ? " . " WHERE workerid = ? AND jobid = ?");
$stmt->execute(array($this->desirePercent, $this->workerid, $this->jobid));
$dbh->commit();
return $this;
} catch (PDOException $pe) {
logMessage('ShiftPreference::update()', $pe->getMessage());
throw $pe;
}
}
开发者ID:ConSked,项目名称:scheduler,代码行数:25,代码来源:ShiftPreference.php
示例5: logWorkerListState
public function logWorkerListState($message, $note)
{
logMessage($message, $note);
foreach ($this->workerList as $worker) {
$worker->logState($message);
}
}
开发者ID:ConSked,项目名称:scheduler,代码行数:7,代码来源:AbstractScheduler.php
示例6: test
public function test($value, $expected, $testName)
{
if ($value != $expected) {
failed("{$testName} - Expected '{$expected}', Got: '{$value}'");
} else {
logMessage(" Passed: {$testName} - value '{$value}'");
}
}
开发者ID:BradlySharpe,项目名称:Sharpies-Auto-Services,代码行数:8,代码来源:Tests.php
示例7: executeRCommand
function executeRCommand($rInstanceScreenName, $command, $markInstanceAsAvailable = 1)
{
if ($markInstanceAsAvailable == 1) {
$command = $command . "mark.as.available();";
}
$cmd = 'screen -L -S ' . $rInstanceScreenName . ' -p 0 -X stuff "' . $command . "\n" . '"';
logMessage(" - " . $command);
shell_exec($cmd);
}
开发者ID:EU-OSHA,项目名称:esener,代码行数:9,代码来源:start.php
示例8: send
/**
* used both internally, and to send any arbitrary mail.
* See notes on WorkerViewPage
*/
public static function send($to, $subject, $body)
{
try {
$headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $body, $headers);
} catch (Exception $ex) {
logMessage('FormMail.send(' . $to . ')', $ex->getMessage());
}
}
开发者ID:ConSked,项目名称:scheduler,代码行数:13,代码来源:mail.php
示例9: addJob
public function addJob(JobSchedule $job, $expoId, $override = FALSE)
{
if (array_key_exists($job->jobid, $this->jobList)) {
return;
}
// already added
if (!$override) {
$expo = Expo::selectID($expoId);
$preference = $this->jobPreferences[$job->jobid];
if (is_null($preference->desirePercent)) {
$job->subWorker($this, $expoId, TRUE);
// we may have added it
throw new ScheduleImpossibleException("Worker:" . $this->workerid . " cannot work in Job:" . $job->jobid);
}
$newJobMinutes = $this->jobMinutes + $job->jobMinutes();
if ($newJobMinutes > $this->maxMinutes) {
$job->subWorker($this, $expoId, TRUE);
// we may have added it
throw new ScheduleOverMaxHoursException("Worker:" . $this->workerid . " cannot work in Job:" . $job->jobid . " as will have total minutes above max:" . ($newJobMinutes - $this->maxMinutes));
}
if ($newJobMinutes > 60 * $expo->expoHourCeiling) {
$job->subWorker($this, $expoId, TRUE);
// we may have added it
throw new ScheduleOverMaxHoursException("Worker:" . $this->workerid . " cannot work in Job:" . $job->jobid . " as will have total minutes above expo max:" . ($newJobMinutes - 60 * $expo->expoHourCeiling));
}
foreach ($this->jobList as $existing) {
if ($job->isTimeConflict($existing)) {
if ($expo->allowScheduleTimeConflict) {
logMessage("WorkerSchedule", "overlapping conflict allowed");
if ($job->isStartTimeConflict($existing)) {
$job->subWorker($this, $expoId, TRUE);
// we may have added it
$sce = new ScheduleConflictException("Worker:" . $this->workerid . " cannot work in Job:" . $job->jobid . " due to identical start time conflict with existing Job:" . $existing->jobid);
$sce->conflict = $existing;
logMessage("WorkerSchedule", $sce);
throw $sce;
}
} else {
$job->subWorker($this, $expoId, TRUE);
// we may have added it
$sce = new ScheduleConflictException("Worker:" . $this->workerid . " cannot work in Job:" . $job->jobid . " due to conflict with existing Job:" . $existing->jobid);
$sce->conflict = $existing;
logMessage("WorkerSchedule", $sce);
throw $sce;
}
// allowScheduleTimeConflict
}
}
// $existing
}
// $override
$this->jobList[$job->jobid] = $job;
$this->jobMinutes += $job->jobMinutes();
$job->addWorker($this, $expoId, $override);
// must be at very end
return;
}
开发者ID:ConSked,项目名称:scheduler,代码行数:57,代码来源:WorkerSchedule.php
示例10: addHistory
function addHistory($idMember, $type, $filename = "")
{
$createdDate = getCurrentDateSQLFormat();
$sqlQuery = "INSERT INTO qcs_history (idMember, createdDate , type , filename) VALUES('" . $idMember . "' , '" . $createdDate . "' , '" . $type . "' , '" . $filename . "'" . ")";
// echo $sqlQuery . "<br/>";
logMessage(__FUNCTION__ . " - " . $sqlQuery, LOG_LEVEL_DEBUG);
$sqlLink = startSQLSession();
$result = mysql_query($sqlQuery);
closeSQLSession($sqlLink);
}
开发者ID:qcstw-dev,项目名称:qcsasia,代码行数:10,代码来源:history.inc.php
示例11: assignWorker
public function assignWorker(WorkerSchedule $worker, $expoId)
{
if (0 == count($this->jobList)) {
return;
}
// jobs in preference order
$myJobList = $worker->sortJobPreference($this->jobList, FALSE);
// first get locations in preference order
$locations = array();
foreach ($myJobList as $job) {
if (!in_array($job->location, $locations)) {
$locations[] = $job->location;
}
}
// $job
// next reorder jobs ... order by preference group by location!
$groupByLocation = array();
foreach ($locations as $location) {
foreach ($myJobList as $job) {
if (0 == strcmp($job->location, $location)) {
$groupByLocation[] = $job;
}
}
// $job
}
// $location
$myJobList = NULL;
$locations = NULL;
$lockLocation = NULL;
logMessage("LocationLock", "assigning workerid:" . $worker->workerid . " count(gbl):" . count($groupByLocation));
foreach ($groupByLocation as $job) {
try {
logMessage("LocationLock - isnull?", "jobid:" . $job->jobid . " in try ");
if (!is_null($lockLocation)) {
logMessage("LocationLock - strcmp", "lockLocation:" . $lockLocation . " after is_null " . $job->location);
if (0 != strcmp($lockLocation, $job->location)) {
logMessage("LocationLock - break", "jobid:" . $job->jobid . " lockLocation:" . $lockLocation . " before break ");
break;
// leave loop
}
}
logMessage("LocationLock - addwprler", "jobid:" . $job->jobid . " worker:" . $worker->workerid);
$job->addWorker($worker, $expoId);
// exception leaves $lockLocation NULL
logMessage("LocationLock - set lockLocation", "job->location:" . $job->location);
$lockLocation = $job->location;
} catch (ScheduleException $se) {
logMessage("LocationLock failure", $job->jobid . " " . $se->getMessage());
continue;
// do not force
}
}
// $job
$groupByLocation = NULL;
}
开发者ID:ConSked,项目名称:scheduler,代码行数:55,代码来源:FirstComeLocationLocked.php
示例12: groupInfo
function groupInfo($key)
{
global $debug;
$result = rest("get_group_profile", "group={$key}");
if ($result == null) {
logMessage('sl', 0, "Error retrieving group profile for {$key}", null, null);
return null;
}
$xml = new SimpleXMLElement($result);
return $xml->groupprofile->name . "," . $xml->groupprofile->insignia . "," . $xml->groupprofile->maturepublish . "," . $xml->groupprofile->charter;
}
开发者ID:GwynethLlewelyn,项目名称:restbot,代码行数:11,代码来源:groups.php
示例13: select
private static function select($sql, $params)
{
try {
$rows = simpleSelect("ShiftAssignmentView", $sql, $params);
foreach ($rows as $row) {
$row->fixDates();
}
return $rows;
} catch (PDOException $pe) {
logMessage('ShiftAssignmentView::select(' . $sql . ', ' . var_export($params, true) . ')', $pe->getMessage());
}
}
开发者ID:ConSked,项目名称:scheduler,代码行数:12,代码来源:ShiftAssignmentView.php
示例14: dbConnect
function dbConnect()
{
$dbserver = "localhost";
$dbuser = "naboor";
$dbpass = "naboor";
$dbname = "naboor";
$myDB = new mysqli($dbserver, $dbuser, $dbpass, $dbname);
if ($myDB->connect_errno > 0) {
logMessage("Connection failed on DB " . $dbname);
}
return $myDB;
}
开发者ID:121mhz,项目名称:naboor,代码行数:12,代码来源:motion.php
示例15: update
public function update()
{
try {
$dbh = getPDOConnection();
$dbh->beginTransaction();
$stmt = $dbh->prepare("UPDATE jobpreference SET job1 = ?, job2 = ?, job3 = ?, job4 = ?, job5 = ?, job6 = ?, job7 = ?, job8 = ?, job9 = ?, job10 = ?, " . "job11 = ?, job12 = ?, job13 = ?, job14 = ?, job15 = ?, job16 = ?, job17 = ?, job18 = ?, job19 = ?, job20 = ? " . "WHERE workerid = ?");
$stmt->execute(array($this->job1, $this->job2, $this->job3, $this->job4, $this->job5, $this->job6, $this->job7, $this->job8, $this->job9, $this->job10, $this->job11, $this->job12, $this->job13, $this->job14, $this->job15, $this->job16, $this->job17, $this->job18, $this->job19, $this->job20, $this->workerid));
$dbh->commit();
return $this;
} catch (PDOException $pe) {
logMessage('JobPreference::update()', $pe->getMessage());
}
}
开发者ID:ConSked,项目名称:scheduler,代码行数:13,代码来源:JobPreference.php
示例16: delete
public function delete()
{
try {
$dbh = getPDOConnection();
$dbh->beginTransaction();
$stmt = $dbh->prepare("DELETE FROM jobtitle WHERE expoid = ? AND jobtitle = ?");
$stmt->execute(array($this->expoid, $this->jobTitle));
$dbh->commit();
return $this;
} catch (PDOException $pe) {
logMessage('JobTitle::delete()', $pe->getMessage());
}
}
开发者ID:ConSked,项目名称:scheduler,代码行数:13,代码来源:JobTitle.php
示例17: tableSchema
private static function tableSchema($table)
{
$sql = "DESCRIBE {$table}";
try {
$dbh = getPDOConnection();
$stmt = $dbh->prepare($sql);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $pe) {
logMessage("Report::tableSchema({$table})", $pe->getMessage());
return array();
}
}
开发者ID:ConSked,项目名称:scheduler,代码行数:13,代码来源:report.php
示例18: update
public function update()
{
try {
$dbh = getPDOConnection();
$dbh->beginTransaction();
$stmt = $dbh->prepare("UPDATE timepreference SET shift1 = ?, shift2 = ?, shift3 = ?, shift4 = ?, shift5 = ?, shift6 = ?, shift7 = ?, shift8 = ?, shift9 = ? , shift10 = ?, " . "shift11 = ?, shift12 = ?, shift13 = ?, shift14 = ?, shift15 = ?, shift16 = ?, shift17 = ?, shift18 = ?, shift19 = ?, shift20 = ? " . "WHERE workerid = ?");
$stmt->execute(array($this->shift1, $this->shift2, $this->shift3, $this->shift4, $this->shift5, $this->shift6, $this->shift7, $this->shift8, $this->shift9, $this->shift10, $this->shift11, $this->shift12, $this->shift13, $this->shift14, $this->shift15, $this->shift16, $this->shift17, $this->shift18, $this->shift19, $this->shift20, $this->workerid));
$dbh->commit();
return $this;
} catch (PDOException $pe) {
logMessage('TimePreference::update()', $pe->getMessage());
}
}
开发者ID:ConSked,项目名称:scheduler,代码行数:13,代码来源:TimePreference.php
示例19: insert
public static function insert($date)
{
try {
$dbh = getPDOConnection();
$dbh->beginTransaction();
$stmt = $dbh->prepare("INSERT INTO remindersent (date) VALUES (?)");
$stmt->execute(array($date));
$dbh->commit();
return;
} catch (PDOException $pe) {
logMessage('ReminderSend::insert(' . $date . ')', $pe->getMessage());
}
}
开发者ID:ConSked,项目名称:scheduler,代码行数:13,代码来源:ReminderSent.php
示例20: doUpdate
function doUpdate($sql)
{
global $debugdb;
if ($debugdb) {
logMessage('db', 3, "SQL - " . $sql);
}
$conn = getConn();
$result = $conn->query($sql);
if (DB::isError($result)) {
logMessage('db', 0, "Query Error " . $result->getMessage(), null, null);
genPipeError('db');
}
return $conn->affectedrows();
}
开发者ID:GwynethLlewelyn,项目名称:restbot,代码行数:14,代码来源:db.php
注:本文中的logMessage函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论