File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,16 +32,23 @@ function runUpdates($type = 'core', $module = null)
3232{
3333 require_once ('updates/updates.php ' );
3434
35+ $ db = new \OBFDB ();
36+
3537 if ($ type === 'core ' ) {
3638 // Run all core updates.
3739 $ list = $ u ->updates ();
3840 } elseif ($ module !== null ) {
41+ $ db ->where ('directory ' , $ module );
42+ $ installed = $ db ->get_one ('modules ' );
43+ if (! $ installed ) {
44+ echo "Module {$ module } is not installed. " . PHP_EOL ;
45+ return false ;
46+ }
47+
3948 // Run specified module updates.
4049 $ u = new \OBFUpdates ($ module );
4150 $ list = $ u ->updates ();
4251 } else {
43- $ db = new \OBFDB ();
44-
4552 // Run all module updates.
4653 $ modules = array_filter (scandir ('./modules/ ' ), fn ($ f ) => $ f [0 ] !== '. ' );
4754 foreach ($ modules as $ module ) {
@@ -54,6 +61,7 @@ function runUpdates($type = 'core', $module = null)
5461 echo "Running updates for module {$ module }... " . PHP_EOL ;
5562 runUpdates ('module ' , $ module );
5663 }
64+
5765 return false ;
5866 }
5967
You can’t perform that action at this time.
0 commit comments