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


PHP Transform::with方法代碼示例

本文整理匯總了PHP中Transform::with方法的典型用法代碼示例。如果您正苦於以下問題:PHP Transform::with方法的具體用法?PHP Transform::with怎麽用?PHP Transform::with使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Transform的用法示例。


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

示例1: __construct

 /**
  * Class constructor
  *
  * @param Transform $transform  Transform interface or DSN string
  * @param int       $opt        Output handler options
  */
 public function __construct($transform, $opt = 0)
 {
     if (!$transform instanceof Transform) {
         $transform = Transform::with($this->transform);
     }
     $this->transform = $transform;
     $this->opt = $opt;
     ob_start(array($this, 'callback'));
 }
開發者ID:jasny,項目名稱:Q,代碼行數:15,代碼來源:Transform.php

示例2: loadFile

 /**
  * Load a config file or dir (no caching)
  * 
  * @param Fs_Item $file_object
  * @param string $group
  * @return array
  */
 protected function loadFile($file_object, $group = null)
 {
     if ($file_object instanceof Fs_File) {
         return Transform::with('unserialize-yaml')->process($file_object->path());
     } elseif ($file_object instanceof Fs_Dir) {
         return $this->loadDir($file_object);
     }
     return array();
 }
開發者ID:jasny,項目名稱:Q,代碼行數:16,代碼來源:Yaml.php

示例3: loadFile

 /**
  * Load a config file or dir
  *
  * @param Fs_Item $file_object
  * @param string $group
  * @return array
  */
 protected function loadFile($file_object, $group = null)
 {
     if ($file_object instanceof Fs_File) {
         return Transform::with('unserialize-ini')->process($file_object->path());
     } elseif (!empty($this->_options['recursive']) && $file_object instanceof Fs_Dir) {
         return $this->loadDir($file_object);
     }
     return array();
 }
開發者ID:jasny,項目名稱:Q,代碼行數:16,代碼來源:Ini.php

示例4: loadFile

 /**
  * Load a config file or dir (no caching)
  *
  * @param Fs_Item $file_object
  * @param string $group
  * @return array
  */
 protected function loadFile($file_object, $group = null)
 {
     $settings = array();
     if ($file_object instanceof Fs_File) {
         $settings = Transform::with('unserialize-json')->process($file_object->path());
         if (!isset($settings)) {
             trigger_error("Failed to parse json file '{$file}'.", E_USER_WARNING);
         }
     } elseif (!empty($this->_options['recursive']) && $file_object instanceof Fs_Dir) {
         $settings = $this->loadDir($file_object);
     }
     return $settings;
 }
開發者ID:jasny,項目名稱:Q,代碼行數:20,代碼來源:Json.php

示例5: __construct

 /**
  * Class constructor
  * 
  * @param array $options
  */
 public function __construct($path, $options = array())
 {
     if (is_array($path)) {
         $options = $path + $options;
         $path = null;
         if (isset($options['driver'])) {
             if (isset($options[0])) {
                 if (!isset($options['path'])) {
                     $options['path'] = $options[0];
                 }
                 if (!isset($options['ext'])) {
                     $options['ext'] = $options['driver'];
                 }
                 unset($options[0]);
             } else {
                 $options[0] = $options['driver'];
             }
         }
     }
     if (isset($options[0])) {
         if (strpos($options[0], ':') !== false) {
             list($options['ext'], $options['path']) = explode(':', $options[0], 2);
         } else {
             $key = !isset($options['ext']) && strpos($options[0], '.') === false && strpos($options[0], '/') === false ? 'ext' : 'path';
             if (!isset($options[$key])) {
                 $options[$key] = $options[0];
             }
         }
     }
     $this->_path = isset($path) ? Fs::dir($path) : (isset($options['path']) ? Fs::dir($options['path']) : null);
     if (isset($options['transformer'])) {
         $this->_transformer = $options['transformer'] instanceof Transformer ? $options['transformer'] : Transform::with($options['transformer']);
     }
     $this->_ext = isset($options['ext']) ? $options['ext'] : (isset($this->_transformer) ? $this->_transformer->ext : null);
     if (!isset($this->_transformer) && !empty($this->_ext)) {
         $this->_transformer = Transform::from($this->_ext);
     }
     \ArrayObject::__construct(array(), \ArrayObject::ARRAY_AS_PROPS);
     if (!empty($options['loadall'])) {
         $this->loadAll();
     }
 }
開發者ID:jasny,項目名稱:Q,代碼行數:47,代碼來源:Dir.php

示例6: testDriverMaxlength

 /**
  * Test driver maxlength
  */
 public function testDriverMaxlength()
 {
     $transform = Transform::with('maxlength');
     $this->assertType('Q\\Validator_Maxlength', $transform);
 }
開發者ID:jasny,項目名稱:Q,代碼行數:8,代碼來源:CreationTest.php


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