I try to install zf2 component using composer but can't do it because composer always
download all framework, what am i doing wrong?
Composer version 1beccf9
{
...
"repositories": [
{
"type": "composer",
"url": "http://packages.zendframework.com/"
}
],
"require": {
"zendframework/zend-http" : "2.0.*"
}
}
I enabled php_intl extension and that solved the problem
I cannot reproduce the issue. I have tried with both the "http" and "https" schema, and in both cases, received only the zend-http package and its dependencies. The only possible issue I can see is that if you're not using the "https" schema, and do not have openssl compiled into your PHP version, it's possible that Composer is unable to reach our repository, and thus defaults to the packagist repository, which will only ever give you the full ZF distribution.
Related
I've got two "identical" (same OS, Visual Studio, etc.) machines. One has vcpkg with a number of installed packages ('older' versions), and I'd like an identical copy on the new machine that is integrated with Visual Studio. There seem to be a number of relatively complicated methods of accomplishing this: export/import, manifest versioning and binary caching. But what I'd really like to do is run a command on the new machine like "vcpkg installfrompath " or copy the vcpkg folder to the new machine and run "vcpkg restore". I really feel like this must exist and I'm just not seeing it.
Got answer from MS :) https://github.com/microsoft/vcpkg/issues/23464
Simply copy the vcpkg folder and run "vcpkg integrate install"
I verified that this works. Interestingly, this is the command you use when initially setting up vcpkg, but it didn't click for me, not did I see this answer in any of the similar questions I saw posted.
Use manifest mode. It's really easy and gives you exact control over different versions. Just add a file called "vcpkg.json" to the root folder of your project, activate "manifest" in the vcpkg entry of your Visual Studio project and you are almost done.
This is what a manifest file looks like:
{
"name": "myapp",
"version": "1.66.0",
"dependencies": [
{ "name": "pybind11" },
{ "name": "boost-format" },
{ "name": "boost-preprocessor" },
{ "name": "boost-uuid" },
{
"name": "python3",
"version>=": "3.7.4"
}
],
"builtin-baseline": "03ca9b59af1506a86840e3a3a01a092f3333a29b",
"homepage": "https://some.server.loc",
"supports": "windows"
}
Then simply build with Visual Studio. This will invoke vcpkg and build the exact versions you want.
I've never used composer before, so I'm not sure what this error means or what I need to do. But I am trying to use PHPSpreadsheet to be able to convert excel files into php for adding information to a database.
Uncaught Exception: Composer autoloader could not be found. Install
dependencies with composer install and try again.
Can anyone tell me what I need to do to get this system working.
Running cPanel with PHP7 EasyApache4
I do have root access to dedicated server.
Looks like you haven't installed the packages via composer.
You have to create a file named "composer.json" on the root of your project.
it should be something like this:
{
"require": {
"phpmailer/phpmailer":"5.2.22",
"slim/slim":"2.0",
"rain/raintpl":"3.0.0",
},
"autoload": {
"psr-4": {
"ProjectName\\": "vendor\\projectPackage\\php-classes\\src"
}
}
}
After that you should run the command "composer install" on you git bash and it will download your dependencies and create an autoload for you.
I am trying to include a private BitBucket repository to my package.json, but I also would like to manage the version, as a normal module.
currently I am using this
"package-name": "git+https://<user>:<password>#<url-repository>.git"
I already tried it, but it didn't work.
"package-name": "git+https://<user>:<password>#<url-repository>.git#v1.0"
Any idea?
Login to your bitbucket account and under user settings add an app password:
Add package dependency to your package.json as:
"dependencies": {
"my-module": "git+https://Xaqron:pwd#bitbucket.org/Xaqron/my-module.git#*"
}
Replace Xaqron with your own username and pwd with app password from step one.
to install specific version add #v.v.v (i.e. #1.0.0) to the end of dependency URL.
I am currently using this and it works:
{
"dependencies": {
"package-name": "git+ssh://git#<url-repository>.git#v0.1.0"
}
}
I am using npm version 4.1.2 and self hosted bitbucket version 4.14.6
You have to git tag the version you want to install in the module repo. The repo url can be found in the module's package.json file, e.g.
"repository": {
"type": "git",
"url": "git+https://github.com/repo-owner-name/my-module.git" // <-- This line!
},
When you've added a tag (e.g. git tag -a 0.0.1 -m "auto release") to a release, it can be installed using:
"my-module": "git+https://bitbucket.org/repo-owner-name/my-module.git#0.0.1"
Hey I am trying to install a package into a custom 'admin' directory using composer.
Here is my JSON:
{
"name": "frontier/installer",
"description": "The best front end engineer package around",
"require": {
"aheinze/cockpit": "*"
},
"extra":{
"installer-paths":{
"admin": ["aheinze/cockpit"]
}
}
}
Now when I run composer install it all installs but defaults to vendor/aheinze/cockpit I cannot for the life of me figure out why.
Have done my research this should be the right code... any obvious errors?
Cheers.
I have implemented this composer plugin to install packages into user (custom) defined folders you can just include it in your composer.json, follow the example and tell me if you have more questions :)
https://github.com/mnsami/composer-custom-directory-installer
composer-custom-directory-installer
A composer plugin, to install differenty types of composer packages in custom directories outside the default composer default installation path which is in the vendor folder.
This is not another composer-installer library for supporting non-composer package types i.e. application .. etc. This is only to add the flexability of installing composer packages outside the vendor folder. This package only supports composer package types,
https://getcomposer.org/doc/04-schema.md#type
The type of the package. It defaults to library.
Package types are used for custom installation logic. If you have a package that needs some special logic, you can define a custom type. This could be a symfony-bundle, a wordpress-plugin or a typo3-module. These types will all be specific to certain projects, and they will need to provide an installer capable of installing packages of that type.
How to use
Include the composer plugin into your composer.json require section::
"require":{
"php": ">=5.3",
"mnsami/composer-custom-directory-installer": "1.1.*",
"monolog/monolog": "*"
}
In the extra section define the custom directory you want to the package to be installed in::
"extra":{
"installer-paths":{
"./monolog/": ["monolog/monolog"]
}
by adding the installer-paths part, you are telling composer to install the monolog package inside the monolog folder in your root directory.
As an added new feature, we have added more flexibility in defining your download directory same like the composer/installers, in other words you can use variables like {$vendor} and {$name} in your installer-path section:
"extra": {
"installer-paths": {
"./customlibs/{$vendor}/db/{$name}": ["doctrine/orm"]
}
}
the above will manage to install the doctrine/orm package in the root folder of your project, under customlibs.
Note
Composer type: project is not supported in this installer, as packages with type project only make sense to be used with application shells like symfony/framework-standard-edition, to be required by another package.
If you want to use the installer-paths option the package you want to be installed in a different path must require composer/installers.
In your case the aheinze/cockpit package doesn't require composer/installers as you can see in its composer.json at github.
Have a look at the composer documentation for custom paths and you see that it tells you:
Note: You cannot use this to change the path of any package. This is only applicable to packages that require composer/installers and use a custom type that it handles.
This means you are not able to change the install path of this specific package.
Anyway I don't see any necessity to install it into any different directory from the default vendor folder.
If you just need to put all packages under the "admin" directory, the best option is:
{
"config": {
"vendor-dir": "admin"
}
}
You can use the post-autoload-dump script to copy the package after install/dump-autoload:
"scripts": {
"post-autoload-dump": [
"cp -r vendor/aheinze/cockpit admin"
]
},
For install multiple packages in the same directory you can follow this structure
1- your path should be like this "modules/patched/{$name}"
2- and an array of any package that you want to move or install that same directory
"extra":{
"installer-paths": {
"modules/patched/{$name}": [
"drupal/signature_field",
"drupal/eck",
"drupal/auto_entitylabel"
]
}
The package or module should be in your require section as well.
"require": {
"composer/installers": "^1.0.24",
"drupal/auto_entitylabel": "2.x-dev",
"drupal/signature_field": "^1.0#RC",
"drupal/eck": "^1.0#alpha",
}
I am trying to install some js files via bower. My repo has a bower.json with a main property, however the whole repo gets installed to components/, not just the files in the dist/custom/ dir.
Here is what my bower.rc looks like
{
"name": "jquery-m",
"version": "2.0.2mup",
"description": "Meetup custom build of jQuery 2.0, used on mobile",
"main": [ "./dist/custom/" ],
"license": "MIT"
}
Is this the way bower is supposed to work? I thought it was possible just to specify certain files with your main property.
Yes, this is how Bower is meant to work. Bower-installer looks like a more lightweight solution than Grunt to solve the exact requirement you're describing and get just the files you need to be deployed to production.
Yes, that's how Bower works.
It always look for the matching tag on the repo; if cannot find one, it goes with the default branch, and download it.
The unique usage I've seen so far for the main property of a bower.json file is for integration, for example with build tools, like Grunt (there are lots of other bower related tasks, just Google around) and others.
This is a common misconception.
As stated in Bower documentation, the main property is a string/array listing the primary endpoints of your package.
Bower package maintainers (and maybe users, using the overrides property) can use the ignore property, which is an array of paths not needed in production that you want Bower to ignore when installing your package.
Example:
{
"name": "stackoverflow",
"version": "1.0.0",
"ignore": [
"test/**",
".jshintrc"
],
"dependencies": {
"foo": "~1.1"
}
}