File tree Expand file tree Collapse file tree
ProcessMaker/Http/Controllers/Admin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public function getOauthClient(Request $request)
4343
4444 if (!$ client ) {
4545 $ clientRepository = app ('Laravel\Passport\ClientRepository ' );
46- $ client = $ clientRepository ->create ( null , 'devlink ' , $ redirectUri );
46+ $ client = $ clientRepository ->createAuthorizationCodeGrantClient ( 'devlink ' , [ $ redirectUri] );
4747 }
4848
4949 $ query = http_build_query ([
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ protected function withPersonalAccessClient()
154154 {
155155 $ clients = app ()->make ('Laravel\Passport\ClientRepository ' );
156156 try {
157- $ clients ->personalAccessClient ();
157+ $ clients ->personalAccessClient (' users ' );
158158 } catch (\RuntimeException $ e ) {
159159 Artisan::call ('passport:install --no-interaction ' );
160160 }
@@ -255,7 +255,7 @@ public function restoreDatabaseSnapshot($id)
255255 if (!file_exists (base_path ($ filename ))) {
256256 throw new \Exception ("Database snapshot not found: $ filename " );
257257 }
258- $ command = ' mysql ' . $ this ->mysqlConnectionString ();
258+ $ command = $ this -> getMysqlCommand () . $ this ->mysqlConnectionString ();
259259 $ command .= ' ' . env ('DB_DATABASE ' ) . ' < ' . base_path ($ filename );
260260 if (system ($ command ) === false ) {
261261 dd ("Failed to restore database from snapshot: $ command " );
@@ -295,4 +295,17 @@ private function getDumpCommand()
295295 // Fall back to mysqldump
296296 return 'mysqldump ' ;
297297 }
298+
299+ private function getMysqlCommand ()
300+ {
301+ // Check if mariadb client is available (common in Alpine environments)
302+ $ result = \Illuminate \Support \Facades \Process::run ('command -v mariadb ' );
303+
304+ if ($ result ->successful ()) {
305+ return 'mariadb ' ;
306+ }
307+
308+ // Fall back to mysql
309+ return 'mysql ' ;
310+ }
298311}
You can’t perform that action at this time.
0 commit comments