Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Issue #388: Fix propel-gen path issues
Fixes an issue with the check for the propel-gen home-path in propel-gen script
Fixes an issue with classes being redeclared because of custom include in phing.php (code is not there in the phing.php version from phing itself)
  • Loading branch information
Even André Fiskvik committed Jul 2, 2012
1 parent bb34bda commit c107e8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
10 changes: 0 additions & 10 deletions generator/bin/phing.php
Expand Up @@ -11,16 +11,6 @@
// Set any INI options for PHP
// ---------------------------

$dirname = dirname(__FILE__);
foreach (array($dirname . '/../../', $dirname . '/../../../../../') as $dir) {
if (file_exists($file = realpath($dir) . '/vendor/autoload.php')) {
set_include_path(get_include_path() . PATH_SEPARATOR . $dir . '/vendor/phing/phing/classes');
require_once $file;

break;
}
}

/* set classpath */
if (getenv('PHP_CLASSPATH')) {
if (!defined('PHP_CLASSPATH')) {
Expand Down
19 changes: 13 additions & 6 deletions generator/bin/propel-gen
Expand Up @@ -18,12 +18,19 @@ if [ -z "$PROPEL_GEN_HOME" ] ; then
PROPEL_GEN_HOME="${HOME}/usr/propel/generator"
fi

if [ -d "`pwd`/vendor/propel/propel1" ] ; then
PROPEL_GEN_HOME="`pwd`/vendor/propel/propel1/generator"
fi

if [ -d "`pwd`/generator" ] ; then
PROPEL_GEN_HOME="`pwd`/generator"
## resolve links - the script name may be a link to phing's home
SOURCE="${BASH_SOURCE[0]}"
PRG="$( dirname "$SOURCE" )"
while [ -h "$SOURCE" ]
do
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$PRG/$SOURCE"
PRG="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
done
PRG="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

if [ -d "`dirname $PRG`" ] ; then
PROPEL_GEN_HOME="`dirname $PRG`"
fi

export PROPEL_GEN_HOME
Expand Down

0 comments on commit c107e8e

Please sign in to comment.