File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 8282Route::post ('/panel/site ' , [AdminController::class, 'editSite ' ])->name ('editSite ' );
8383Route::get ('/panel/phpinfo ' , [AdminController::class, 'phpinfo ' ])->name ('phpinfo ' );
8484Route::get ('/update ' , function () {return view ('update ' , []);});
85+
86+ Route::get ('/updating ' , function (\Codedge \Updater \UpdaterManager $ updater ) {
87+
88+ // Check if new version is available
89+ if ($ updater ->source ()->isNewVersionAvailable () and (file_exists (base_path ("backups/CANUPDATE " )))) {
90+
91+ // Get the current installed version
92+ echo $ updater ->source ()->getVersionInstalled ();
93+
94+ // Get the new version available
95+ $ versionAvailable = $ updater ->source ()->getVersionAvailable ();
96+
97+ // Create a release
98+ $ release = $ updater ->source ()->fetch ($ versionAvailable );
99+
100+ // Run the update process
101+ $ updater ->source ()->update ($ release );
102+
103+ unlink (base_path ("backups/CANUPDATE " ));
104+
105+ $ URL = Route::current ()->getName ();
106+ header ("Location: " .$ URL ."/../update?success " );
107+ exit ();
108+
109+ } else {
110+ echo "No new version available. " ;
111+ }
112+
113+ });
114+
85115});
86116
87117require __DIR__ .'/auth.php ' ;
You can’t perform that action at this time.
0 commit comments