composer-php

using PHP with Composer did not find the required Class

孤人 提交于 2019-12-24 11:18:49
问题 I've got a PHP code that selects a PDF file and converts it to a text file. I'm using an external library pdf-to-text with the composer. Following is the system display error: Fatal error: Uncaught Error: Class 'Pdf' not found in C:\xampp\htdocs\testcomposer\test2.php:6 Stack trace: #0 {main} thrown in C:\xampp\htdocs\testcomposer\test2.php on line 6 Project Structure : testcomposer app -Spatie -pdftotext -src -Exceptions -CouldNotExtractText.php -PdfNotFound.php -pdf.php -symfony vendor

How to create a Symbolic link to PHPUnit?

南楼画角 提交于 2019-12-24 10:51:51
问题 I'm using Laravel. Whenever I need to run the tests I have to execute PHPUnit in the following directory: vendor/phpunit/phpunit/phpunit How can I create a symlink to the file above so that I don't have to type in the full path to phpunit every time ? I tried the following command but didn't work: ln -s vendor/phpunit/phpunit/phpunit mysym For some reason, it says 'Command Not Found' when I try to execute the Symlink. 回答1: How can I create a symlink to the file above so that I don't have to

file_get_contents: Unable to set local cert chain file

雨燕双飞 提交于 2019-12-24 08:37:38
问题 We're using composer to upgrade dependencies with Satis. After a recent server upgrade we were unable to do so. Narrowing down possible causes, we've discovered, that file_get_contents php function fails while trying to establish an ssl connection. We're using the following script to test our ssl: <?php $url = 'https://satis.work.com/packages.json'; $contextOptions = [ 'ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false, 'local_cert' => '/home/work/.ssl/deployer.pem', ] ];

Your requirements could not be resolved to an installable set of packages for pinterest API

荒凉一梦 提交于 2019-12-24 08:37:19
问题 This is the Github Page for API. This is the command I run in composer: composer require dirkgroenen/Pinterest-API-PHP 0.2.11 and this is the error I get Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package dirkgroenen/pinterest-api-php No version set (parsed as 1.0.0) is satisfiable by dirkgroenen/pinterest-api-php[No version set (parsed as 1.0.0)] but these conflict with your requirements or minimum-stability. Here is the link to

How can I test/install an untagged version of a composer package?

拜拜、爱过 提交于 2019-12-24 07:59:57
问题 I would like to test my private composer package on localhost without the need to commit a new tag to perform the test. My package tree ├── composer.json ├── README.md └── src ├── Controllers │ ├── Models ├── Providers │ └── RouteGenericServiceProvider.php ├── Repositories ├── Routes │ └── generics.php ├── Services │ └── Transformers 回答1: As an alternative to what is suggested bey @Matteo, you can use an inline alias and reference a commit hash instead of a tag. Assume that x.y.z is the

Connection timeout error while updating composer on Digital Ocean

爷,独闯天下 提交于 2019-12-24 07:49:54
问题 I am able to ssh into my droplet. Am also able to apt update and apt upgrade. When I try to run sudo composer self-update or composer update, I am getting connection timeout error. The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: Connection timed out output of ufw status To Action From 22 ALLOW Anywhere 80 ALLOW Anywhere 443 ALLOW Anywhere 25 ALLOW Anywhere 10000 ALLOW Anywhere output of composer diagnose Checking platform settings: OK Checking git

Laravel - require php script in a service provider

隐身守侯 提交于 2019-12-24 07:49:54
问题 I am quite new to Laravel and implemented the service provider for my helper functions using this answer on SO. It recommended to: in the register function of your newly generated HelperServiceProvider.php add following code require_once app_path('Helpers/AnythingHelper.php'); However, Laravel docs state that register method should only be used to bind things into the container: As mentioned previously, within the register method, you should only bind things into the service container. You

PHP - Google Speech API: Class 'Google\Cloud\Speech\SpeechClient' not found

半腔热情 提交于 2019-12-24 07:26:13
问题 I was hoping someone could help me figure out how to get google's speech to text api running. https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/speech/api The specific code I'm trying to run is: src/functions/transcribe_sync.php with a line added at the end to call the function: transcribe_sync("mono.flac", 'en-US'); It can't locate a dependency. I've been playing around with composer but haven't been able to figure it out. Heres the error: php transcribe_sync.php PHP Fatal

How to set the install directory for a package on the package, instead of on the project?

家住魔仙堡 提交于 2019-12-24 06:42:15
问题 I am working on creating a custom composer package. The composer package must install to a custom folder instead of vendors/ directory I want it to be installed in packages/. This is how my composer.json looks like: { "name": "demo/contentfeed", "description": "This is yet another Lumen composer package wrapper", "type": "lumen-plugin", "version": "1.1.5", "keywords": ["demo","lumen","drupal"], "homepage": "https://github.com/gauravmehrasrijan/lumen-feeds", "require": { "composer/installers":

Error installing XHP with composer

余生颓废 提交于 2019-12-24 05:46:20
问题 I'm trying to install XHP on OSX using composer. I have a directory with composer.phar and composer.json. My composer.json file looks like this: { "require": { "facebook/xhp-lib": "~2.2" } } I also installed the latest version of HHVM. I tried running hhvm composer.phar install --verbose but got the following error: [ErrorException] Undefined index: 0 Exception trace: () at phar://composer.phar/bin/../src/../vendor/symfony/process/Pipes/AbstractPipes.php:140 Composer\Util\ErrorHandler::handle