| Conditions | 4 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 70 | protected function createDir($fileName) |
||
| 71 | { |
||
| 72 | $dir = $fileName; |
||
| 73 | $createdDirs = array(); |
||
| 74 | do { |
||
| 75 | $dir = dirname($dir); |
||
| 76 | $createdDirs[] = $dir; |
||
| 77 | } while (! file_exists($dir)); |
||
| 78 | array_pop($createdDirs); |
||
| 79 | $this->createdDirs = array_reverse($createdDirs); |
||
| 80 | |||
| 81 | $targetdir = dirname($fileName); |
||
| 82 | if (!file_exists($targetdir)) { |
||
| 83 | $created = mkdir($targetdir, 0766, true); |
||
| 84 | if (!$created) { |
||
| 85 | $this->success = false; |
||
| 86 | throw new Downloader\TransportException( |
||
| 87 | "The file could not be written to $this->fileName." |
||
| 88 | ); |
||
| 89 | } |
||
| 90 | } |
||
| 91 | } |
||
| 92 | } |
||
| 93 |