yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.23k stars 6.91k forks source link

composer plugin from own repo is not working #16373

Closed ajkosh closed 6 years ago

ajkosh commented 6 years ago

What steps will reproduce the problem?

https://github.com/composer/composer/issues/7395#event-1668067654

What is the expected result?

What do you get instead?

Additional info

Q A
Yii version 2.0.?
PHP version 7.0
Operating system ubuntu 16.0
rob006 commented 6 years ago

That is because you did not specified any autoloading rules for this package, so there is no rules for defining aliases.

Just don't use repositories with package type for dependencies with correct composer.json. This type was designed for installing non-composer packages, using it is very unintuitive when you're using it for forks of composer packages.

ajkosh commented 6 years ago

@rob006 so where to define rules for auto load and what type i should use instead of package.this is my json .Can you help me please.


{
    "name": "haruatari/yii2-module-app",
    "description": "Empty module application on Yii2",
    "license": "MIT",
    "authors": [
        {
            "name": "Viktor Pikaev",
            "email": "haruatari@gmail.com",
            "homepage": "http://haru-atari.com/about"
        }
    ],
    "minimum-stability": "stable",
      "repositories": [
    {
    "type": "package",
    "package": {
      "name": "ajkosh/yii2-admin",
      "version": "3.2.0",
      "type": "yii2-extension",
      "source": {
        "url": "git@gitlab.com:ajkosh/yii2-admin.git",
        "type": "git",
        "reference": "master"
      },

    }
  }
],

    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "2.0.15",
        "yiisoft/yii2-bootstrap": "~2.0.0",
        "yiisoft/yii2-swiftmailer": "~2.0.0",
        "paulzi/yii2-materialized-path": "^2.0",
        "kartik-v/yii2-widget-select2":"2.0.4",
        "ajkosh/yii2-admin": "3.2.0",
        "cybercog/yii2-google-analytics": "^0.3.2",
                 "wbraganca/yii2-dynamicform": "*"

    },

    "require-dev": {
      "codeception/codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-faker": "*"

    },
    "config": {
    "fxp-asset": {
      "installer-paths": {
        "npm-asset-library": "vendor/npm",
        "bower-asset-library": "vendor/bower"
      }
    },
    "process-timeout": 1800
  },
     "scripts": {
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject"
        ]
    },
    "extra": {
        "yii\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0777",
                    "web/assets": "0777",
                    "data": "0777",
                    "data/log": "0777",
                    "data/tmp": "0777",
                    "yii": "0755"
                }
            ],
            "generateCookieValidationKey": [
                "config/web.php"
            ]
        }

    }
}
rob006 commented 6 years ago

See my answer on SO.