本文整理汇总了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;
}