Conditions | 3 |
Paths | 3 |
Total Lines | 29 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | static public function postPackageInstall() |
||
|
|||
9 | { |
||
10 | $finder = \Symfony\Component\Finder\Finder::create(); |
||
11 | |||
12 | $root_path = __DIR__ . "../../.."; |
||
13 | |||
14 | $iterator = $finder |
||
15 | ->files() |
||
16 | ->in($root_path . "/vendor/*/*/db"); |
||
17 | |||
18 | foreach ($iterator as $file) { |
||
19 | //print $file->getRealpath() . PHP_EOL; |
||
20 | |||
21 | // Dump the relative path to the file, omitting the filename |
||
22 | //var_dump($file->getRelativePath()); |
||
23 | |||
24 | // Dump the relative path to the file |
||
25 | //var_dump($file->getRelativePathname()); |
||
26 | |||
27 | if (!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())) { |
||
28 | echo sprintf("error copy migration %s..." . PHP_EOL, $file->getRelativePathname()); |
||
29 | } |
||
30 | else{ |
||
31 | echo sprintf("copy migration %s" . PHP_EOL, $file->getRelativePathname()); |
||
32 | } |
||
33 | } |
||
34 | |||
35 | echo "completed!" . PHP_EOL; |
||
36 | } |
||
37 | } |
||
38 |