This repository was archived by the owner on Jan 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
lib/php/libsdk/SDK/Build/PGO/Server Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -114,10 +114,31 @@ public function query(string $s, string $db = NULL) : void
114114 $ port = $ this ->conf ->getSectionItem ($ this ->name , "port " );
115115
116116 $ pass_arg = $ pass ? "-p $ pass " : "" ;
117- $ ret = shell_exec (". \\bin \\mysql.exe -u $ user $ pass_arg -h $ host -P $ port -e \"$ s \"" );
117+ $ db_arg = $ db ? "-D $ db " : "" ;
118+ $ ret = shell_exec (". \\bin \\mysql.exe -u $ user $ pass_arg -h $ host -P $ port $ db_arg -e \"$ s \"" );
118119 //var_dump($this->base, getcwd(), ".\\bin\\mysql.exe -u $user $pass_arg -h $host -P $port -e \"$s\"");
119120
120121 chdir ($ cwd );
121122 }
123+
124+ public function import (string $ path , string $ db = NULL ) : void
125+ {
126+ $ ret = NULL ;
127+
128+ $ cwd = getcwd ();
129+
130+ chdir ($ this ->base );
131+
132+ $ user = $ this ->conf ->getSectionItem ($ this ->name , "user " );
133+ $ pass = $ this ->conf ->getSectionItem ($ this ->name , "pass " );
134+ $ host = $ this ->conf ->getSectionItem ($ this ->name , "host " );
135+ $ port = $ this ->conf ->getSectionItem ($ this ->name , "port " );
136+
137+ $ pass_arg = $ pass ? "-p $ pass " : "" ;
138+ $ db_arg = $ db ? "-D $ db " : "" ;
139+ $ ret = shell_exec (". \\bin \\mysql.exe -u $ user $ pass_arg -h $ host -P $ port $ db_arg < \"$ path \"" );
140+
141+ chdir ($ cwd );
142+ }
122143}
123144
You can’t perform that action at this time.
0 commit comments