]> BookStack Code Mirror - bookstack/blobdiff - app/Settings/MaintenanceController.php
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / app / Settings / MaintenanceController.php
index 60e5fee283ffee34f9e968c2cd6cf15b9552e425..ac9dd20ccb2c5cd5d8816636db08147a53ea2889 100644 (file)
@@ -3,6 +3,7 @@
 namespace BookStack\Settings;
 
 use BookStack\Activity\ActivityType;
+use BookStack\App\AppVersion;
 use BookStack\Entities\Tools\TrashCan;
 use BookStack\Http\Controller;
 use BookStack\References\ReferenceStore;
@@ -14,19 +15,16 @@ class MaintenanceController extends Controller
     /**
      * Show the page for application maintenance.
      */
-    public function index()
+    public function index(TrashCan $trashCan)
     {
         $this->checkPermission('settings-manage');
         $this->setPageTitle(trans('settings.maint'));
 
-        // Get application version
-        $version = trim(file_get_contents(base_path('version')));
-
         // Recycle bin details
-        $recycleStats = (new TrashCan())->getTrashedCounts();
+        $recycleStats = $trashCan->getTrashedCounts();
 
         return view('settings.maintenance', [
-            'version'      => $version,
+            'version'      => AppVersion::get(),
             'recycleStats' => $recycleStats,
         ]);
     }
@@ -87,7 +85,7 @@ class MaintenanceController extends Controller
         $this->logActivity(ActivityType::MAINTENANCE_ACTION_RUN, 'regenerate-references');
 
         try {
-            $referenceStore->updateForAllPages();
+            $referenceStore->updateForAll();
             $this->showSuccessNotification(trans('settings.maint_regen_references_success'));
         } catch (\Exception $exception) {
             $this->showErrorNotification($exception->getMessage());