本文整理匯總了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;
}