Comments (3)
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.
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.
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)
- When target location change, data must be moved (not duplicated) HOT 3
- Path issue shows with composer installing via MAMP on macOS HOT 1
- Your app key is missing message issue
- Want to write a custom path for plug-in package? I don't know how to debug
- composer 2.3.5 breaks composer/installers HOT 3
- Disabling installer in my package will still trigger the installer path when it's pulled in a project HOT 4
- Add license to the package HOT 1
- Add version to installer-path variables HOT 1
- Add Support for "Generic" Library HOT 2
- Support https://asset-packagist.org/ types? HOT 3
- Using vcs repo without composer.json
- Add a installer for Laminas project HOT 1
- Renaming vendor breaks composer install HOT 2
- mediawiki-skin should install in CamelCase name directory
- Could we add support of wordpress-core type?
- Why are dependencies still present in the installer path after removal?
- Add support for Moodle "tiny" plugins HOT 1
- Extend documentation regarding disabling of installers
- Add partial support for the generic "library" and "project" types HOT 1
- Composer Install Installs Modules in "vendor" Instead of Specified "modules" Directory HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from installers.