本文整理汇总了PHP中LogMaster类的典型用法代码示例。如果您正苦于以下问题:PHP LogMaster类的具体用法?PHP LogMaster怎么用?PHP LogMaster使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LogMaster类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
public function query($sql)
{
LogMaster::log($sql);
$res = sasql_query($this->connection, $sql);
if ($res === false) {
throw new Exception("SaSQL operation failed\n" . sasql_error($this->connection));
}
$this->last_result = $res;
return $res;
}
示例2: query
public function query($sql)
{
LogMaster::log($sql);
if ($this->start_from) {
$res = sqlsrv_query($this->connection, $sql, array(), array("Scrollable" => SQLSRV_CURSOR_STATIC));
} else {
$res = sqlsrv_query($this->connection, $sql);
}
if ($res === false) {
$errors = sqlsrv_errors();
$message = array();
foreach ($errors as $error) {
$message[] = $error["SQLSTATE"] . $error["code"] . $error["message"];
}
throw new Exception("SQLSrv operation failed\n" . implode("\n\n", $message));
}
if ($this->insert_operation) {
sqlsrv_next_result($res);
$last = sqlsrv_fetch_array($res);
$this->last_id = $last["dhx_id"];
sqlsrv_free_stmt($res);
}
if ($this->start_from) {
$data = sqlsrv_fetch($res, SQLSRV_SCROLL_ABSOLUTE, $this->start_from - 1);
}
return $res;
}
示例3: getFilesList
private function getFilesList($path, $relation)
{
$fileSystemTypes = FileSystemTypes::getInstance();
LogMaster::log("Query filesystem: " . $path);
$dir = opendir($path . '/' . $relation);
$result = new FileSystemResult();
// forms fields list
for ($i = 0; $i < count($this->config->data); $i++) {
$fields[] = $this->config->data[$i]['db_name'];
}
// for every file and directory of folder
while ($file = readdir($dir)) {
// . and .. should not be in output list
if ($file == '.' || $file == '..') {
continue;
}
$newFile = array();
// parse file name as Array('name', 'ext', 'is_dir')
$fileNameExt = $this->parseFileName($path . '/' . $relation, $file);
// checks if file should be in output array
if (!$fileSystemTypes->checkFile($file, $fileNameExt)) {
continue;
}
// takes file stat if it's need
if (in_array('size', $fields) || in_array('date', $fields)) {
$fileInfo = stat($path . '/' . $file);
}
// for every field forms list of fields
for ($i = 0; $i < count($fields); $i++) {
$field = $fields[$i];
switch ($field) {
case 'filename':
$newFile['filename'] = $file;
break;
case 'full_filename':
$newFile['full_filename'] = $path . "/" . $file;
break;
case 'size':
$newFile['size'] = $fileInfo['size'];
break;
case 'extention':
$newFile['extention'] = $fileNameExt['ext'];
break;
case 'name':
$newFile['name'] = $fileNameExt['name'];
break;
case 'date':
$newFile['date'] = date("Y-m-d H:i:s", $fileInfo['ctime']);
break;
}
$newFile['relation_id'] = $relation . '/' . $file;
$newFile['safe_name'] = $this->setFileName($relation . '/' . $file);
$newFile['is_folder'] = $fileNameExt['is_dir'];
}
// add file in output list
$result->addFile($newFile);
}
return $result;
}
示例4: query
public function query($sql)
{
LogMaster::log($sql);
$res = pg_query($this->connection, $sql);
if ($res === false) {
throw new Exception("Postgre - sql execution failed\n" . pg_last_error($this->connection));
}
return $res;
}
示例5: query
public function query($sql)
{
LogMaster::log($sql);
$res = $this->connection->query($sql);
if ($res === false) {
throw new Exception("MySQL operation failed\n" . $this->connection->error);
}
return $res;
}
示例6: query
public function query($sql)
{
LogMaster::log($sql);
$res = $this->connection->query($sql);
if ($res === false) {
throw new Exception("PDO - sql execution failed\n" . $this->connection->errorInfo());
}
return new PDOResultSet($res);
}
示例7: query
public function query($sql)
{
LogMaster::log($sql);
$res = $this->connection->query($sql);
if ($res === false) {
throw new Exception("SQLLite - sql execution failed\n" . $this->connection->lastErrorMsg());
}
return $res;
}
示例8: query
public function query($query)
{
LogMaster::log($query);
$res = mysql_query($query, $this->connection);
if (mysql_errno() != 0) {
LogMaster::log($this->error());
}
return $res;
}
示例9: query
public function query($sql)
{
LogMaster::log($sql);
$res = $this->connection->query($sql);
if ($res === false) {
throw new Exception("CI - sql execution failed");
}
return new PHPCIResultSet($res);
}
示例10: query
public function query($sql)
{
LogMaster::log($sql);
$res = sqlite_query($this->connection, $sql);
if ($res === false) {
throw new Exception("SQLLite - sql execution failed\n" . sqlite_error_string(sqlite_last_error($this->connection)));
}
return $res;
}
示例11: query
public function query($sql)
{
if ($this->last_result) {
$this->last_result->closeCursor();
}
LogMaster::log($sql);
$this->last_result = $res = $this->connection->query($sql);
if ($res === false) {
throw new Exception("PDO - sql execution failed\n" . $this->connection->errorInfo());
}
return $res;
}
示例12: query
public function query($sql)
{
LogMaster::log($sql);
$res = $this->connection->query($sql);
if ($res === false) {
throw new Exception("CI - sql execution failed");
}
if (is_object($res)) {
return new PHPCIResultSet($res);
}
return new ArrayQueryWrapper(array());
}
示例13: query
public function query($sql)
{
LogMaster::log($sql);
$res = mssql_query($sql, $this->connection, $this->start_from === false ? 10 : 0);
if ($this->insert_operation) {
$last = mssql_fetch_assoc($res);
$this->last_id = $last["dhx_id"];
mysql_free_result($res);
}
if ($this->start_from !== false) {
mssql_data_seek($res, $this->start_from);
}
return $res;
}
示例14: query
public function query($sql)
{
LogMaster::log($sql);
if (is_array($sql)) {
$res = $this->connection->SelectLimit($sql['sql'], $sql['numrows'], $sql['offset']);
} else {
$res = $this->connection->Execute($sql);
}
if ($res === false) {
throw new Exception("ADODB operation failed\n" . $this->connection->ErrorMsg());
}
$this->last_result = $res;
return $res;
}
示例15: parse_request
function parse_request()
{
parent::parse_request();
if (isset($_GET["pos"])) {
if (!$this->dload) {
LogMaster::log("Dyn loading request received, but server side was not configured to process dyn. loading. ");
} else {
$this->request->set_limit($_GET["pos"], $this->dload);
}
}
if (isset($_GET["mask"])) {
$this->request->set_filter($this->config->text[0]["db_name"], $_GET["mask"] . "%", "LIKE");
}
LogMaster::log($this->request);
}