Upload files to 'includes'
This commit is contained in:
24
includes/CachedFileReader.php
Normal file
24
includes/CachedFileReader.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the POMO package.
|
||||
*/
|
||||
|
||||
namespace POMO\Streams;
|
||||
|
||||
/**
|
||||
* Reads the contents of the file in the beginning.
|
||||
*
|
||||
* @author Danilo Segan <danilo@kvota.net>
|
||||
*/
|
||||
class CachedFileReader extends StringReader implements StreamInterface
|
||||
{
|
||||
public function __construct($filename)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_str = file_get_contents($filename);
|
||||
if (false === $this->_str) {
|
||||
return false;
|
||||
}
|
||||
$this->_pos = 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user