本文整理汇总了PHP中Stack::create_file方法的典型用法代码示例。如果您正苦于以下问题:PHP Stack::create_file方法的具体用法?PHP Stack::create_file怎么用?PHP Stack::create_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stack
的用法示例。
在下文中一共展示了Stack::create_file方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_stack
public static function create_stack()
{
$filename = HCImport::stack_temp();
if (file_exists($filename)) {
unlink($filename);
}
Stack::create_file($filename);
HCImport::load_stack();
HCImport::index_blocks();
HCImport::decode_stak();
$new_file = new Stack($filename);
$new_stack = $new_file->stack_load();
$new_stack['card_width'] = HCImport::$stack['card_width'];
$new_stack['card_height'] = HCImport::$stack['card_height'];
$new_file->stack_save($new_stack);
$new_file->zap_all_cards();
return HCImport::$stack;
}
示例2: new_stack
public static function new_stack($inbound, $outbound)
{
global $config;
if (!$config->restrictions->can_new_stack) {
throw new Exception('Creating new stacks is not allowed.', 403);
}
Util::keys_required($inbound, array('id'));
$stack_id = Util::safe_stack_id($inbound['id'], true);
Stack::create_file($stack_id);
return $outbound;
}
示例3: new_stack
public static function new_stack($inbound, $outbound)
{
global $config;
if (!$config->restrictions->can_new_stack) {
throw new Exception('Creating new stacks is not allowed.', 403);
}
$stack_id = Util::safe_stack_id($inbound['stack_id'], true);
Stack::create_file($stack_id);
if (file_exists($stack_id)) {
$outbound['stack_id'] = $inbound['stack_id'];
} else {
throw new Exception("Couldn't create stack.", 520);
}
return $outbound;
}