-
-
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 #8 from BookStackApp/master
Getting the latest changes.
- Loading branch information
Showing
108 changed files
with
3,548 additions
and
526 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace BookStack\Console\Commands; | ||
|
||
use BookStack\Activity; | ||
use Illuminate\Console\Command; | ||
|
||
class ClearActivity extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'bookstack:clear-activity'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Clear user activity from the system'; | ||
|
||
protected $activity; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @param Activity $activity | ||
*/ | ||
public function __construct(Activity $activity) | ||
{ | ||
$this->activity = $activity; | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
$this->activity->newQuery()->truncate(); | ||
$this->comment('System activity cleared'); | ||
} | ||
} |
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,50 @@ | ||
<?php | ||
|
||
namespace BookStack\Console\Commands; | ||
|
||
use BookStack\PageRevision; | ||
use Illuminate\Console\Command; | ||
|
||
class ClearRevisions extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'bookstack:clear-revisions | ||
{--a|all : Include active update drafts in deletion} | ||
'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Clear page revisions'; | ||
|
||
protected $pageRevision; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @param PageRevision $pageRevision | ||
*/ | ||
public function __construct(PageRevision $pageRevision) | ||
{ | ||
$this->pageRevision = $pageRevision; | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
$deleteTypes = $this->option('all') ? ['version', 'update_draft'] : ['version']; | ||
$this->pageRevision->newQuery()->whereIn('type', $deleteTypes)->delete(); | ||
$this->comment('Revisions deleted'); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.