Skip to content
Permalink
Browse files

fixed the trax script too generate all directories and include pear a…

…nd trax core files in vendor folder for new projects
  • Loading branch information...
johnpipi committed Mar 4, 2012
1 parent ed5978e commit 8dba2d42e010fd8df99a97ca0aaeeddf69642c22
Showing with 20 additions and 11 deletions.
  1. +5 −3 make-pkg.php
  2. +2 −2 trax/data/config/environment.php
  3. +13 −6 trax/trax.php
@@ -61,6 +61,7 @@
'packagedirectory' => '.',
'filelistgenerator' => 'file', // generate from git or file
'simpleoutput' => true,
'addhiddenfiles' => true,
'dir_roles' => array(
'doc' => 'doc',
'test' => 'test',
@@ -110,9 +111,10 @@
$packagexml->setPearinstallerDep('1.4.0');
// Depends on these PEAR packages
$packagexml->addPackageDepWithChannel('required', 'MDB2', 'pear.php.net', '2.0');
$packagexml->addPackageDepWithChannel('required', 'Mail', 'pear.php.net', '1.0');
$packagexml->addPackageDepWithChannel('required', 'Mail_Mime', 'pear.php.net', '1.0');
# added these to when you create a new app into the vendor folder
#$packagexml->addPackageDepWithChannel('required', 'MDB2', 'pear.php.net', '2.0');
#$packagexml->addPackageDepWithChannel('required', 'Mail', 'pear.php.net', '1.0');
#$packagexml->addPackageDepWithChannel('required', 'Mail_Mime', 'pear.php.net', '1.0');
// Who maintains this package
$packagexml->addMaintainer('lead', 'john', 'John Peterson', 'johnpipi@gmail.com');
@@ -4,8 +4,8 @@
*/
# Trax should be able to figure the following 2 settings out
# automatically, but if you have trouble you can set them manually
# define("PHP_LIB_ROOT", "/usr/local/lib/php");
# define("TRAX_ROOT", dirname(dirname(__FILE__)));
define("PHP_LIB_ROOT", dirname(dirname(__FILE__))."/vendor/PEAR");
define("TRAX_ROOT", dirname(dirname(__FILE__)));
# Uncomment below to force Trax into production mode when
# you don't control web/app server and can't set it the proper way
@@ -21,6 +21,7 @@
* distribution
*/
define("SOURCE_DIR", "@DATA-DIR@/PHPonTrax/data/");
define("TRAX_SOURCE_DIR", "@PHP-DIR@/PHPonTrax/vendor/trax/");
/**
* Symbol substitution tables
@@ -94,9 +95,15 @@ function trax() {
// Trax config/ directory in the
// user's work area
$srcdir = SOURCE_DIR;
// copy source directory to destination directory
copy_dir($srcdir, $dstdir);
copy_dir(SOURCE_DIR, $dstdir);
$dstdir .= 'vendor/trax/';
if (!create_dir($dstdir)) {
return;
}
// copy trax core code to vendor folder of project
copy_dir(TRAX_SOURCE_DIR, $dstdir);
}
/**
@@ -109,7 +116,7 @@ function trax() {
* @return boolean true=>success, false=>failure.
*/
function copy_dir($src_path, $dst_path) {
global $quiet;
// Make sure we have directories as arguments
@@ -168,7 +175,7 @@ function copy_dir($src_path, $dst_path) {
}
// Destination file does not exist. Create it
if (!copy_file($src_path . $src_file, $dst_path . $src_file)) {
if (!copy_file($src_path . $src_file, $dst_path . $src_file)) {
return false;
}
@@ -191,13 +198,13 @@ function copy_dir($src_path, $dst_path) {
}
// This directory needs to be copied.
if (!create_dir( $dst_path . $src_file )) {
if (!create_dir( $dst_path . $src_file )) {
return false;
}
// Recursive call to copy directory
if (!copy_dir($src_path . $src_file . DIRECTORY_SEPARATOR,
$dst_path . $src_file . DIRECTORY_SEPARATOR)) {
$dst_path . $src_file . DIRECTORY_SEPARATOR)) {
return false;
}
}

0 comments on commit 8dba2d4

Please sign in to comment.
You can’t perform that action at this time.