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


PHP Convert::toConstant方法代码示例

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


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

示例1: encrypt

 public function encrypt($data = '', $settings = array())
 {
     $cipher = isset($settings['cipher']) ? $settings['cipher'] : 'sha256';
     $key = isset($settings['key']) ? $settings['key'] : Config::get('Encode', 'projectKey');
     // MHASH_ ön eki ilave ediliyor.
     $cipher = Convert::toConstant($cipher, 'MHASH_');
     return base64_encode(trim(mhash($cipher, $data, $key)));
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:8,代码来源:Mhash.php

示例2: dnsRecords

 public function dnsRecords($host = '', $type = 'any', $raw = false)
 {
     if (!is_string($host)) {
         return Error::set('Error', 'stringParameter', '1.(host)');
     }
     $dns = dns_get_record($this->cleanHttp($host), Convert::toConstant($type, 'DNS_'), $auth, $add, $raw);
     return (object) array('records' => $dns, 'authns' => $auth, 'addtl' => $add);
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:8,代码来源:Net.php

示例3: decrypt

 public function decrypt($data = '', $settings = array())
 {
     $cipher = isset($settings['cipher']) ? $settings['cipher'] : 'des';
     $cipher = str_replace('-', '_', $cipher);
     $key = isset($settings['key']) ? $settings['key'] : $this->keySize($cipher);
     $mode = isset($settings['mode']) ? $settings['mode'] : 'cbc';
     $iv = isset($settings['vector']) ? $settings['vector'] : $this->vectorSize($mode, $cipher);
     // MCRYPT_ ön eki ilave ediliyor.
     $cipher = Convert::toConstant($cipher, 'MCRYPT_');
     // MCRYPT_MODE_ ön eki ilave ediliyor.
     $mode = Convert::toConstant($mode, 'MCRYPT_MODE_');
     $data = base64_decode($data);
     return trim(mcrypt_decrypt($cipher, $key, trim($data), $mode, $iv));
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:14,代码来源:Mcrypt.php

示例4: locale

 public function locale($category = '', $locale = '')
 {
     return setlocale(Convert::toConstant($category, 'LC_'), $locale);
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:4,代码来源:GT.php

示例5: translationTable

 public function translationTable($table = HTML_SPECIALCHARS, $quote = ENT_COMPAT)
 {
     if (!is_scalar($table) || !is_scalar($quote)) {
         return Error::set('Error', 'scalarParameter', '1.(table) & 2.(quote)');
     }
     return get_html_translation_table(Convert::toConstant($table, 'HTML_'), Convert::toConstant($quote, 'ENT_'));
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:7,代码来源:Strings.php

示例6: deleteRecurrent

 public function deleteRecurrent($array = array(), $flags = 'string')
 {
     if (!is_array($array)) {
         return Error::set('Error', 'arrayParameter', '1.(array)');
     }
     return array_unique($array, Convert::toConstant($flags, 'SORT_'));
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:7,代码来源:Arrays.php

示例7: _filterConstant

 protected function _filterConstant($const)
 {
     return Convert::toConstant($const, 'FILTER_');
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:4,代码来源:Filters.php

示例8: casing

 public function casing($string = '', $flag = 'upper', $encoding = 'UTF-8')
 {
     if (!is_string($string)) {
         return Error::set('Error', 'stringParameter', '1.(string)');
     }
     if (!isCharset($encoding)) {
         return Error::set('Error', 'charsetParameter', '3.($encoding)');
     }
     return mb_convert_case($string, Convert::toConstant($flag, 'MB_CASE_'), $encoding);
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:10,代码来源:MB.php

示例9: tokenFileInfo

 public static function tokenFileInfo($fileName = '', $type = T_FUNCTION)
 {
     if (!is_file($fileName)) {
         return false;
     }
     // Dosya içeriğini al ve tarama yap.
     $tokens = token_get_all(file_get_contents($fileName));
     $info = array();
     $i = 0;
     $type = Convert::toConstant($type, 'T_');
     foreach ($tokens as $token) {
         // -------------------------------------------------------------------------------------------
         // Fonksiyon ismi yakalanıyor
         // -------------------------------------------------------------------------------------------
         if ($token[0] === $type) {
             // Sınıf bilgisi oluşturuluyor...
             $info[] = isset($tokens[$i + 2][1]) ? $tokens[$i + 2][1] : NULL;
         }
         // -------------------------------------------------------------------------------------------
         $i++;
     }
     return $info;
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:23,代码来源:Autoloader.php

示例10: option

 public function option($options = 0, $value = '')
 {
     $this->options[Convert::toConstant($options, 'CURLOPT_')] = $value;
     return $this;
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:5,代码来源:CURL.php

示例11: layerEffect

 public function layerEffect($effect = 'normal')
 {
     imagelayereffect($this->canvas, Convert::toConstant($effect, 'IMG_EFFECT_'));
     return $this;
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:5,代码来源:GD.php


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