本文整理汇总了PHP中Version::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Version::delete方法的具体用法?PHP Version::delete怎么用?PHP Version::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Version
的用法示例。
在下文中一共展示了Version::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete()
{
$this->login_user();
try {
$package = Package::find($_GET['id']);
$version = Version::find($_GET['version']);
} catch (NimbleRecordNotFound $e) {
$this->redirect_to('/');
}
if ($version->package_id == $package->id && $package->user_id == $this->user->id) {
$file = $package->file_path($version->version);
@unlink($file);
Nimble::flash('notice', "Version: {$version->version} was deleted");
Version::delete($version->id);
$this->redirect_to(url_for('PackageController', 'show', $version->package_id));
} else {
$this->redirect_to('/');
}
}
示例2: Version
<?php
require 'includes/master.inc.php';
$Auth->requireAdmin('login.php');
$nav = 'applications';
$v = new Version($_GET['id']);
if (!$v->ok()) {
redirect('index.php');
}
$app = new Application($v->app_id);
if (!$app->ok()) {
redirect('index.php');
}
if (isset($_POST['btnDelete'])) {
$v->delete();
redirect('versions.php?id=' . $app->id);
}
$version_number = $v->version_number;
$human_version = $v->human_version;
$release_notes = $v->release_notes;
$url = $v->url;
$signature = $v->signature;
$filesize = $v->filesize;
include 'inc/header.inc.php';
?>
<div id="bd">
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<div class="block tabs spaces">
示例3: destroy_version
public function destroy_version()
{
if (!isset($_POST['version_id'])) {
error(__("Error"), __("No version ID specified.", "extend"));
}
$version = new Version($_POST['version_id']);
if ($version->no_results) {
error(__("Error"), __("Invalid version ID specified.", "extend"));
}
if (!$version->deletable()) {
show_403(__("Access Denied"), __("You do not have sufficient privileges to delete this version.", "extend"));
}
Version::delete($version->id);
Flash::notice(__("Version deleted.", "extend"), $version->extension->url());
}
示例4: remove
function remove()
{
if (!(Current_User::authorized('wiki', 'delete_page') && $this->getAllowEdit() && !$this->getVrCurrent())) {
Current_User::disallow(dgettext('wiki', 'User attempted to remove previous page version.'));
return;
}
PHPWS_Core::initModClass('version', 'Version.php');
$version = new Version('wiki_pages', $this->getId());
$version->delete(FALSE);
WikiManager::sendMessage(dgettext('wiki', 'Old revision removed'), array('page' => $this->getTitle(FALSE)), FALSE);
}
示例5: delete
/**
* Function: delete
* Deletes the given extension, including its notes. Calls the "delete_extension" trigger and passes the <Extension> as an argument.
*
* Parameters:
* $id - The extension to delete.
*/
static function delete($id)
{
$extension = new self($id);
foreach ($extension->versions as $version) {
Version::delete($version->id);
}
parent::destroy(get_class(), $id);
if (module_enabled("cacher")) {
Modules::$instances["cacher"]->regenerate();
}
}