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


PHP Package類代碼示例

本文整理匯總了PHP中Package的典型用法代碼示例。如果您正苦於以下問題:PHP Package類的具體用法?PHP Package怎麽用?PHP Package使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Package類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildPackage

 /**
  * @param string $namespace
  * @param array $pathList
  * @return Package
  */
 private function buildPackage($namespace, array $pathList)
 {
     $package = new Package();
     $package->setNamespace($namespace);
     $package->setPathList($pathList);
     return $package;
 }
開發者ID:raphhh,項目名稱:samurai,代碼行數:12,代碼來源:ProjectTest.php

示例2: validate

 /**
  * @see Form::validate()
  */
 public function validate()
 {
     parent::validate();
     // validate class path
     if (empty($this->classPath)) {
         throw new UserInputException('classPath');
     }
     try {
         $package = new Package($this->packageID);
         if (!@file_exists(FileUtil::getRealPath(WCF_DIR . $package->getDir() . $this->classPath))) {
             throw new UserInputException('classPath', 'doesNotExist');
         }
     } catch (SystemException $e) {
         throw new UserInputException('classPath', 'doesNotExist');
     }
     try {
         CronjobEditor::validate($this->startMinute, $this->startHour, $this->startDom, $this->startMonth, $this->startDow);
     } catch (SystemException $e) {
         // extract field name
         $fieldName = '';
         if (preg_match("/cronjob attribute '(.*)'/", $e->getMessage(), $match)) {
             $fieldName = $match[1];
         }
         throw new UserInputException($fieldName, 'notValid');
     }
 }
開發者ID:joaocustodio,項目名稱:EmuDevstore-1,代碼行數:29,代碼來源:CronjobsAddForm.class.php

示例3: noticePackageUploaded

 public function noticePackageUploaded(Package $pkg)
 {
     $app = $this->app;
     $package_url = mfwRequest::makeURL("/package?id={$pkg->getId()}");
     ob_start();
     include APP_ROOT . '/data/notice_mail_template.php';
     $body = ob_get_clean();
     $addresses = array();
     foreach ($this->rows as $r) {
         if ($r['notify']) {
             $addresses[] = $r['mail'];
         }
     }
     if (empty($addresses)) {
         return;
     }
     $subject = "New Package Uploaded to {$app->getTitle()}";
     $sender = Config::get('mail_sender');
     $to = $sender;
     $header = "From: {$sender}" . "\nBcc: " . implode(', ', $addresses);
     mb_language('uni');
     mb_internal_encoding('UTF-8');
     if (!mb_send_mail($to, $subject, $body, $header)) {
         throw new RuntimeException("mb_send_mail faild (pkg={$pkg->getId()}, {$pkg->getTitle()})");
     }
 }
開發者ID:kzfk,項目名稱:emlauncher,代碼行數:26,代碼來源:InstallUser.php

示例4: setPackage

 public function setPackage(Package $package)
 {
     if ($this->package !== $package) {
         $this->package = $package;
         $package->addVersion($this);
     }
 }
開發者ID:pixelpolishers,項目名稱:resolver-php-server,代碼行數:7,代碼來源:Version.php

示例5: run

 public function run(array $arguments)
 {
     $json = $this->deps->nearestJson();
     $package = new Package(dirname($json));
     $porcelain = count($arguments) && $arguments[0] == 'porcelain';
     if (!$porcelain) {
         Terminal::info("From {$json}\n\n");
         Terminal::bold("* project name: " . $package->getName() . "\n");
     }
     $dependencies = $package->getDependencies();
     if ($porcelain) {
         echo implode(':', $dependencies) . "\n";
     } else {
         if ($dependencies) {
             Terminal::bold("* dependencies:\n");
             foreach ($dependencies as $dep) {
                 echo "  - {$dep} ";
                 if ($this->deps->hasPackage($dep)) {
                     Terminal::success("(installed)");
                 } else {
                     Terminal::warning("(not installed)");
                 }
                 echo "\n";
             }
         } else {
             Terminal::bold("* no dependencies\n");
         }
     }
 }
開發者ID:Rhoban,項目名稱:deps,代碼行數:29,代碼來源:InfoCommand.php

示例6: process

 public function process()
 {
     //if has a request from submit button, then capture it
     $client_data = NULL;
     //TEST($json_data);
     if (isset($_REQUEST['request'])) {
         $input = $_REQUEST['request'];
     } else {
         //else, get the json data from input
         $json_data = file_get_contents('php://input');
         //decode data into array
         $data = json_decode($json_data, true);
         //use a package to store the object
         $package = new Package();
         //data is in json encode form, so must decode it
         $package->get_data_from($data, true);
         // get request
         $input = $package->get_message();
         // get data of clients if available
         $client_data = $package->get_data();
     }
     //change value in $input into lower case
     $func = strtolower(trim(str_replace("/", "", $input)));
     //replace 'space' with '_'
     $func = str_replace(" ", "_", $func);
     //if the method exist, call it
     if ((int) method_exists($this, $func) > 0) {
         $this->{$func}($client_data);
     } else {
         $this->response('', 404);
     }
     // If the method not exist with in this class, response would be "Page not found".
 }
開發者ID:Ruyka,項目名稱:Tam-An-Food-Store-Manager,代碼行數:33,代碼來源:Server.php

示例7: testRegister

 public function testRegister()
 {
     $app = $this->app;
     $package = new Package();
     $package->register($app);
     $this->assertTrue($app->getContainer()->has(Storage\AccessToken::class));
 }
開發者ID:tonis-io,項目名稱:oauth2,代碼行數:7,代碼來源:PackageTest.php

示例8: export

 public static function export(&$metadata)
 {
     $package = Doctrine::getTable('Package')->findOneByName($metadata['packageName']);
     if (!$package) {
         Package_Message::log('debug', 'Creating new package entry for ' . $metadata['packageName'] . '@' . $metadata['basedir']);
         $package = new Package();
     } else {
         Package_Message::log('debug', 'Updating package entry for ' . $metadata['packageName'] . '@' . $metadata['basedir'] . ' (' . $package['package_id'] . ')');
     }
     $registryIgnoreKeys = array_flip(array('packageName', 'displayName', 'version', 'packageStatus', 'directory', 'configure_instance', 'navStructures', 'datastore_id', 'type', 'upgrades', 'downgrades', 'basedir', 'status', 'models'));
     $package['name'] = $metadata['packageName'];
     $package['display_name'] = $metadata['displayName'];
     $package['version'] = $metadata['version'];
     $package['type'] = $metadata['type'];
     $package['status'] = $metadata['status'];
     $package['basedir'] = $metadata['basedir'];
     $package['navigation'] = $metadata['navStructures'];
     $package['registry'] = array_diff_key($metadata, $registryIgnoreKeys);
     $package->save();
     $metadata['datastore_id'] = $package['package_id'];
     if (!empty($metadata['models'])) {
         $models = Doctrine::loadModels($metadata['directory'] . '/models', Doctrine::MODEL_LOADING_CONSERVATIVE);
         self::integrateNumberType($models, $metadata['datastore_id']);
     }
 }
開發者ID:swk,項目名稱:bluebox,代碼行數:25,代碼來源:Datastore.php

示例9: testIssue9Failure

 public function testIssue9Failure()
 {
     $package = new Package();
     $package->setMessages(['FOO' => 'The text for "foo."', 'BAR' => 'The text for "bar."']);
     // $this->packages->set('Vendor.Package', 'en_UK', $package);
     // $this->setExpectedException('Exception');
     // $translator = $this->translators->get('Vendor.Package', 'en_UK');
 }
開發者ID:fabioalvaro,項目名稱:cakexuxu,代碼行數:8,代碼來源:TranslatorLocatorTest.php

示例10: getPackageMetaDataUsesMetaDataReader

 /**
  * @test
  * @author Christopher Hlubek <hlubek@networkteam.com>
  * @author Robert Lemke <robert@typo3.org>
  */
 public function getPackageMetaDataUsesMetaDataReader()
 {
     $mockMetaData = $this->getMock('F3\\FLOW3\\Package\\MetaDataInterface');
     $mockMetaDataReader = $this->getMock('F3\\FLOW3\\Package\\MetaData\\ReaderInterface');
     $package = new Package('FLOW3', FLOW3_PATH_FLOW3);
     $package->injectMetaDataReader($mockMetaDataReader);
     $mockMetaDataReader->expects($this->once())->method('readPackageMetaData')->will($this->returnValue($mockMetaData));
     $this->assertSame($mockMetaData, $package->getPackageMetaData());
 }
開發者ID:kdambekalns,項目名稱:framework-benchs,代碼行數:14,代碼來源:PackageTest.php

示例11: getShipment

 private function getShipment()
 {
     $shipment = new Shipment();
     $shipment->setFromIsResidential(false)->setFromStateProvinceCode('IN')->setFromPostalCode('46205')->setFromCountryCode('US')->setToIsResidential(true)->setToPostalCode('20101')->setToCountryCode('US');
     $package = new Package();
     $package->setLength(12)->setWidth(4)->setHeight(3)->setWeight(3);
     $shipment->addPackage($package);
     return $shipment;
 }
開發者ID:dlashua,項目名稱:shipping,代碼行數:9,代碼來源:ShipmentTest.php

示例12: getPackageInstallUsers

 public static function getPackageInstallUsers(Package $pkg)
 {
     $sql = 'SELECT distinct(mail) FROM install_log WHERE package_id = ?';
     $rows = mfwDBIBase::getAll($sql, array($pkg->getId()));
     $mails = array();
     foreach ($rows as $r) {
         $mails[] = $r['mail'];
     }
     return $mails;
 }
開發者ID:kzfk,項目名稱:emlauncher,代碼行數:10,代碼來源:InstallLog.php

示例13: component_row

function component_row(Package $package, $indentation, TableCreator $table_creator)
{
    $package->with('integration');
    $ret = $table_creator->row(array($package->full_name(), $package->integration == null ? 'Architettura del sistema' : $package->integration->public_id()));
    $nested = $package->with('packages')->packages;
    foreach ($nested as $nuc) {
        $ret .= component_row($nuc, $indentation + 1, $table_creator);
    }
    return $ret;
}
開發者ID:black2279,項目名稱:Tracy-openshift,代碼行數:10,代碼來源:package_integration.php

示例14: addIdPackage

 /** Dodaje pakiet jako powiązany
  *
  * @param int|string $idPackage - id definicji we frontend
  */
 public function addIdPackage($idPackage)
 {
     if ($idPackage == '') {
         throw new Logger_Exception('Nie podano parametru $idPackage');
     }
     $this->packageId = $idPackage;
     $model = new Package();
     $row = $model->findOne($idPackage);
     $this->packageName = $row->name;
 }
開發者ID:knatorski,項目名稱:SMS,代碼行數:14,代碼來源:Package.php

示例15: createManifest

 /**
  * Generates a manifest JSON file and returns the path.
  *
  * @param \JWage\APNS\Safari\Package $package
  * @return string $manifestJsonPath
  */
 public function createManifest(Package $package)
 {
     $manifestData = array();
     foreach (Package::$packageFiles as $rawFile) {
         $filePath = sprintf('%s/%s', $package->getPackageDir(), $rawFile);
         $manifestData[$rawFile] = sha1(file_get_contents($filePath));
     }
     $manifestJsonPath = sprintf('%s/manifest.json', $package->getPackageDir());
     $manifestJson = json_encode((object) $manifestData);
     file_put_contents($manifestJsonPath, $manifestJson);
     return $manifestJsonPath;
 }
開發者ID:arshdeep79,項目名稱:php-apns,代碼行數:18,代碼來源:PackageManifester.php


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