File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 6868if (empty ($ options ['gitdir ' ])) {
6969 // Try to find it from env.
7070 $ gitdir = getenv ('gitdir ' );
71- if (is_readable ($ gitdir . '/lib/dml/moodle_database.php ' )) {
72- $ options ['gitdir ' ] = $ gitdir ;
73- } else {
74- // Not found, exit. It must be passed.
75- cli_error ('Unable to find a suitable Moodle code base. Please use the --gitdir param to specify it ' );
76- }
71+ }
72+
73+ if (file_exists ("{$ gitdir }/public/version.php " )) {
74+ $ dirroot = "{$ gitdir }/public " ;
75+ } else {
76+ $ dirroot = $ gitdir ;
77+ }
78+
79+ if (is_readable ($ dirroot . '/lib/dml/moodle_database.php ' )) {
80+ $ options ['gitdir ' ] = $ dirroot ;
81+ } else {
82+ // Not found, exit. It must be passed.
83+ cli_error ('Unable to find a suitable Moodle code base. Please use the --gitdir param to specify it ' );
7784}
7885
7986$ options ['dbhost2 ' ] = empty ($ options ['dbhost2 ' ]) ? $ options ['dbhost1 ' ] : $ options ['dbhost2 ' ];
You can’t perform that action at this time.
0 commit comments