Skip to content

Commit

Permalink
2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benkeen committed Sep 23, 2017
1 parent 1f56e38 commit 06f5a3a
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 183 deletions.
29 changes: 23 additions & 6 deletions global/code/Generation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public static function generateDbConfigFile($tables, $version = "")

$html = <<< EOF
$init_str
\$STRUCTURE$version_str = array();
\$STRUCTURE{$version_str}["tables"] = array();
\$STRUCTURE$version_str = array();
\$STRUCTURE{$version_str}["tables"] = array();
EOF;

Expand All @@ -44,13 +44,13 @@ public static function generateDbConfigFile($tables, $version = "")
foreach ($info as $row) {
$default = preg_replace("/\\$/", "\\\\$", $row["Default"]);
$str = <<< EOF
array(
array(
"Field" => "{$row['Field']}",
"Type" => "{$row['Type']}",
"Null" => "{$row['Null']}",
"Key" => "{$row['Key']}",
"Default" => "{$default}"
)
)
EOF;
$rows[] = $str;
}
Expand Down Expand Up @@ -79,13 +79,13 @@ public static function generateModuleHookArray($module_folder, $version)
$hooks = array();
foreach ($db->fetchAll() as $row) {
$hooks[] = <<< END
array(
array(
"hook_type" => "{$row["hook_type"]}",
"action_location" => "{$row["action_location"]}",
"function_name" => "{$row["function_name"]}",
"hook_function" => "{$row["hook_function"]}",
"priority" => "{$row["priority"]}"
)
)
END;
}
$hooks_str = implode(",\n", $hooks);
Expand All @@ -99,4 +99,21 @@ public static function generateModuleHookArray($module_folder, $version)

echo $php;
}

/*
* Generates a list of files for the current repo - as determined by the folder path passed (assumes to be
* in a git repo).
*/
public static function getRepoFiles($folder)
{
exec("cd $folder; git ls-files", $files);

$rows = array();
foreach ($files as $file) {
$rows [] = " \"{$file}\"";
}

$php = "\$FILES = array(\n" . implode($rows, ",\n") . "\n);";
echo $php;
}
}
Loading

0 comments on commit 06f5a3a

Please sign in to comment.