forked from simpleid/simpleid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoboFile.php
28 lines (24 loc) · 888 Bytes
/
RoboFile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
use Symfony\Component\Finder\Finder;
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks {
public function update_copyright() {
$current_year = strftime("%Y");
$finder = new Finder();
$finder->in(['tests', 'www/core', 'www/upgrade'])->name('*.php')->append(['COPYING.txt']);
foreach($finder as $file) {
$this->taskReplaceInFile($file)
->regex('/Copyright \(C\) Kelvin Mo (\d{4})-(\d{4})(\R)/m')
->to('Copyright (C) Kelvin Mo $1-'. $current_year . '$3')
->run();
$this->taskReplaceInFile($file)
->regex('/Copyright \(C\) Kelvin Mo (\d{4})(\R)/m')
->to('Copyright (C) Kelvin Mo $1-'. $current_year . '$2')
->run();
}
}
}