当前位置: 首页>>代码示例>>PHP>>正文


PHP Package::setName方法代码示例

本文整理汇总了PHP中Package::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Package::setName方法的具体用法?PHP Package::setName怎么用?PHP Package::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Package的用法示例。


在下文中一共展示了Package::setName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: unserialize

 /**
  * @param array $data
  */
 public function unserialize($data)
 {
     $data = json_decode($data, true);
     $packageName = key($data['packages']);
     $packages =& $data['packages'][$packageName];
     foreach ($packages as $version => $info) {
         $tmpPackage = new Package();
         $tmpPackage->setName($packageName);
         $tmpPackage->setTag($version);
         $tmpPackage->setFromArray($info);
         $this->data[$version] = $tmpPackage;
     }
     $this->name = $packageName;
     list($this->vendorName, $this->packageName) = explode('/', $packageName);
 }
开发者ID:Doanlmit,项目名称:pickleweb,代码行数:18,代码来源:Extension.php

示例2: getData

 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
include "prepend.inc.php";
$Server = getData("Server", "integer");
$User = getData("User");
$Packagename = getData("Packagename");
$html = "<h1> Database  " . $DB->Name($Server) . " - Package " . $Packagename . "</h1>";
if ($Packagename) {
    $pack = new Package($Server);
    $pack->setOwner($User);
    $pack->setName($Packagename);
    $pack->getData();
    $html .= "<table border=0><tr><th>Tag</th><th>Value</th></tr>";
    $html .= "<tr><td>Name</td><td>" . $pack->name . "</td></tr>";
    $html .= "<tr><td>Owner</td><td>" . $pack->owner . "</td></tr>";
    $html .= "<tr><td>Created</td><td>" . $pack->created . "</td></tr>";
    $html .= "<tr><td>Last Modified</td><td>" . $pack->lastmodified . "</td></tr>";
    $html .= "<tr><td>Status</td><td>" . $pack->status . "</td></tr>";
    $html .= "</table>";
    $html .= "<P><B>Package body:</b><br>";
    $html .= nl2br($pack->sql) . "<br>";
    $html .= "</P>";
}
$page = new Page("Package Properties");
$page->setHead();
$page->setBody();
开发者ID:BackupTheBerlios,项目名称:phporacleadmin,代码行数:31,代码来源:pack_detail.php

示例3: installPackage

 /**
  * Installs a package.
  * 
  * @param string $name
  * @param bool $simulate
  * @return bool
  */
 public static function installPackage($name, $simulate = false)
 {
     $package = Curry_PackageManager::getPackage($name);
     if (!$package) {
         throw new Exception('Package not found');
     }
     $installedPackage = PackageQuery::create()->findPk($name);
     if ($installedPackage) {
         throw new Exception('Package already installed');
     }
     if (!$simulate && !self::execTask($package, 'preInstall', true)) {
         return new Exception('Package installation prevented by preInstall hook.');
     }
     if (!$simulate) {
         $installedPackage = new Package();
         $installedPackage->setName($package['name']);
         $installedPackage->setVersion($package['version']);
         $installedPackage->save();
     }
     $tar = new Curry_Archive(self::getCachedFile($package['source'], true));
     foreach ($tar as $tarFile) {
         $file = $tarFile->getPathname();
         try {
             $target = PackageFile::mapFile($file);
         } catch (Exception $e) {
             self::log('Skipping: ' . $file);
             continue;
         }
         // create directory
         if ($tarFile->isDir()) {
             if (!$simulate) {
                 if (!file_exists($target)) {
                     mkdir($target, 0777, true);
                 }
             }
             continue;
         }
         // Extract file
         self::log('Adding: ' . $file, Curry_Backend::MSG_SUCCESS);
         if (!$simulate) {
             if (file_exists($target)) {
                 $backupTarget = $target . "." . date("-Ymd_His");
                 if (file_exists($backupTarget)) {
                     throw new Exception('Unable to backup existing file.');
                 }
                 rename($target, $backupTarget);
             }
             $tarFile->extract($target);
             $packageFile = new PackageFile();
             $packageFile->setPackage($installedPackage);
             $packageFile->setFilename($file);
             $packageFile->setChecksum(sha1_file($target));
             $packageFile->save();
         }
     }
     if (!$simulate) {
         self::execTaskWithReload($package, 'postInstall');
     }
     self::$installed = null;
     return true;
 }
开发者ID:varvanin,项目名称:currycms,代码行数:68,代码来源:PackageManager.php

示例4: testGetAndSetName

 public function testGetAndSetName()
 {
     $this->assertEquals(null, $this->sut->getName());
     $this->sut->setName('bar');
     $this->assertEquals('bar', $this->sut->getName());
 }
开发者ID:Barbarrosa,项目名称:packages,代码行数:6,代码来源:RemoteTest.php


注:本文中的Package::setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。