Changeset 1825
- Timestamp:
- 08/24/06 16:23:26 (2 years ago)
- Files:
-
- tools/pake/trunk/lib/pake/pakeFunction.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/pake/trunk/lib/pake/pakeFunction.php
r1796 r1825 98 98 function pake_mkdirs($path, $mode = 0777) 99 99 { 100 $verbose = pakeApp::get_instance()->get_verbose();101 102 100 if (is_dir($path)) 103 101 { … … 115 113 function pake_copy($origin_file, $target_file, $options = array()) 116 114 { 117 $verbose = pakeApp::get_instance()->get_verbose();118 119 115 if (!array_key_exists('override', $options)) 120 116 { … … 143 139 } 144 140 141 function pake_rename($origin, $target, $options = array()) 142 { 143 // we check that target does not exist 144 if (is_readable($target)) 145 { 146 throw new pakeException(sprintf('Cannot rename because the target "%" already exist.', $target)); 147 } 148 149 pake_echo_action('rename', $origin.' > '.$target); 150 rename($origin, $target); 151 } 152 145 153 function pake_mirror($arg, $origin_dir, $target_dir, $options = array()) 146 154 { … … 172 180 $files = array_reverse(pakeApp::get_files_from_argument($arg, $target_dir)); 173 181 174 $verbose = pakeApp::get_instance()->get_verbose();175 176 182 foreach ($files as $file) 177 183 { … … 195 201 $files = pakeApp::get_files_from_argument($arg, $target_dir); 196 202 197 $verbose = pakeApp::get_instance()->get_verbose();198 199 203 foreach ($files as $file) 200 204 { … … 208 212 { 209 213 $files = pakeApp::get_files_from_argument($arg, $target_dir, true); 210 211 $verbose = pakeApp::get_instance()->get_verbose();212 214 213 215 foreach ($files as $file) … … 244 246 if (!$ok) 245 247 { 246 $verbose = pakeApp::get_instance()->get_verbose();247 248 pake_echo_action('symlink+', $target_dir); 248 249 symlink($origin_dir, $target_dir); … … 256 257 257 258 $files = pakeApp::get_files_from_argument($arg, $target_dir, true); 258 259 $verbose = pakeApp::get_instance()->get_verbose();260 259 261 260 foreach ($files as $file)