Questions tagged [composer-php]

Composer is an application-level package manager for the PHP programming language. It provides a standard format for managing with ease PHP-based project dependencies (libraries) and was strongly inspired by Node.js's "npm" and Ruby's "bundler". Use with the [php] tag

Presentation

Composer is an application-level package manager.

Yes, it deals with "packages" or libraries, but it manages them on a per-project basis, installing them inside your project's directory.

By default, it will never install anything globally.

Thus, it is considered a PHP-based project package manager.

Useful links

It aggregates all sorts of PHP packages that are installable with Composer.

Also, you can check your build log; it could be helpful for debugging.

  • Packanalyst: Packanalyst is a service that lets you browse packages from Packagist and shows who is using and implementing your interfaces / abstract classes/traits.
11065 questions
4
votes
1 answer

how do I version my composer package

I have just published my first Laravel plugin with composer and Packagist. Now, How should I manage version??? When I push my Git, I should be able to make a composer update and get the changes, but I couldn't do it. I saw a lot of plugin that…
Juliatzin
  • 18,455
  • 40
  • 166
  • 325
4
votes
4 answers

Composer install cannot delete files

I am attempting to run a composer install to update dependencies on my production server, but I continue to get the following error (this happens to be on a Laravel Forge deployed server). Loading composer repositories with package…
user3691644
  • 477
  • 3
  • 7
  • 18
4
votes
1 answer

Transfer composer files from localhost to server

I am using localhost as my development server in which I added Composer and installed the Stripe dependencies. Since I have a shared hosting account, I want to transfer the Composer files to my server since I don't have root access to run the…
Matt Butler
  • 476
  • 6
  • 21
4
votes
1 answer

Git cloned laravel 5.2 project won't migrate

I clone a project from git. After i run command: - composer dump-autoload - composer updated File composer.json: { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license":…
Huan Ho
  • 145
  • 2
  • 9
4
votes
1 answer

Use composer to require package with tests included

I want to reuse test code (e.g. mock classes) from a package. But i don't know how to tell composer to fetch the dependency with tests included. My composer.json: "require": { "some/package": "2.0.0" } composer.json of the other package (which…
Sloothword
  • 349
  • 1
  • 10
4
votes
2 answers

Composer installation requirements

I am trying to install composer to the laravel project. When im doing sudo composer install in projects directory it shows me two errors: Problem 1 - Installation request for simplesoftwareio/simple-qrcode dev-master -> satisfiable by…
divHelper11
  • 2,090
  • 3
  • 22
  • 37
4
votes
1 answer

How to make Extending Class using PSR-4 autoload composer

i have a directory structure like this : and this is my composer.json : { "autoload": { "psr-4": { "travelo_conf\\": "config/", "travelo_url\\": "url/" } } } now I'm trying to extending my Api Class…
Herdy
  • 179
  • 1
  • 2
  • 16
4
votes
0 answers

composer could not scan for classes inside /vendor/laravel/framework/src/Illuminate/Queue/IlluminateQueueClosure.php

Basically a fresh git clone of a working repo... When I try to composer install I get an error. Seems like the laravel folders are not being installed the way composer expects to look for them? I tried updating/installing composer, deleting…
Phil
  • 2,176
  • 10
  • 33
  • 56
4
votes
0 answers

Class 'League\Glide\ServerFactory' is not found

im trying to use League Glide for showing my image, here is my code: require(APPPATH.'vendor/autoload.php'); use League\Flysystem\Adapter\Local; use League\Flysystem\Filesystem; function league_image(){ $array = array( 'source' => new…
Kelvin
  • 1,004
  • 1
  • 10
  • 32
4
votes
1 answer

Can I use composer without installing it?

I've noticed on a lot of open source user systems, like UserFrosting or Drupal they some how use composer, without the user actually having to install composer on to there server. I was just wondering how would I be able to do this, I've had a look…
James Nixon
  • 317
  • 4
  • 13
4
votes
1 answer

PSR-4 namespace conventions for folders on same level as src

The current convention for PSR-4 is to namespace the src folder as Vendor\Package. Any file within is then namespaced using the directory structure. so src/Model/MyModel.php uses namespace Vendor\Package\Model; class MyModel {...} This is…
myol
  • 8,857
  • 19
  • 82
  • 143
4
votes
0 answers

Composer config: use ~tilde instead of ^caret for new requires

Is it possible to configure PHP Composer to use a ~ prefix to constrain dependencies to patch-level updates (like 1.2.x) instead of the default ^ (1.x.x)? The term used in their documentation is "Next Significant Release Operators," but I don't see…
DMack
  • 871
  • 2
  • 9
  • 21
4
votes
1 answer

How to automatically pull the version number?

I'm writing a Symfony Console PHP application which takes a version number in the constructor. $app = new Application('myapp', '1.0'); I've already found that it's easy to forget to bump the version number when making a new git tag release. How can…
Jeff Puckett
  • 37,464
  • 17
  • 118
  • 167
4
votes
5 answers

The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed

When I run the following command sudo composer update then I am getting following error. The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: …
Kundan roy
  • 3,082
  • 3
  • 18
  • 22
4
votes
2 answers

Cannot composer dump-autoload - file put contents error?

I'm trying to: composer dump-autoload On a Ubuntu 16.04 server. I get the error: file_put_contents(/var/www/example.com/site/vendor/composer/autoload_namespaces.php): failed to open stream: Permission denied I have: Change permission of storage…
panthro
  • 22,779
  • 66
  • 183
  • 324