本文整理匯總了PHP中Stack::sl_err方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stack::sl_err方法的具體用法?PHP Stack::sl_err怎麽用?PHP Stack::sl_err使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Stack
的用法示例。
在下文中一共展示了Stack::sl_err方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stack_load
public function stack_load($flags = 0)
{
global $config;
if ($flags == 0) {
$flags = Stack::FLAG_STACK_INFO | Stack::FLAG_STACK_SCRIPT | Stack::FLAG_STACK_ICONS;
}
$stmt = $this->file_db->prepare('SELECT stack_data,cant_delete,cant_modify,private_access FROM stack');
Stack::sl_err($stmt, $this->file_db, 'Invalid Stack or Stack Corrupt', 520);
Stack::sl_ok($stmt->execute(), $this->file_db, 'Loading Stack (2)');
$row = $stmt->fetch(PDO::FETCH_ASSOC);
Stack::sl_ok($row, $this->file_db, 'Loading Stack (3)');
$stack = json_decode($row['stack_data'], true);
$stack['stack_name'] = $this->name;
$stack['cant_delete'] = Stack::decode_bool($row['cant_delete']);
$stack['cant_modify'] = Stack::decode_bool($row['cant_modify']);
$stack['private_access'] = Stack::decode_bool($row['private_access']);
$stack['first_card_id'] = $this->stack_get_first_card_id();
$stack['stack_id'] = substr($this->stack_id, strlen($config->stacks));
$stack['stack_path'] = substr($this->stack_id, strlen($config->stacks));
$stack['count_cards'] = $this->stack_get_count_cards();
$stack['count_bkgnds'] = $this->stack_get_count_bkgnds();
$stack['stack_size'] = filesize($this->stack_id);
$stack['stack_free'] = $this->stack_get_free();
// also need to retrieve icons here
// unless specifically excluded, for example, subsequent reload of essential information only
// ** TODO **
if ($flags & Stack::FLAG_STACK_ICONS) {
$list = array();
$stmt = $this->file_db->prepare('SELECT icon_id,icon_name,icon_data FROM icon');
Stack::sl_ok($stmt, $this->file_db, 'Loading Stack Icons (1)');
Stack::sl_ok($stmt->execute(), $this->file_db, 'Loading Stack Icons (2)');
while (($row = $stmt->fetch(PDO::FETCH_NUM)) !== false) {
$list[] = $row;
}
$stack['stack_icons'] = $list;
}
/*$stack['cant_peek'] = Stack::decode_bool($data['cant_peek']);
$stack['cant_abort'] = Stack::decode_bool($data['cant_abort']);
$stack['user_level'] = $data['user_level'];
$stack['card_width'] = $data['card_width'];
$stack['card_height'] = $data['card_height'];*/
return $stack;
}