Exemple #1
0
 /**
  * run!
  * (non-PHPdoc)
  * @see FileFinder#run()
  */
 public function run()
 {
     parent::run();
     foreach ($this->_file_path_maper as $key => $value) {
         $this->stat_lines_by_filepath($key);
     }
 }
Exemple #2
0
<?php

require_once dirname(__FILE__) . '/FileFinder.php';
$root = 'C:\\Photos';
$finder = new FileFinder($root, array('jpg'), array(), true);
$finder->run();
$finder->sort('asc');
$i = 766;
foreach ($finder->get_file_path_maper() as $key => $value) {
    $file_name = 'IMG' . str_pad($i, 4, '0', STR_PAD_LEFT) . 'A.jpg';
    $new_file_path = $root . DIRECTORY_SEPARATOR . $file_name;
    echo 'file_path = ' . $new_file_path . "\n";
    rename($key, $new_file_path);
    $i++;
}
echo 'count = ' . count($finder->get_file_path_maper());