Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Trying to get property of non-object" during create-project #3546

Closed
schmunk42 opened this issue Dec 12, 2014 · 2 comments · Fixed by #3547
Closed

"Trying to get property of non-object" during create-project #3546

schmunk42 opened this issue Dec 12, 2014 · 2 comments · Fixed by #3547

Comments

@schmunk42
Copy link
Contributor

I found a bug somewhere between 9950802 and 76c666e

Current version...

Kraftbuch:TESTING tobias$ composer --version
Composer version 1.0-dev (9950802466805866c6ee5031494caa0d4e9b5385) 2014-12-02 14:22:23

Install application...

Kraftbuch:TESTING tobias$ composer create-project -sdev phundament/app:dev-mast
er --no-dev --prefer-dist test-ok
Installing phundament/app (dev-master 1eba299f1bce21970ab32d18a815c5f7ceeb6288)
  - Installing phundament/app (dev-master master)
    Loading from cache

Created project in test-ok
Loading composer repositories with package information
Installing dependencies from lock file
  - Installing yiisoft/yii2-composer (2.0.1)
    Loading from cache


[...]


  - Installing vlucas/phpdotenv (v1.0.9)
    Loading from cache

Generating autoload files
chmod('console/runtime', 0777)...done.
chmod('frontend/runtime', 0777)...done.
chmod('frontend/web/assets', 0777)...done.
chmod('backend/runtime', 0777)...done.
chmod('backend/web/assets', 0777)...done.
chmod('yii', 0755)...done.

Phundament application packages have been successfully installed.
Please set your local environment variables with

  cd /Users/tobias/Webserver/TESTING/test-ok
  cp .env-dist .env
  edit .env

Afterwards finalize the setup with

  ./yii app/setup

OK.

Update composer...

Kraftbuch:TESTING tobias$ sudo composer self-update
Password:
Updating to version 76c666e2102d3756e50fa87a2aaeab686a2ee58e.
    Downloading: 100%         
Use composer self-update --rollback to return to version 9950802466805866c6ee5031494caa0d4e9b5385

Install application once more...

Kraftbuch:TESTING tobias$ composer create-project -vvv -sdev phundament/app:dev
-master --no-dev --prefer-dist test-broken-app
Downloading https://packagist.org/packages.json
Writing /Users/tobias/.composer/cache/repo/https---packagist.org/packages.json into cache
Reading /Users/tobias/.composer/cache/repo/https---packagist.org/p-provider-active.json from cache
Reading /Users/tobias/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
Reading /Users/tobias/.composer/cache/repo/https---packagist.org/p-provider-latest.json from cache
Reading /Users/tobias/.composer/cache/repo/https---packagist.org/p-provider-stale.json from cache
Reading /Users/tobias/.composer/cache/repo/https---packagist.org/provider-phundament$app.json from cache
Installing phundament/app (dev-master 1eba299f1bce21970ab32d18a815c5f7ceeb6288)
  - Installing phundament/app (dev-master master)
Reading /Users/tobias/.composer/cache/files/phundament/app/1eba299f1bce21970ab32d18a815c5f7ceeb6288.zip from cache
    Loading from cache
    Extracting archive
Executing command (CWD): unzip 'test-broken-app//22acd416838ee17237907c965e4d584d' -d 'vendor/composer/739d0afa' && chmod -R u+w 'vendor/composer/739d0afa'

Created project in test-broken-app
Reading ./composer.json
Loading config file /Users/tobias/.composer/config.json
Loading config file ./composer.json
Reading ./composer.lock
Loading composer repositories with package information
Installing dependencies from lock file
Reading ./composer.lock
  - Installing yiisoft/yii2-composer (2.0.1)
Reading /Users/tobias/.composer/cache/files/yiisoft/yii2-composer/7f300dd23b6c4d1e7effc81c962b3889f83e43c0.zip from cache
    Loading from cache
    Extracting archive
Executing command (CWD): unzip '/Users/tobias/Webserver/TESTING/test-broken-app/vendor/yiisoft/yii2-composer/b697fabc1800a8e4a3dafdef12aba0b7' -d 'vendor/composer/c9c99e07' && chmod -R u+w 'vendor/composer/c9c99e07'


[...]


  - Installing vlucas/phpdotenv (v1.0.9)
Reading /Users/tobias/.composer/cache/files/vlucas/phpdotenv/56c252d48dce336da97926591aed71805203815b.zip from cache
    Loading from cache
    Extracting archive
Executing command (CWD): unzip '/Users/tobias/Webserver/TESTING/test-broken-app/vendor/vlucas/phpdotenv/d68a92a4feefbccc129c4227759ca94d' -d 'vendor/composer/f46edfb9' && chmod -R u+w 'vendor/composer/f46edfb9'

Generating autoload files
Script yii\composer\Installer::postCreateProject handling the post-create-project-cmd event terminated with an exception
Reading ./composer.json
Loading config file /Users/tobias/.composer/config.json
Loading config file ./composer.json



  [ErrorException]                      
  Trying to get property of non-object  



Exception trace:
 () at phar:///opt/bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:226
 Composer\Util\ErrorHandler::handle() at phar:///opt/bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:226
 Composer\EventDispatcher\EventDispatcher->checkListenerExpectedEvent() at phar:///opt/bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:204
 Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar:///opt/bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:174
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///opt/bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:120
 Composer\EventDispatcher\EventDispatcher->dispatchCommandEvent() at phar:///opt/bin/composer.phar/src/Composer/Command/CreateProjectCommand.php:217
 Composer\Command\CreateProjectCommand->installProject() at phar:///opt/bin/composer.phar/src/Composer/Command/CreateProjectCommand.php:129
 Composer\Command\CreateProjectCommand->execute() at phar:///opt/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
 Symfony\Component\Console\Command\Command->run() at phar:///opt/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at phar:///opt/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at phar:///opt/bin/composer.phar/src/Composer/Console/Application.php:146
 Composer\Console\Application->doRun() at phar:///opt/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at phar:///opt/bin/composer.phar/src/Composer/Console/Application.php:83
 Composer\Console\Application->run() at phar:///opt/bin/composer.phar/bin/composer:43
 require() at /opt/bin/composer.phar:24


create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [package] [directory] [version]

Installation failed due to an exception.

@schmunk42 schmunk42 changed the title Trying to get property of non-object "Trying to get property of non-object" during create-project Dec 12, 2014
@alcohol
Copy link
Member

alcohol commented Dec 12, 2014

Looks like that would be my fault (#3544), I will investigate.

@alcohol
Copy link
Member

alcohol commented Dec 12, 2014

Ok, figured out why.. they didn't typehint the $event variable. A case I did not take into account.

https://github.com/yiisoft/yii2-composer/blob/master/Installer.php#L227

I'll get right on a fix.

alcohol added a commit to alcohol/composer that referenced this issue Dec 12, 2014
ChadSikorra pushed a commit to ChadSikorra/composer that referenced this issue Mar 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants