当前位置: 首页>>代码示例>>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;未经允许,请勿转载。