V
V
Viktor2016-03-03 07:40:06
Yii
Viktor, 2016-03-03 07:40:06

How to use fork in composer in yii2 project?

Good day! My actions I create a fork of the repository https://github.com/yiisoft/yii2 I create a new branch called myfix I make fixes, then I commit and push the branches, I add my repository to the composer.json file in the project

"repositories": [
      {
        "type": "git",
        "url":  "https://github.com/lxShaDoWxl/yii2.git"
      }
    ],

and change package version
"require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "dev-myfix as 2.0.7",
        ...........
    },

I update composer.phar update and get
Problem 1
    - The requested package yiisoft/yii2 dev-myfix as 2.0.7 could not be found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

I tried to create a tag too, it doesn't always work, I can't find it, what's the problem at all? and how to properly use your fork?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Victor, 2016-03-04
@lxShaDoWxl

Found a mistake, I should have fork done https://github.com/yiisoft/yii2-framework and not https://github.com/yiisoft/yii2
Made a fork recreated tag 2.0.7 and did a push then cleared the composer cache and did an update

A
Alexander, 2016-03-03
@misantron

"dev-myfix as 2.0.7" is such a construct valid? I doubt very much

L
LAV45, 2017-03-24
@LAV45

1) https://github.com/yiisoft/yii2 can be connected to the project, but the package name is "yiisoft/yii2-dev"
https://github.com/yiisoft/yii2/blob/master/compos...
2 ) "dev-myfix" specifies the name of the branch. It used to work that way, but recently checked it doesn't work anymore. Therefore, you can download "dev-master" and then go to the 'vendor/yiisoft/yii2-dev' folder and
go to the desired branch

"require": {
    "yiisoft/yii2-dev": "dev-myfix"
},

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question