Skip to content
Snippets Groups Projects
Commit 89b6afba authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #524 from protich/feature/package_revisited

Better stab at packaging the codebase into the download tar ball
parents 0e34b0dd 664166da
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ function get_osticket_root_path() { ...@@ -21,7 +21,7 @@ function get_osticket_root_path() {
function glob_recursive($pattern, $flags = 0) { function glob_recursive($pattern, $flags = 0) {
$files = glob($pattern, $flags); $files = glob($pattern, $flags);
foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) { foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {
$files = array_merge($files, $files = array_merge($files,
glob_recursive($dir.'/'.basename($pattern), $flags)); glob_recursive($dir.'/'.basename($pattern), $flags));
} }
return $files; return $files;
...@@ -89,22 +89,23 @@ package("*.php", 'upload/'); ...@@ -89,22 +89,23 @@ package("*.php", 'upload/');
foreach (array('assets','css','images','js') as $dir) foreach (array('assets','css','images','js') as $dir)
package("$dir/*", "upload/$dir", -1, "*less"); package("$dir/*", "upload/$dir", -1, "*less");
# Load API
package('api/{,.}*', 'upload/api');
# Load the knowledgebase # Load the knowledgebase
package("kb/*.php", "upload/kb"); package("kb/*.php", "upload/kb");
# Load the staff interface # Load the staff interface
package("scp/*.php", "upload/scp/", -1); package("scp/*.php", "upload/scp/", -1);
foreach (array('css','images','js') as $dir) foreach (array('css','images','js') as $dir)
package("$dir/*", "upload/scp/$dir", -1); package("scp/$dir/*", "upload/scp/$dir", -1);
# Load in the scripts # Load in the scripts
mkdir("$stage_path/scripts/"); mkdir("$stage_path/scripts/");
package("setup/scripts/*", "scripts/", -1, "*stage"); package("setup/scripts/*", "scripts/", -1, "*stage");
# Load the heart of the system # Load the heart of the system
package("include/*.php", "upload/include", -1); package("include/{,.}*", "upload/include", -1, array('*ost-config.php', '*.sw[a-z]'));
# And the sql patches
package("include/upgrader/*.sql", "upload/include/upgrader", -1);
# Include the installer # Include the installer
package("setup/*.{php,txt}", "upload/setup", -1, array("*scripts","*test","*stage")); package("setup/*.{php,txt}", "upload/setup", -1, array("*scripts","*test","*stage"));
...@@ -130,8 +131,8 @@ foreach ($version_info as $line) ...@@ -130,8 +131,8 @@ foreach ($version_info as $line)
$pwd = getcwd(); $pwd = getcwd();
chdir($stage_path); chdir($stage_path);
shell_exec("tar cjf '$pwd/osticket-".THIS_VERSION.".tar.bz2' *"); shell_exec("tar cjf '$pwd/osTicket-".THIS_VERSION.".tar.bz2' *");
shell_exec("zip -r '$pwd/osticket-".THIS_VERSION.".zip' *"); shell_exec("zip -r '$pwd/osTicket-".THIS_VERSION.".zip' *");
chdir($pwd); chdir($pwd);
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment