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


PHP type::getType方法代码示例

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


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

示例1: afterSave

 protected function afterSave()
 {
     // Set new uploaded file
     if ($this->cUploadedFile !== null && $this->cUploadedFile instanceof CUploadedFile) {
         $newFilename = $this->getPath() . DIRECTORY_SEPARATOR . $this->getFilename();
         if (is_uploaded_file($this->cUploadedFile->getTempName())) {
             move_uploaded_file($this->cUploadedFile->getTempName(), $newFilename);
             @chmod($newFilename, 0744);
         }
         /**
          * For uploaded jpeg files convert them again - to handle special
          * exif attributes (e.g. orientation)
          */
         if ($this->cUploadedFile->getType() == 'image/jpeg') {
             ImageConverter::TransformToJpeg($newFilename, $newFilename);
         }
     }
     // Set file by given contents
     if ($this->newFileContent != null) {
         $newFilename = $this->getPath() . DIRECTORY_SEPARATOR . $this->getFilename();
         file_put_contents($newFilename, $this->newFileContent);
         @chmod($newFilename, 0744);
     }
     return parent::afterSave();
 }
开发者ID:Wikom,项目名称:humhub,代码行数:25,代码来源:File.php

示例2: afterFTPReceived

 /**
  * (dispatcher hook)
  * Check recieved file sequences
  * @param type $receiver
  * @param type $filepaths
  * @param type $hostname
  * @return type
  */
 public function afterFTPReceived($receiver, $filepaths, $hostname)
 {
     if ($receiver->getType() != $this->getName()) {
         return;
     }
     $this->checkFilesSeq($filepaths, $hostname);
 }
开发者ID:kalburgimanjunath,项目名称:system,代码行数:15,代码来源:nsn.php

示例3: afterFTPReceived

 /**
  * Check the  received files sequence.
  * @param type $receiver
  * @param type $filepaths
  * @param type $hostname
  * @return type
  * @throws Exception
  */
 public function afterFTPReceived($receiver, $filepaths, $hostname)
 {
     if ($receiver->getType() != 'smsc' && $receiver->getType() != "smpp" && $receiver->getType() != "mmsc") {
         return;
     }
     $this->checkFilesSeq($filepaths, $hostname);
     $path = Billrun_Factory::config()->getConfigValue($receiver->getType() . '.thirdparty.backup_path', false, 'string');
     if (!$path) {
         return;
     }
     if ($hostname) {
         $path = $path . DIRECTORY_SEPARATOR . $hostname;
     }
     foreach ($filepaths as $filePath) {
         if (!$receiver->backupToPath($filePath, $path, true, true)) {
             Billrun_Factory::log()->log("Couldn't save file {$filePath} to third patry path at : {$path}", Zend_Log::ERR);
         }
     }
 }
开发者ID:ngchie,项目名称:system,代码行数:27,代码来源:sms.php

示例4: validateField

 /**
  * Bulk PHP validation.
  *
  * @param type $field Field class instance
  * @param type $value
  * @return \WP_Error|boolean
  * @throws Exception
  */
 public function validateField($field)
 {
     $value = apply_filters('wptoolset_validation_value_' . $field->getType(), $field->getValue());
     $rules = $this->_parseRules($field->getValidationData(), $value);
     // If not required but empty - skip
     if (!isset($rules['required']) && (is_null($value) || $value === false || $value === '')) {
         return true;
     }
     try {
         $errors = array();
         foreach ($rules as $rule => $args) {
             if (!$this->validate($rule, $args['args'])) {
                 $errors[] = $field->getTitle() . ' ' . $args['message'];
             }
         }
         if (!empty($errors)) {
             throw new Exception();
         }
     } catch (Exception $e) {
         return new WP_Error(__CLASS__ . '::' . __METHOD__, 'Field not validated', $errors);
     }
     return true;
 }
开发者ID:SpencerNeitzke,项目名称:types,代码行数:31,代码来源:class.validation.php

示例5: generaAdd

 /**
  * 
  * @param type $nome
  * @param type $campi
  */
 private function generaAdd($nome, $campi)
 {
     $sql_ = $type = $campi->getType() . ", ";
     if ($campi->getDefault()) {
         $sql_ .= "DEFAULT = " . $campi->getDefault() . ",";
     }
     if ($campi->getNullable()) {
         $sql .= " NULLABLE = " . $campi->getNullable();
     }
     if ($sql_[strlen($sql_) - 1] == ",") {
         $sql_ = substr($sql_, 0, -1);
     }
     if ($sql_) {
         $this->qb->addColumn($this->name, $nome, $sql_);
     }
 }
开发者ID:Zanej,项目名称:cms,代码行数:21,代码来源:EntityCreator.php

示例6: validateField

 /**
  * Bulk PHP validation.
  * 
  * @param type $field Field class instance
  * @param type $value
  * @return \WP_Error|boolean
  * @throws Exception
  */
 public function validateField($field)
 {
     $rules = $field->getValidationData();
     $value = apply_filters('wptoolset_validation_value_' . $field->getType(), $field->getValue());
     // If not required but empty - skip
     if (!isset($rules['required']) && (is_null($value) || $value === false || $value === '')) {
         return true;
     }
     try {
         $errors = array();
         foreach ($rules as $rule => $args) {
             $rule = apply_filters('wptoolset_validation_rule_php', $rule);
             $args['args'] = apply_filters('wptoolset_validation_args_php', $args['args'], $rule);
             // Set value in args - search string '$value' or replace first element
             $replace = array_search('$value', $args['args']);
             if ($replace !== false) {
                 $args['args'][$replace] = $value;
             } else {
                 $args['args'][0] = $value;
             }
             if (!$this->validate($rule, $args['args'])) {
                 $errors[] = $args['message'];
             }
         }
         if (!empty($errors)) {
             throw new Exception();
         }
     } catch (Exception $e) {
         return new WP_Error(__CLASS__ . '::' . __METHOD__, 'Field not validated', $errors);
     }
     return true;
 }
开发者ID:javierdlahoz,项目名称:paella-development,代码行数:40,代码来源:class.validation.php

示例7: execPostPackageInstall

 /**
  * Execute After Packages are installed
  * @param type $installedPackage
  * @return boolean
  */
 protected function execPostPackageInstall($installedPackage)
 {
     if ($installedPackage->getType() != 'horisen-cms_mod') {
         return true;
     }
     $extras = $installedPackage->getExtra();
     if (!isset($extras['installer-name'])) {
         return true;
     }
     //make symlinks
     //$this->makeSymlinkModulePublic($extras['installer-name']);
     $sqlFile = $this->dir . '/application/modules/' . $extras['installer-name'] . '/init.sql';
     if (!file_exists($sqlFile)) {
         return true;
     }
     $this->copySqlScript($sqlFile, $extras['installer-name']);
     //$sql = file_get_contents($sqlFile);
     //if($this->execSql($sql)){
     //$this->io->write("Sql executed for module " . $installedPackage->getName());
     //}
 }
开发者ID:bokultis,项目名称:kardiomedika,代码行数:26,代码来源:Installer.php

示例8: validateField

 /**
  * Bulk PHP validation.
  *
  * @param type $field Field class instance
  * @param type $value
  * @return \WP_Error|boolean
  * @throws Exception
  */
 public function validateField($field)
 {
     $value = apply_filters('wptoolset_validation_value_' . $field->getType(), $field->getValue());
     $rules = $this->_parseRules($field->getValidationData(), $value);
     // If not required but empty - skip
     if (!isset($rules['required']) && (is_null($value) || $value === false || $value === '')) {
         return true;
     }
     try {
         $errors = array();
         foreach ($rules as $rule => $args) {
             if (!$this->validate($rule, $args['args'])) {
                 /**
                  * Allow turn off field name.
                  *
                  * Allow turn off field name from error message.
                  *
                  * @since x.x.x
                  *
                  * @param boolean $var show field title in message, * default true.
                  */
                 if (apply_filters('toolset_common_validation_add_field_name_to_error', true)) {
                     $errors[] = $field->getTitle() . ' ' . $args['message'];
                 } else {
                     $errors[] = $args['message'];
                 }
             }
         }
         if (!empty($errors)) {
             throw new Exception();
         }
     } catch (Exception $e) {
         return new WP_Error(__CLASS__ . '::' . __METHOD__, 'Field not validated', $errors);
     }
     return true;
 }
开发者ID:aarongillett,项目名称:B22-151217,代码行数:44,代码来源:class.validation.php

示例9: getResponse

 /**
  * 
  * @param type $method
  * @param type $uri
  * @return type
  * @throws InvalidStatusCodeException
  */
 protected function getResponse($method, $uri)
 {
     if ($this->responseStatusCode != NULL) {
         $_responseStatusCode = $this->responseStatusCode;
         if ($method->getResponse($this->responseStatusCode) != NULL) {
             $this->responseStatusCode = NULL;
             return $method->getResponse($_responseStatusCode);
         }
         throw new InvalidStatusCodeException($this->responseStatusCode, $uri, $method->getType());
     }
     foreach ($this->statusCodes as $statusCode) {
         $response = $method->getResponse($statusCode);
         if ($response != NULL) {
             return $response;
         }
     }
     if (sizeof($method->getResponses()) > 0) {
         $responses = $method->getResponses();
         return $responses[key($responses)];
     }
     throw new NoResponseFoundException($uri, $method->getType());
 }
开发者ID:karpdamian,项目名称:mock,代码行数:29,代码来源:RamlMockHandler.php


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