composer-php

Composer vs Symfony 2 autoloader

狂风中的少年 提交于 2019-12-21 07:58:07
问题 I'm starting to use Composer in a project, in which I historically had all the dependencies under version control. This project currently uses the Symfony 2 autoloader. Because Composer comes with its own autoloading mechanism ( vendor/autoload.php ), that makes me wonder if I still need to use the Symfony ClassLoader. I assume that I could just use the Composer autoloader to autoload my project classes as well: $loader = require 'vendor/autoload.php'; $loader->add('MyProject', 'src'); Is

Updating composer throws exception Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist

落爺英雄遲暮 提交于 2019-12-21 07:50:32
问题 I recently ran latest composer installation for a Yii2 basic application template. But running php composer.phar install throws this exception: Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist The "yiisoft/yii2-composer" plugin requires composer-plugin-api 1.0.0, this WIL L break in the future and it should be fixed ASAP (require ^1.0 for example). [ReflectionException] Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist [ErrorException] Declaration of

How do i use Composer to install a package without a version (only master)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 07:24:10
问题 I am new to composer and i am trying to install this following lib via the composer update https://github.com/neitanod/forceutf8 so as i understand my composer.json looks like this { "config": { "vendor-dir": "libs/vendor" }, "require": { "raven/raven": "0.7.1", "monolog/monolog": "1.7.*", "smarty/smarty": "3.1.16", "forceutf8/forceutf8": "master" } } Bt for some reason (as i think forceutf8 has no version) its halts with error, all the rest installed correctly, error i get is Loading

Call to undefined method Illuminate\Foundation\Application::bindShared()

为君一笑 提交于 2019-12-21 07:13:58
问题 I've just upgraded Laravel from 5.0 to 5.1. I get this error: Call to undefined method Illuminate\Foundation\Application::bindShared() So after some searching I need to change bindShared to a singleton. I can do this in vendor/illuminate/html/HtmlServiceProvider.php The issue is, what happens when another dev works on the project and performs a composer install, or I deploy to a server. How can I persist changes to files in the vendor folder? 回答1: Okay based on your comment I see your issue

Can't get composer “path” repository to work

时间秒杀一切 提交于 2019-12-21 06:48:26
问题 I have a directory structure like so: composer.json < Main packages/ balunker/ testpackage/ composer.json < Package src/ TestPackage.php The main composer.json looks like this: { "name": "vagrant/composer-test", "repositories": [ { "type": "path", "url": "packages/*/*" } ], "require": { "balunker/testpackage": "*" } } While the package composer.json looks like so: { "name": "balunker/testpackage", "autoload": { "psr-4": { "Balunker\\": "src/" } } } On composer update I simple get a message

How would I only update one composer dependency?

房东的猫 提交于 2019-12-21 06:46:30
问题 I expected that composer update videlalvaro/php-amqplib would only update one dependency, but instead of that it updates all. What am I missing? PS: this dependency is defined as "videlalvaro/php-amqplib": "2.2.0" in composer.json PPS: the composer version used is 3da05c68f9561fa822c522b1815435ff990493ff 2013-10-02 14:25:06 PPPS: the actual output: $ composer.phar update videlalvaro/php-amqplib --no-dev Loading composer repositories with package information Updating dependencies Your

Remove files when downloading a dependency with composer

只愿长相守 提交于 2019-12-21 06:39:09
问题 I am sure I once read it somewhere but I cannot find it anymore anywhere, DAMN! So basically what I am trying to do is to specify some exclusion criteria in my composer.json file for a certain library of mine so that, when used as a dependency of a project, the importing project does not get test files, .git folders, READ.md files and all that stuff (totally useless when you only want a library as a dependency and not for development). So basically I am trying to lighten up my libs when they

ZeroMQ with PHP 7 in Ubuntu does not compile (“error: too many arguments to function”)

 ̄綄美尐妖づ 提交于 2019-12-21 06:29:13
问题 I have upgraded php5.6 to php7, but zeromq extension makes a lot of problems. Where can I download the correct zmq.so file for php7? None of the official sites offer a version for php7 that works (I'm using apache2.4). I've followed along the following tutorial: How to install ZeroMQ. The step "Installing ZeroMQ" is working fine, but the second step "Installing the PHP binding" is failing when I execute the command "make" with the following error: "/home/puser/zeromq-4.1.4/php-zmq/zmq.c:2740

ZeroMQ with PHP 7 in Ubuntu does not compile (“error: too many arguments to function”)

寵の児 提交于 2019-12-21 06:29:04
问题 I have upgraded php5.6 to php7, but zeromq extension makes a lot of problems. Where can I download the correct zmq.so file for php7? None of the official sites offer a version for php7 that works (I'm using apache2.4). I've followed along the following tutorial: How to install ZeroMQ. The step "Installing ZeroMQ" is working fine, but the second step "Installing the PHP binding" is failing when I execute the command "make" with the following error: "/home/puser/zeromq-4.1.4/php-zmq/zmq.c:2740

Can't set/find detect_unicode to Off

我的梦境 提交于 2019-12-21 06:06:18
问题 I'm want to start using phpDocumentor and the manual installation keeps throwing an error about me not having set detect_unicode = Off in my php.ini in Terminal. When I add it to my php.ini it doesn't take and I get the same issue when running the install. Nobody seems to have this problem, and for the life of me I can't figure it out. https://github.com/phpDocumentor/phpDocumentor2/blob/develop/README.md#installation What am I missing? (I did restart the MAMP server after the php.ini edit)