@@ 837-840 (lines=4) @@ | ||
834 | $target = $args['target']; |
|
835 | $name = $args['name']; |
|
836 | ||
837 | if (($volume = $this->volume($target)) == false |
|
838 | || ($rm = $volume->file($target)) == false) { |
|
839 | return array('error' => $this->error(self::ERROR_RENAME, '#'.$target, self::ERROR_FILE_NOT_FOUND)); |
|
840 | } |
|
841 | $rm['realpath'] = $volume->realpath($target); |
|
842 | ||
843 | return ($file = $volume->rename($target, $name)) == false |
|
@@ 861-865 (lines=5) @@ | ||
858 | $suffix = empty($args['suffix']) ? 'copy' : $args['suffix']; |
|
859 | ||
860 | foreach ($targets as $target) { |
|
861 | if (($volume = $this->volume($target)) == false |
|
862 | || ($src = $volume->file($target)) == false) { |
|
863 | $result['warning'] = $this->error(self::ERROR_COPY, '#'.$target, self::ERROR_FILE_NOT_FOUND); |
|
864 | break; |
|
865 | } |
|
866 | ||
867 | if (($file = $volume->duplicate($target, $suffix)) == false) { |
|
868 | $result['warning'] = $this->error($volume->error()); |
|
@@ 1023-1026 (lines=4) @@ | ||
1020 | protected function put($args) { |
|
1021 | $target = $args['target']; |
|
1022 | ||
1023 | if (($volume = $this->volume($target)) == false |
|
1024 | || ($file = $volume->file($target)) == false) { |
|
1025 | return array('error' => $this->error(self::ERROR_SAVE, '#'.$target, self::ERROR_FILE_NOT_FOUND)); |
|
1026 | } |
|
1027 | ||
1028 | if (($file = $volume->putContents($target, $args['content'])) == false) { |
|
1029 | return array('error' => $this->error(self::ERROR_SAVE, $volume->path($target), $volume->error())); |
|
@@ 1048-1051 (lines=4) @@ | ||
1045 | $mimes = !empty($args['mimes']) && is_array($args['mimes']) ? $args['mimes'] : array(); |
|
1046 | $error = array(self::ERROR_EXTRACT, '#'.$target); |
|
1047 | ||
1048 | if (($volume = $this->volume($target)) == false |
|
1049 | || ($file = $volume->file($target)) == false) { |
|
1050 | return array('error' => $this->error(self::ERROR_EXTRACT, '#'.$target, self::ERROR_FILE_NOT_FOUND)); |
|
1051 | } |
|
1052 | ||
1053 | return ($file = $volume->extract($target)) |
|
1054 | ? array('added' => array($file)) |
|
@@ 1153-1156 (lines=4) @@ | ||
1150 | $bg = null; |
|
1151 | $degree = (int)$args['degree']; |
|
1152 | ||
1153 | if (($volume = $this->volume($target)) == false |
|
1154 | || ($file = $volume->file($target)) == false) { |
|
1155 | return array('error' => $this->error(self::ERROR_RESIZE, '#'.$target, self::ERROR_FILE_NOT_FOUND)); |
|
1156 | } |
|
1157 | ||
1158 | return ($file = $volume->resize($target, $width, $height, $x, $y, $mode, $bg, $degree)) |
|
1159 | ? array('changed' => array($file)) |