-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.php
executable file
·18 lines (16 loc) · 979 Bytes
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/php
<?php
$project = $argv[1];
replaceTextInFile('skeletonSimpleProject', $project, 'src/skeletonSimpleProject/skeletonSimpleProject.php');
rename('src/skeletonSimpleProject/skeletonSimpleProject.php', 'src/skeletonSimpleProject/' . $project . '.php');
rename('src/skeletonSimpleProject', 'src/' . $project);
replaceTextInFile('skeletonSimpleProject', $project, 'tests/skeletonSimpleProject/Tests/skeletonSimpleProjectTest.php');
rename('tests/skeletonSimpleProject/Tests/skeletonSimpleProjectTest.php', 'tests/skeletonSimpleProject/Tests/' . $project . 'Test.php');
rename('tests/skeletonSimpleProject', 'tests/' . $project);
replaceTextInFile('skeletonSimpleProject', $project, 'composer.json');
replaceTextInFile('skeletonSimpleProject', $project, 'phpunit.xml.dist');
function replaceTextInFile($oldValue, $newValue, $file) {
$text = file_get_contents($file);
$newText = str_replace($oldValue, $newValue, $text);
file_put_contents($file, $newText);
}