File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,15 +25,16 @@ class Shell_Command extends EE_Command {
2525 */
2626 public function __invoke ( $ args ) {
2727 EE \Utils \delem_log ( 'ee shell start ' );
28- $ args = EE \Utils \set_site_arg ( $ args , 'shell ' );
28+ $ args = EE \SiteUtils \auto_site_name ( $ args , 'shell ' , ' ' );
2929 $ site_name = EE \Utils \remove_trailing_slash ( $ args [0 ] );
30- if ( EE :: db ():: site_in_db ( $ site_name ) ) {
31- $ db_select = EE :: db ():: select ( [ ' site_path ' ], [ ' sitename ' => $ site_name] );
32- $ site_root = $ db_select [ 0 ][ ' site_path ' ];
33- } else {
30+
31+ $ site = Site:: find ( $ site_name );
32+
33+ if ( ! $ site ) {
3434 EE ::error ( "Site $ site_name does not exist. " );
3535 }
36- chdir ($ site_root );
36+
37+ chdir ( $ site ->site_fs_path );
3738 $ this ->run ( "docker-compose exec --user='www-data' php bash " );
3839 EE \Utils \delem_log ( 'ee shell end ' );
3940 }
@@ -43,7 +44,7 @@ private function run( $cmd, $descriptors = null ) {
4344 if ( ! $ descriptors ) {
4445 $ descriptors = array ( STDIN , STDOUT , STDERR );
4546 }
46-
47+
4748 $ final_cmd = EE \Utils \force_env_on_nix_systems ( $ cmd );
4849 $ proc = EE \Utils \proc_open_compat ( $ final_cmd , $ descriptors , $ pipes );
4950 if ( ! $ proc ) {
You can’t perform that action at this time.
0 commit comments