當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Version::delete方法代碼示例

本文整理匯總了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('/');
     }
 }
開發者ID:xetorthio,項目名稱:pearfarm_channel_server,代碼行數:19,代碼來源:version_controller.php

示例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">
開發者ID:jsjohnst,項目名稱:Shine,代碼行數:31,代碼來源:version-edit.php

示例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());
 }
開發者ID:vito,項目名稱:chyrp-site,代碼行數:15,代碼來源:controller.Extend.php

示例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);
 }
開發者ID:Jopperi,項目名稱:wiki,代碼行數:11,代碼來源:OldWikiPage.php

示例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();
     }
 }
開發者ID:vito,項目名稱:chyrp-site,代碼行數:18,代碼來源:Extension.php


注:本文中的Version::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。