Skip to content

Commit

Permalink
- remove symlink method
Browse files Browse the repository at this point in the history
- lock LFM version to 1.7.7
  • Loading branch information
fherryfherry committed Nov 28, 2017
1 parent 204bc32 commit 9677041
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 40 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"barryvdh/laravel-dompdf": "0.8.*",
"doctrine/dbal": "~2.3",
"maatwebsite/excel": "~2.1.0",
"unisharp/laravel-filemanager": "1.7.*",
"unisharp/laravel-filemanager": "1.7.7",
"intervention/imagecache":"2.*"
},
"autoload": {
Expand Down
42 changes: 5 additions & 37 deletions src/CRUDBoosterServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ public function boot()

if(!file_exists(app_path('Http/Controllers/AdminCmsUsersController.php'))) {
$this->publishes([__DIR__.'/userfiles/controllers/AdminCmsUsersController.php' => app_path('Http/Controllers/AdminCmsUsersController.php')],'cb_user_controller');
}
}

/* Symlink Fixed If Missing */
$this->symlinkFixed();
$this->publishes([
__DIR__.'/assets'=>public_path('vendor/crudbooster')
],'cb_asset');

require __DIR__.'/validations/validation.php';
require __DIR__.'/routes.php';
Expand Down Expand Up @@ -67,7 +68,6 @@ public function register()
$this->commands('crudboosterinstall');
$this->commands('crudboosterupdate');


$this->app->register('Barryvdh\DomPDF\ServiceProvider');
$this->app->register('Maatwebsite\Excel\ExcelServiceProvider');
$this->app->register('Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider');
Expand All @@ -91,37 +91,5 @@ private function registerCrudboosterCommand()
$this->app->singleton('crudboosterupdate',function() {
return new CrudboosterUpdateCommand;
});
}

private function symlinkFixed() {
//Create vendor folder at public
if(!file_exists(public_path('vendor'))) {
mkdir(public_path('vendor'),0777);
}

//Create symlink for uploads path
//Deprecated for a while, because uploads now handled by FileController.php
// if(file_exists(public_path('uploads'))) {
// $uploadPath = public_path('uploads');
// if(realpath($uploadPath) == $uploadPath) {
// // rrmdir(public_path('uploads'));
// rename(public_path('uploads'),'uploads.old.'.str_random(5));
// app('files')->link(storage_path('app'), public_path('uploads'));
// }
// }else{
// app('files')->link(storage_path('app'), public_path('uploads'));
// }

//Crate symlink for assets
if(file_exists(public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster'))) {
$vendorpath = public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster');
if(realpath($vendorpath) == $vendorpath) {
// rrmdir(public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster'));
rename(public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster'),'crudbooster.old.'.str_random(5));
app('files')->link(__DIR__.'/assets',public_path('vendor/crudbooster'));
}
}else{
app('files')->link(__DIR__.'/assets',public_path('vendor/crudbooster'));
}
}
}
}
6 changes: 5 additions & 1 deletion src/commands/CrudboosterInstallationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ public function handle()
}


if($this->confirm('Do you have setting the database configuration at .env ?')) {
if($this->confirm('Do you have setting the database configuration at .env ?')) {

if(!file_exists(public_path('vendor'))) {
mkdir(public_path('vendor'),0777);
}

$this->info('Publishing CRUDBooster needs file...');
$this->call('vendor:publish');
Expand Down
6 changes: 5 additions & 1 deletion src/commands/CrudboosterUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public function handle()
$this->header();
$this->checkRequirements();

$this->info('Updating: ');
$this->info('Updating: ');

if(!file_exists(public_path('vendor'))) {
mkdir(public_path('vendor'),0777);
}

$this->info('Publishing CRUDBooster needs file...');
$this->call('vendor:publish');
Expand Down

0 comments on commit 9677041

Please sign in to comment.