#!/usr/bin/env php files() ->name('phraseanet.po') ->in( array( __DIR__ . '/locale', ) ) ; $count = 0; foreach ($finder as $file) { $cmd = sprintf( 'cp %s ./locale/phraseanet-%s.po' , $file->getRealPath() , basename(dirname(dirname($file->getRealPath()))) ) . PHP_EOL; system($cmd); $count ++; } echo "$count files copied" . PHP_EOL; exit($count ? 1 : 0);