@@ -28,8 +28,8 @@ public static function generateDbConfigFile($tables, $version = "")
2828
2929 $ html = <<< EOF
3030 $ init_str
31- \$STRUCTURE $ version_str = array();
32- \$STRUCTURE {$ version_str }["tables"] = array();
31+ \$STRUCTURE $ version_str = array();
32+ \$STRUCTURE {$ version_str }["tables"] = array();
3333
3434EOF ;
3535
@@ -44,13 +44,13 @@ public static function generateDbConfigFile($tables, $version = "")
4444 foreach ($ info as $ row ) {
4545 $ default = preg_replace ("/ \\$/ " , "\\\\$ " , $ row ["Default " ]);
4646 $ str = <<< EOF
47- array(
47+ array(
4848 "Field" => " {$ row ['Field ' ]}",
4949 "Type" => " {$ row ['Type ' ]}",
5050 "Null" => " {$ row ['Null ' ]}",
5151 "Key" => " {$ row ['Key ' ]}",
5252 "Default" => " {$ default }"
53- )
53+ )
5454EOF ;
5555 $ rows [] = $ str ;
5656 }
@@ -79,13 +79,13 @@ public static function generateModuleHookArray($module_folder, $version)
7979 $ hooks = array ();
8080 foreach ($ db ->fetchAll () as $ row ) {
8181 $ hooks [] = <<< END
82- array(
82+ array(
8383 "hook_type" => " {$ row ["hook_type " ]}",
8484 "action_location" => " {$ row ["action_location " ]}",
8585 "function_name" => " {$ row ["function_name " ]}",
8686 "hook_function" => " {$ row ["hook_function " ]}",
8787 "priority" => " {$ row ["priority " ]}"
88- )
88+ )
8989END ;
9090 }
9191 $ hooks_str = implode (", \n" , $ hooks );
@@ -99,4 +99,21 @@ public static function generateModuleHookArray($module_folder, $version)
9999
100100 echo $ php ;
101101 }
102+
103+ /*
104+ * Generates a list of files for the current repo - as determined by the folder path passed (assumes to be
105+ * in a git repo).
106+ */
107+ public static function getRepoFiles ($ folder )
108+ {
109+ exec ("cd $ folder; git ls-files " , $ files );
110+
111+ $ rows = array ();
112+ foreach ($ files as $ file ) {
113+ $ rows [] = " \"{$ file }\"" ;
114+ }
115+
116+ $ php = "\$FILES = array( \n" . implode ($ rows , ", \n" ) . "\n); " ;
117+ echo $ php ;
118+ }
102119}
0 commit comments