本文整理匯總了PHP中Logs::findAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Logs::findAll方法的具體用法?PHP Logs::findAll怎麽用?PHP Logs::findAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Logs
的用法示例。
在下文中一共展示了Logs::findAll方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testWriterDb
public function testWriterDb()
{
$w = new Db(new Logs());
$this->assertInstanceOf('Pop\\Log\\Writer\\Db', $w);
$l = new Logger($w);
$l->debug('Test log message');
$entries = Logs::findAll();
$this->assertEquals(1, count($entries->rows));
foreach ($entries->rows as $row) {
$e = Logs::findById($row->id);
if (isset($e->id)) {
$e->delete();
}
}
}
示例2: Pages
$page = new Pages();
$conditions = array();
if (isset($_GET['do'])) {
$do = trim($_GET['do']);
if ($do == "clear") {
$result = $pdb->Execute("truncate {$tb_prefix}logs");
}
if ($do == "del" && !empty($_GET['id'])) {
$log->del($_GET['id']);
}
if ($do == 'search') {
if (!empty($_GET['q'])) {
$conditions[] = "description like '%" . $_GET['q'] . "%'";
}
}
}
if (isset($_GET['q'])) {
$conditions[] = "description like '%" . $_GET['q'] . "%'";
}
$amount = $log->findCount(null, $conditions);
$page->setPagenav($amount);
$result = $log->findAll("id,handle_type,source_module,description,created,created AS pubdate", null, $conditions, "id DESC ", $page->firstcount, $page->displaypg);
if (!empty($result)) {
for ($i = 0; $i < count($result); $i++) {
$result[$i]['label'] = "images/e_" . $result[$i]['handle_type'] . ".gif";
$result[$i]['pubdate'] = date("Y-m-d H:i:s", $result[$i]['created']);
}
setvar("Items", $result);
}
setvar("ByPages", $page->pagenav);
template("log");