A
A
amstr1k2014-12-02 00:02:05
PHP
amstr1k, 2014-12-02 00:02:05

How to create a private composer package?

Tell me how to create a private extension package for composer located on bitbucket??

{
    "name": "amstr1k/yii2-category",
    "description": "Crud category, crud tree category ",
    "type": "yii2-extension",
    "keywords": ["yii2","extension"," category"," tree category"],
    "license": "GPL-3.0",
    "repositories": [
      {
        "type": "vcs",
        "url": "[email protected]:amstr1k/yii2-category.git"
      }
    ],
    "authors": [
        {
            "name": "Amstr1k",
            "email": "[email protected]"
        }
    ],
    "require": {
        "yiisoft/yii2": "*",
        "amstr1k/yii2-category": "0.1"
    },
    "autoload": {
        "psr-4": {
            "amstr1k\\category\\": ""
        }
    },
    "extra": {
      "bootstrap": "amstr1k\\category\\Bootstrap"
    }
}

here is the config code

Answer the question

In order to leave comments, you need to log in

7 answer(s)
A
Alexander Zelenin, 2014-12-02
@amstr1k

if your package is not available on the packager, then you need to describe the repository where the package will be loaded from.
https://getcomposer.org/doc/05-repositories.md#vcs
to register in the composer.json of the application.

D
Dialog, 2014-12-02
@Dialog

The composer.json with the description of the extension is placed in the root of the repository. Your project (yii2-app) describes the repository and require.

A
amstr1k, 2014-12-02
@amstr1k

Dialog Well, as if I already understood this) The question is what to do next? because i have a mistake

[Composer\DependencyResolver\SolverProblemsException]                                                                          
    Problem 1                                                                                                                    
      - The requested package amstr1k/yii2-category could not be found in any version, there may be a typo in the package name.  
  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://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.                               
  Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

V
v1os, 2017-10-26
@v1os

same stuff

D
dmitriy, 2017-10-26
@dmitriylanets

should be described like this

{
      "type": "package",
      "package": {
        "name": "amstr1k/yii2-category",
        "version": "0.1",
        "source": {
          "url": "[email protected]:amstr1k/yii2-category.git",
          "type": "git",
          "reference": "62adc2c8e5ccf5394ff7c2f5cc31db7709cebba5"
        }
      }
    }

but in general deploy satis to generate your packages.json map for the right repos

N
Neyury, 2017-03-20
@Neyury

Decimal numbers are denoted with a dot, not a comma.
Now you get it so that you multiply 100 by 0, and then add 5 + 100 + 1000

S
sim3x, 2017-03-20
@sim3x

(100*0,5)+100+1000
1105
(100*0.5)+100+1000
1150
homework will be to tell what zhs does at each step

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question