| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 27 | public function __construct($fileName) |
||
| 28 | { |
||
| 29 | $this->fileName = $fileName; |
||
| 30 | if (is_dir($fileName)) { |
||
| 31 | throw new Downloader\TransportException( |
||
| 32 | "The file could not be written to $fileName. Directory exists." |
||
| 33 | ); |
||
| 34 | } |
||
| 35 | |||
| 36 | $this->createDir($fileName); |
||
| 37 | |||
| 38 | $this->fp = fopen($fileName, 'wb'); |
||
| 39 | if (!$this->fp) { |
||
| 40 | throw new Downloader\TransportException( |
||
| 41 | "The file could not be written to $fileName." |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | } |
||
| 45 | |||
| 93 |