-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from BookStackApp/master
Get the latest changes.
- Loading branch information
Showing
60 changed files
with
2,343 additions
and
634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace BookStack\Console\Commands; | ||
|
||
use BookStack\Services\SearchService; | ||
use Illuminate\Console\Command; | ||
|
||
class RegenerateSearch extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'bookstack:regenerate-search {--database= : The database connection to use.}'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Command description'; | ||
|
||
protected $searchService; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @param SearchService $searchService | ||
*/ | ||
public function __construct(SearchService $searchService) | ||
{ | ||
parent::__construct(); | ||
$this->searchService = $searchService; | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
$connection = \DB::getDefaultConnection(); | ||
if ($this->option('database') !== null) { | ||
\DB::setDefaultConnection($this->option('database')); | ||
} | ||
|
||
$this->searchService->indexAllEntities(); | ||
\DB::setDefaultConnection($connection); | ||
$this->comment('Search index regenerated'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.