本文整理汇总了PHP中Version::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP Version::insert方法的具体用法?PHP Version::insert怎么用?PHP Version::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Version
的用法示例。
在下文中一共展示了Version::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* The POST call to add a version to a package
* Redirect to the package page on success
*/
public function add()
{
$submit = $this->input->post('submit');
if ($submit) {
$this->load->library('form_validation');
$this->load->model('version');
$this->load->model('spark');
$insert = elements(array('spark_id', 'tag'), $_POST);
if ($this->form_validation->run('add-version')) {
if (Version::insert($insert)) {
UserHelper::setNotice("Version added!");
}
} else {
UserHelper::setNotice("Try to enter a valid tag!", FALSE);
}
$spark = Spark::getById($insert['spark_id']);
redirect(base_url() . 'packages/' . $spark->name . '/show');
}
show_error("Whatcha doin' here?");
}
示例2: get_data_from_url
$object = slash($info['path']) . $object;
chmod($tmpfile, 0755);
$s3 = new S3($app->s3key, $app->s3pkey);
$s3->putObject($app->s3bucket, $object, $tmpfile, true);
} else {
die("Configure your Amazon S3 account or modify version-new.php file.");
/*
$v->url = '/Users/dirk/work/wordpress/shine/' . $object;
copy($_FILES['file']['tmp_name'], '/Users/dirk/work/wordpress/shine/' . $object);
*/
}
} else {
// Cleanup download
unlink($tmpfile);
}
$v->insert();
redirect('versions.php?id=' . $app->id);
} else {
$version_number = $_POST['version_number'];
$human_version = $_POST['human_version'];
$release_notes = $_POST['release_notes'];
$url = $_POST['url'];
}
} else {
$version_number = '';
$human_version = '';
$release_notes = '';
$url = '';
}
function get_data_from_url($url)
{