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

yii2-pjax prevents updating to Yii2 2.0.2 stable #6827

Closed
SDKiller opened this issue Jan 11, 2015 · 6 comments
Closed

yii2-pjax prevents updating to Yii2 2.0.2 stable #6827

SDKiller opened this issue Jan 11, 2015 · 6 comments
Assignees
Milestone

Comments

@SDKiller
Copy link
Contributor

Could not change project miminum-stability to stable because of

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Removal request for bower-asset/yii2-pjax == 2.0.2.9999999-dev
    - Removal request for bower-asset/yii2-pjax == 9999999-dev
    - Installation request for bower-asset/yii2-pjax * -> satisfiable by bower-asset/yii2-pjax[2.0.2.x-dev, dev-master].

Only by adding "bower-asset/yii2-pjax": "dev-master", to root composer.json I succeeded intall Yii2 2.0.2

Btw:
is yii2-pjax extension along with buggy pjax.js so nesessary in the core?
Why not move it along with Pjax widget and asset to separate extension and put in suggest section.

Fore example more widely used bootstrap, jui, etc. are not included in framework's composer.json but go as separate extensions.

@cebe
Copy link
Member

cebe commented Jan 11, 2015

can you show you composer.json? Also which version of the composer asset plugin are you using?

@cebe cebe self-assigned this Jan 11, 2015
@cebe cebe added this to the 2.0.3 milestone Jan 11, 2015
@SDKiller
Copy link
Contributor Author

Initially it was with "minimum-stability": "dev" for about a week:

{
    "name": "myproject",
    "description": "My Yii 2 project",
    "type": "project",
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "*",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "yiisoft/yii2-debug": "*"
    },
    "config": {
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

After 2.0.2 was released I tried to change it to stable and got the abovementioned error with yii2-pjax.
Had to explicitly add "bower-asset/yii2-pjax": "dev-master" to it.

Now this works:

{
    "name": "myproject",
    "description": "My Yii 2 project",
    "type": "project",
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "*",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "yiisoft/yii2-debug": "*",
        "bower-asset/yii2-pjax": "dev-master"
    },
    "config": {
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

Globally is installed composer asset plugin dev-master

Upd
Tried again - the same error.
Run consequently before updating project:

> php composer.phar clear-cache
...
> php composer.phar self-update
...
> php composer.phar global update --prefer-dist
...

Then try to update project:

> php composer.phar update --prefer-dist

@SDKiller
Copy link
Contributor Author

Upd 2

Removed composer.lock and vendor directory - did not help.

Upd 3

Only creating new project succeeded to install all required extensions.

@SDKiller SDKiller changed the title yii2-pjax prevents installing Yii2 2.0.2 stable yii2-pjax prevents updating to Yii2 2.0.2 stable Jan 12, 2015
@cebe
Copy link
Member

cebe commented Jan 12, 2015

Could not change project miminum-stability to stable because of

I now see where the problem is, this is a feature of the composer asset plugin to improve speed dramatically: https://github.com/francoispluchino/composer-asset-plugin/blob/master/Resources/doc/index.md#disable-the-import-filter-using-the-installed-packages

The only drawback of this is that you can not downgrade packages, which is the case when you switch from dev to stable. You will have to remove composer.lock and vendor dir afaik and run composer install again. You may also disable this feature.

@cebe cebe closed this as completed Jan 12, 2015
@SDKiller
Copy link
Contributor Author

@cebe

Thanks for explanatory answer, indeed https://github.com/francoispluchino/composer-asset-plugin/blob/master/Resources/doc/index.md#disable-the-import-filter-using-the-installed-packages could be the case
(while at the moment I'm a bit tired and ran out of time playing around with composer to verify it - maybe I'l try to reproduce it sometimes later).

What with the second point - moving Pjax out of the core - like bootstrap and jui?

Does it make sense to keep in the core extension which is not mandatory and is very much specific?

And does it make sense to open an appropriate issue?

@cebe
Copy link
Member

cebe commented Jan 12, 2015

Of course you can open an issue about this to start a discussion. I do not have an opinion on that right now, need to think about it.

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

No branches or pull requests

2 participants