Example #1
0
 public function __construct($filename, $mode = 'r', $use_include_path = false, $context = NULL)
 {
     parent::__construct($filename);
     if (isset($context)) {
         $this->fp = fopen($filename, $mode, $use_include_path, $context);
     } else {
         $this->fp = fopen($filename, $mode, $use_include_path);
     }
     if (!$this->fp) {
         throw new Exception("Cannot read file");
     }
     //Get the column map
     $this->map = $this->fgetcsv();
     $this->currentLine = 0;
 }
Example #2
0
 public function __construct($filename, $mode = 'r', $inc = false, $ctx = null)
 {
     parent::__construct($filename);
     if (isset($context)) {
         $this->fp = fopen($filename, $mode, $inc, $ctx);
     } else {
         $this->fp = fopen($filename, $mode, $inc);
     }
     if (!$this->fp) {
         throw new Exception("Не могу прочитать файл!");
     }
     //
     $this->map = $this->fgetcsv();
     $this->currentLine = 0;
 }
Example #3
0
 /**
  * Construct
  *
  * @param string $fullPath the destination Path of a file
  * @param string $content  setup the File content
  */
 public function __construct($fullPath, $content = null)
 {
     parent::__construct($fullPath);
     $this->fullPath = $fullPath;
     $this->content = $content;
 }