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


PHP Reader::__construct方法代码示例

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


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

示例1:

 function __construct($file, $debug = null)
 {
     parent::__construct($debug);
     if (($this->_file_handler = fopen($file, "r")) == false) {
         throw new \Exception("Error: Invalid file");
     }
 }
开发者ID:litmanovitziv,项目名称:struct-reader,代码行数:7,代码来源:JSONReader.php

示例2: __construct

 /**
  * Constructor.
  *
  * @param string $filepath a relative or absolute path to the file.
  *
  * @param string $delimiter the delimiter that separates columns in the file.
  *
  * @param string $enclosure (optional, default value is '"') the character that is used for
  *    enclosing column values.
  *
  * @param string $escape (optional, default value is '\') the character used for escaping.
  *
  * For `$delimiter`, `$enclosure`, and `$escape` see also http://php.net/manual/en/function.str-getcsv.php.
  */
 public function __construct($filepath, $delimiter, $enclosure = '"', $escape = "\\")
 {
     parent::__construct($filepath);
     $this->delimiter = $delimiter;
     $this->enclosure = $enclosure;
     $this->escape = $escape;
     $this->header = null;
 }
开发者ID:fiedsch,项目名称:datamanagement,代码行数:22,代码来源:CsvReader.php

示例3: __construct

 /**
  * Constructor. Creates a new TextReader on an underlying input
  * stream with a given charset.
  *
  * @param   io.streams.InputStream stream
  * @param   string charset the charset the stream is encoded in or NULL to trigger autodetection by BOM
  */
 public function __construct(InputStream $stream, $charset = NULL)
 {
     parent::__construct($stream);
     $this->in = Streams::readableFd($stream);
     if (NULL === $charset) {
         $charset = $this->detectCharset();
     }
     if (!stream_filter_append($this->in, 'convert.iconv.' . $charset . '/' . xp::ENCODING, STREAM_FILTER_READ)) {
         throw new IOException('Could not append stream filter');
     }
     $this->charset = $charset;
 }
开发者ID:Gamepay,项目名称:xp-framework,代码行数:19,代码来源:TextReader.class.php

示例4:

 function __construct($file, $delimiter, $debug = null)
 {
     parent::__construct($debug);
     if (($this->_file_handler = fopen($file, "r")) == false) {
         throw new \Exception("Error: Invalid file");
     }
     if (isset($delimiter)) {
         $this->_delimiter = $delimiter;
     } else {
         throw new \Exception("Error: Not defined delimiter");
     }
     if (($this->_header = fgetcsv($this->_file_handler, 0, $this->_delimiter)) == false) {
         throw new \Exception("Reading of Header was failed");
     }
     if ($this->_env->isDebugEnv() & ENV_DEBUG_PRINTED) {
         var_dump($this->_file_handler);
         echo PHP_EOL;
     }
 }
开发者ID:litmanovitziv,项目名称:struct-reader,代码行数:19,代码来源:CSVReader.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $render_ids = Config::render_ids();
     if ($render_ids !== NULL) {
         if (is_array($render_ids)) {
             $this->partial = $render_ids;
         } else {
             $this->partial[$render_ids] = 1;
         }
         $skip_ids = Config::skip_ids();
         if ($skip_ids !== NULL) {
             if (is_array($skip_ids)) {
                 $this->skip = $skip_ids;
             } else {
                 $this->skip[$skip_ids] = 1;
             }
         }
     } else {
         throw new \Exception("Didn't get any IDs to seek");
     }
     $parents = array();
     if (file_exists(Config::output_dir() . "index.sqlite")) {
         $sqlite = new \SQLite3(Config::output_dir() . "index.sqlite");
         // Fetch all ancestors of the ids we should render
         foreach ($render_ids as $p => $v) {
             do {
                 $id = $sqlite->escapeString($p);
                 $row = $sqlite->query("SELECT parent_id FROM ids WHERE docbook_id = '{$id}'")->fetchArray(SQLITE3_ASSOC);
                 if ($row["parent_id"]) {
                     $parents[] = $p = $row["parent_id"];
                     continue;
                 }
                 break;
             } while (1);
         }
     }
     $this->parents = $parents;
 }
开发者ID:TazeTSchnitzel,项目名称:phd,代码行数:39,代码来源:Partial.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $render_ids = Config::render_ids();
     if ($render_ids !== NULL) {
         if (is_array($render_ids)) {
             $this->partial = $render_ids;
         } else {
             $this->partial[$render_ids] = 1;
         }
         $skip_ids = Config::skip_ids();
         if ($skip_ids !== NULL) {
             if (is_array($skip_ids)) {
                 $this->skip = $skip_ids;
             } else {
                 $this->skip[$skip_ids] = 1;
             }
         }
     } else {
         throw new \Exception("Didn't get any IDs to seek");
     }
 }
开发者ID:philip,项目名称:phd,代码行数:22,代码来源:Partial.php

示例7: __construct

 public function __construct($filename)
 {
     parent::__construct();
     $this->_f = fopen($filename, 'rb');
 }
开发者ID:bohwaz,项目名称:featherbb,代码行数:5,代码来源:FileReader.php

示例8: __construct

 /**
  * Create iterator instance.
  *
  * @param Archive $archive
  * @param array $options
  */
 public function __construct(Archive $archive, $options = array())
 {
     parent::__construct($archive->getFilename(), $archive->getCompression());
     $this->options = $options;
 }
开发者ID:bombayworks,项目名称:currycms,代码行数:11,代码来源:Iterator.php

示例9: __construct

 public function __construct($str = '')
 {
     parent::__construct();
     $this->_str = $str;
     $this->_pos = 0;
 }
开发者ID:bohwaz,项目名称:featherbb,代码行数:6,代码来源:StringReader.php

示例10: __construct

 /**
  * Construct the Lexer object
  */
 public function __construct()
 {
     parent::__construct();
     $this->line = 1;
     $this->column = 1;
 }
开发者ID:g4z,项目名称:poop,代码行数:9,代码来源:Lexer.php


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