-
Notifications
You must be signed in to change notification settings - Fork 0
/
SetupDevelopment.php
42 lines (31 loc) · 1.2 KB
/
SetupDevelopment.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
$baseDir = '/data/www/';
$testProject = 'test123';
$vendorSymlinks = [
'vendor/synga/laravel-development-kit' => $baseDir . 'laravel-development-kit'
];
$baseFullDir = $baseDir . $testProject;
$composerPath = $baseFullDir . '/composer.json';
if (file_exists($baseFullDir)) {
exec('rm -rf ' . $baseFullDir);
}
exec('cd ' . $baseDir . ' && composer create-project --prefer-dist laravel/laravel ' . $testProject);
$composerFile = json_decode(file_get_contents($composerPath), true);
$composerFile['require']['synga/laravel-development-kit'] = 'dev-master';
if (empty($composerFile['require'])) {
unset($composerFile['require']);
}
file_put_contents(
$composerPath,
json_encode(
$composerFile,
JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE
)
);
exec('cd ' . $baseFullDir . ' && composer update');
foreach ($vendorSymlinks as $local => $remote) {
exec('cd ' . $baseFullDir . ' && rm -rf ' . $local . ' && ln -s ' . $remote . ' ' . $local);
}
exec('cd ' . $baseFullDir . ' && php artisan vendor:publish --provider="Synga\LaravelDevelopment\LaravelDevelopmentServiceProvider"');
// fix this
exec('cd ' . $baseFullDir . ' && php artisan development:setup');