Bee-Lab / bowerphp

A PHP implementation of bower :bird:
MIT License
467 stars 37 forks source link

[ErrorException] Undefined index: dependencies #136

Closed tarampampam closed 8 years ago

tarampampam commented 8 years ago

My bower.json and .bowerrc:

{
    "name": "Username",
    "license": "MIT",
    "private": true,
    "dependencies": {
        "jquery": "~2",
        "bootstrap": "latest",
        "iCheck": "latest",
        "jquery.cookie": "~1.4",
        "jquery-timeago": "~1.5",
        "toastr": "latest",
        "tooltipster": "latest",
        "pace": "latest",
        "respond": "latest",
        "sweetalert": "~1"
    }
}
{
  "directory": "public/assets/components",
  "analytics": false
}

In console:

$ php bower.phar update

$ ls -l ./public/assets/components/
total 36
drwxr-xr-x 1 kot 197121 0 Mar 16 09:25 bootstrap
drwxr-xr-x 1 kot 197121 0 Mar 16 09:27 iCheck
drwxr-xr-x 1 kot 197121 0 Mar 16 09:22 jquery
drwxr-xr-x 1 kot 197121 0 Mar 16 09:36 jquery-timeago
drwxr-xr-x 1 kot 197121 0 Mar 16 09:29 jquery.cookie
drwxr-xr-x 1 kot 197121 0 Mar 16 09:53 pace
drwxr-xr-x 1 kot 197121 0 Mar 16 09:55 respond
drwxr-xr-x 1 kot 197121 0 Mar 16 09:56 sweetalert
drwxr-xr-x 1 kot 197121 0 Mar 16 09:38 toastr
drwxr-xr-x 1 kot 197121 0 Mar 16 09:52 tooltipster

$ php bower.phar list
bootstrap#v3.3.6
iCheck#1.0.2
jquery#2.2.1
jquery-timeago#v1.5.2
jquery.cookie#v1.4.1

  [ErrorException]
  Undefined index: dependencies

So.. Why this happens?

tarampampam commented 8 years ago

There is no effect: screenshot_1

./bower.phar was compiled by commands:

$ git clone https://github.com/Bee-Lab/bowerphp.git
$ composer install
$ php ./bin/compile

Can you make tests before commit & closing this issue?

garak commented 8 years ago

I did tests and it works for me

tarampampam commented 8 years ago

So.. what's happened in my case?

garak commented 8 years ago

I mean, the list command is fine (the one you mentioned in your issue). For the info command, you need to pass an argument

tarampampam commented 8 years ago

Oh, sorry, my bad. There is correct error message:

$ php ./bower.phar list
Segmentation fault
garak commented 8 years ago

Can you try directly with the bin/bowephp script instead of the phar?

tarampampam commented 8 years ago
$ php -v
PHP 5.5.28 (cli) (built: Aug  5 2015 13:39:48)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with the ionCube PHP Loader v5.0.14, Copyright (c) 2002-2015, by ionCube Ltd.

$ php ./bin/compile

$ php bowerphp.phar install

$ php bowerphp.phar list
bootstrap#v3.3.6
font-awesome#v4.5.0
iCheck#1.0.2
jquery#2.2.1
jquery-timeago#v1.5.2
jquery.cookie#v1.4.1
PACE#v1.0.2 extraneous
respond#1.4.2
sweetalert#v1.1.3
toastr#2.1.2
tooltipster#3.3.0

$ php ./bin/bowerphp list
bootstrap#v3.3.6
font-awesome#v4.5.0
iCheck#1.0.2
jquery#2.2.1
jquery-timeago#v1.5.2
jquery.cookie#v1.4.1
PACE#v1.0.2 extraneous
respond#1.4.2
sweetalert#v1.1.3
toastr#2.1.2
tooltipster#3.3.0
$ php -v
PHP 5.3.29 (cli) (built: Aug 15 2014 19:17:16)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader v5.0.14, Copyright (c) 2002-2015, by ionCube Ltd.

$ php bowerphp.phar list
Segmentation fault

$ php ./bin/bowerphp list
Segmentation fault

Is it normal? In your composer.json:

    ...
    "require": {
        "php": ">=5.3.6",
        ...
garak commented 8 years ago

I'm sorry, but I'm not able to reproduce your problem. The requirement in composer.json is absolutely normal. I can only guess that your problem could be related to ionCube. You can try this: strace bin/bowerphp list

tarampampam commented 8 years ago

I disabled ionCube, and anyway have no any positive results:

$ php -v
PHP 5.3.29 (cli) (built: Aug 15 2014 19:17:16)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies

$ php ./bin/bowerphp list
Segmentation fault

$ strace bin/bowerphp list
create_child: D:\www\domains\hackzone.dev\tmp\bowerphp\bin\bowerphp list
strace.exe: error creating process D:\www\domains\hackzone.dev\tmp\bowerphp\bin\bowerphp, (error 193)

$
garak commented 8 years ago

I'm sorry, but I don't have any clue about your problem.

tarampampam commented 8 years ago
$ php -v
PHP 5.4.44 (cli) (built: Aug  5 2015 22:12:38)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader v5.0.14, Copyright (c) 2002-2015, by ionCube Ltd.

$ php bin\bowerphp list
bootstrap#v3.3.6
font-awesome#v4.5.0
iCheck#1.0.2
jquery#2.2.1
jquery-timeago#v1.5.2
jquery.cookie#v1.4.1
PACE#v1.0.2 extraneous
respond#1.4.2
sweetalert#v1.1.3
toastr#2.1.2
tooltipster#3.3.0
$ php -v
PHP 5.5.28 (cli) (built: Aug  5 2015 13:39:48)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with the ionCube PHP Loader v5.0.14, Copyright (c) 2002-2015, by ionCube Ltd.

$ php bin\bowerphp list
bootstrap#v3.3.6
font-awesome#v4.5.0
iCheck#1.0.2
jquery#2.2.1
jquery-timeago#v1.5.2
jquery.cookie#v1.4.1
PACE#v1.0.2 extraneous
respond#1.4.2
sweetalert#v1.1.3
toastr#2.1.2
tooltipster#3.3.0
$ php -v
PHP 5.6.12 (cli) (built: Aug  6 2015 12:06:20)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with the ionCube PHP Loader v5.0.14, Copyright (c) 2002-2015, by ionCube Ltd.

$ php bin\bowerphp list
bootstrap#v3.3.6
font-awesome#v4.5.0
iCheck#1.0.2
jquery#2.2.1
jquery-timeago#v1.5.2
jquery.cookie#v1.4.1
PACE#v1.0.2 extraneous
respond#1.4.2
sweetalert#v1.1.3
toastr#2.1.2
tooltipster#3.3.0
$ php -v
PHP 5.3.29 (cli) (built: Aug 15 2014 19:17:16)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies

$ php bin\bowerphp list
Segmentation fault
tarampampam commented 8 years ago

Here is archive with repository clone + phar + bower test config. Maybe this will helps you: https://drive.google.com/file/d/0B8jho7c8kaRhTFdsMnhJMFpaSWs/view

garak commented 8 years ago

Well, it looks like your problem is just with php 5.3. That version is really old and unsupported, and we're supporting it only because it's supported by Symfony components versio 2.3 In next May, when Symfony 2.3 will be out of support, we'll require php 5.5 as minimum version.

clue commented 8 years ago

Well, it looks like your problem is just with php 5.3.

PHP 5.3 works just fine, while it may be unsupported by Zend, it's still supported by some of the major distros.

Thanks for proving the archive @tarampampam, looks like your composer.lock has been created with a newer version of PHP and thus references packages that are not compatible with PHP 5.3.

# running in a fresh ubuntu:12.04 installation

$ php -v
PHP 5.3.10-1ubuntu3.21 with Suhosin-Patch (cli) (built: Oct 28 2015 01:43:56) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

$ php bin/bowerphp list
Segmentation fault (core dumped)

$ php composer.phar show
…
symfony/yaml                      v3.0.3  Symfony Yaml Component
…

$ php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
…
  - Removing symfony/yaml (v3.0.3)
  - Installing symfony/yaml (v2.8.3)
    Downloading: 100%
…

$ php bin/bowerphp list
respond#1.4.2
PACE#v1.0.2 extraneous
iCheck#1.0.2
jquery.cookie#v1.4.1
tooltipster#3.3.0
bootstrap#v3.3.6
sweetalert#v1.1.3
font-awesome#v4.5.0
toastr#2.1.2
jquery#2.2.1
jquery-timeago#v1.5.2

Long story short: Run composer update once with the correct PHP version and everything should work.

tarampampam commented 8 years ago

Yeah! Great! Thx 2 you, @clue!