Giter VIP home page Giter VIP logo

Comments (3)

shama avatar shama commented on August 26, 2024

First, I recommend adding a composer.json file to php-gd-simpleimage and then submitting it to packagist. You can require it without submitting but it makes it a whole lot easier if all the packages are from packagist.org. No need to require composer/installers for cakephp vendor packages.

If submitted to packagist.org, in your app folder create a composer.json file then download composer:

{
  "require": {
    "mjohnson/utility": "*",
    "simkimsia/php-gd-simpleimage": "*"
  },
  "config": {
    "vendor-dir": "Vendor"
  }
}

To install run php composer.phar install. Since Utility uses composer/installers and has the type: cakephp-plugin it installs to the correct location.

With cakephp, it's recommended to add the vendor-dir specification. Cake wants the Vendor dir to be ucfirst. Some machines are case-insensitive and will install to the Vendor folder just fine, some will not. So best to be prudent and just specify it. FWIW, this isn't an issue with CakePHP 3.

If you wanted to require php-gd-simpeimage without submitting to packagist.org (as sometimes is necessary for plugins whose authors have not)... it gets a bit cumbersome but can be done:

{
  "require": {
    "simkimsia/php-gd-simpleimage": "*",
    "mjohnson/utility": "*"
  },
  "repositories": {
    "cakephp-unofficial": {
      "type": "package",
      "package": {
        "name": "simkimsia/php-gd-simpleimage",
        "version": "0.1.0",
        "source": {
          "url": "git://github.com/simkimsia/php-gd-simpleimage.git",
          "type": "git",
          "reference": "origin/master"
        }
      }
    }
  },
  "config": {
    "vendor-dir": "Vendor"
  }
}

This adds a repository and package which we can then require simkimsia/php-gd-simpleimage. By default packages will be installed to the vendor folder. If this were a cakephp plugin that didn't use composer/installers you would need to do the same except in the package definition you would also need to require composer/installers and set the type to cakephp-plugin.

Hope this helps!

from installers.

simkimsia avatar simkimsia commented on August 26, 2024

On Mon, Jan 28, 2013 at 3:36 PM, Kyle Robinson Young <
[email protected]> wrote:

No need to require composer/installers for cakephp vendor packages.

Hi Kyle, you said,

No need to require composer/installers for cakephp vendor packages.

so does that mean, for cakephp plugin packages, they require
composer/installer?

for cakephp vendor packages, they do not?

How do I enforce any cakephp apps that use php-gd-simpleimage as a Vendor
to install it under app/Vendor/php-gd-simpleimage?

Or Composer automatically takes care of that for me?

With gratitude,
KimSia
金城

from installers.

shama avatar shama commented on August 26, 2024

Composer, by default, will install your package to vendor/simkimsia/php-gd-simpleimage. A package that requires composer/installers, which is just a collection of custom installers will have it's path altered based on the package type.

I'd recommend just having your package install to the default location. Otherwise in order to have it installed to Vendor/php-gd-simpleimage you would need to instruct users to add the following to their composer.json files:

{
    "extra": {
        "installer-paths": {
            "Vendor/{$name}/": ["simkimsia/php-gd-simpleimage"]
        }
    }
}

from installers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.