|
|
@@ -26,9 +26,9 @@ class InstallApiPlatformCommand extends Command
|
|
|
|
|
|
try {
|
|
|
$this->publishPackageAssets();
|
|
|
-
|
|
|
+
|
|
|
$this->registerServiceProvider();
|
|
|
-
|
|
|
+
|
|
|
$this->linkApiPlatformAssets();
|
|
|
|
|
|
$this->updateComposerAutoload();
|
|
|
@@ -37,10 +37,10 @@ class InstallApiPlatformCommand extends Command
|
|
|
|
|
|
$this->registerApiPlatformProviders();
|
|
|
|
|
|
- $this->runDatabaseMigrations();
|
|
|
+ $this->runDatabaseMigrations();
|
|
|
|
|
|
$this->clearAndOptimizeCaches();
|
|
|
-
|
|
|
+
|
|
|
$this->generateApiKey();
|
|
|
|
|
|
$this->publishConfiguration();
|
|
|
@@ -49,7 +49,7 @@ class InstallApiPlatformCommand extends Command
|
|
|
|
|
|
$this->info(__('bagistoapi::app.graphql.install.completed-success'));
|
|
|
$this->newLine();
|
|
|
-
|
|
|
+
|
|
|
$appUrl = config('app.url');
|
|
|
|
|
|
$this->newLine();
|
|
|
@@ -117,7 +117,7 @@ class InstallApiPlatformCommand extends Command
|
|
|
|
|
|
$destination = config_path('api-platform.php');
|
|
|
|
|
|
- if ($this->files->exists(base_path('vendor/bagisto/bagisto-api/config/api-platform-vendor.php'))) {
|
|
|
+ if ($this->files->exists(base_path('vendor/bagisto/bagisto-api/config/api-platform-vendor.php'))) {
|
|
|
$source = $vendorSource;
|
|
|
}
|
|
|
|
|
|
@@ -303,6 +303,16 @@ class InstallApiPlatformCommand extends Command
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
+ if (!function_exists('symlink')) {
|
|
|
+ function symlink($target, $link) {
|
|
|
+ // Windows系统使用不同的方法
|
|
|
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
+ exec("mklink /J \"$link\" \"$target\"");
|
|
|
+ } else {
|
|
|
+ exec("ln -s \"$target\" \"$link\"");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
symlink($vendorPath, $publicPath);
|
|
|
$this->line(__('bagistoapi::app.graphql.install.asset-linked-success'));
|
|
|
} catch (\Exception $e) {
|