contao / managed-edition

Contao Managed Edition
17 stars 14 forks source link

cannot be installed using composer create-project under Windows #4

Closed fritzmg closed 7 years ago

fritzmg commented 7 years ago

When using

composer create-project contao/managed-edition

in a Windows environment, the installation fails when executing

Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication

or at least that is the last command I see before the following is displayed:

…
Generating autoload files
> Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication

dir=$(d=${0%[/\\]*}; cd "$d"; cd "../contao/manager-bundle/bin" && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
        # Cygwin paths start with /cygdrive/ which will break windows PHP,
        # so we need to translate the dir path to windows format. However
        # we could be using cygwin PHP which does not require this, so we
        # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
        if [[ $(which php) == /cygdrive/* ]]; then
                dir=$(cygpath -m "$dir");
        fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/contao-console" "$@"

dir=$(d=${0%[/\\]*}; cd "$d"; cd "../contao/manager-bundle/bin" && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
        # Cygwin paths start with /cygdrive/ which will break windows PHP,
        # so we need to translate the dir path to windows format. However
        # we could be using cygwin PHP which does not require this, so we
        # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
        if [[ $(which php) == /cygdrive/* ]]; then
                dir=$(cygpath -m "$dir");
        fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/contao-console" "$@"

[…]

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/contao-console" "$@"

C:\xampp\htdocs\c43mc>

This problem seems similar to https://github.com/contao/contao-manager/pull/50 . When trying to build the Contao Manager under Windows with

php ./vendor/bin/pharpiler compile

it will just display the content of a script, instead of executing that script.

See also https://community.contao.org/de/showthread.php?65512-Composer-Nutzung-vereinfachen&p=431181&viewfull=1#post431181

aschempp commented 7 years ago

The mentioned code is not part of Contao, so any idea where it could be coming from?

aschempp commented 7 years ago

Now that I think of it, this looks like the Composer batch script? Maybe it would be fixed by https://github.com/contao/manager-bundle/pull/15

fritzmg commented 7 years ago

Yeah, I'll try those changes and report back.

fritzmg commented 7 years ago

Yep, it works with the changes from contao/manager-bundle#15

…
Generating autoload files
> Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication

 Added the .htaccess file.
 Added the app.php file.
 Added the install.php file.

 // Clearing the cache for the prod environment with debug false

 [OK] Cache for the "prod" environment (debug=false) was successfully cleared.

 Trying to install assets as relative symbolic links.

 --------- ------------------------ ------------------
            Bundle                   Method / Error
 --------- ------------------------ ------------------
  WARNING   ContaoCoreBundle         absolute symlink
  WARNING   ContaoCommentsBundle     absolute symlink
  WARNING   ContaoNewsletterBundle   absolute symlink
 --------- ------------------------ ------------------

 [OK] All assets were successfully installed.

 * system
 * system/config
 * templates
 * web/system
 * files
 * assets/css
 * assets/js
 * system/cache
 * system/modules
 * system/themes
 * system/tmp
 * web/share
 * web/system/cron
 * assets/images

 Added/updated the system/initialize.php file.

 ---- ------------------------ ----------------------------------------------------------------
       Symlink                  Target / Error
 ---- ------------------------ ----------------------------------------------------------------
  OK   system/themes/flexible   vendor/contao/core-bundle/src/Resources/contao/themes/flexible
  OK   web/assets               assets
  OK   web/system/themes        system/themes
  OK   system/logs              var/logs
 ---- ------------------------ ----------------------------------------------------------------

Closing in favor of contao/manager-bundle#15