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