當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。