I would like to know how to install multiple vendors into one project using composer. E.g I would like to install Paypal SDK and Stripe SDK into my project.
How do I go about this, and how would the folder structure look like?
You can install as many dependencies as you wish using Composer. For instance, to install both Paypal's and Stripe's PHP libraries, you'd run these commands:
composer require "paypal/rest-api-sdk-php:*"
composer require stripe/stripe-php
Afterwards, both libraries would be installed in the vendor directory, and both would be automatically included in your code when you load dependencies with:
require_once("vendor/autoload.php");
Related
I want to instal October CMS, installation guide is here: https://octobercms.com/docs/setup/installation
but I do not want use composer and install it from repository by composer.
I want download files from here: https://github.com/octobercms/october
and install/compile downloaded files on my local server.
October is no longer free and open source (see https://octobercms.com/blog/post/october-cms-moves-become-paid-platform), and as a part of their v2 they no longer support hosts without composer support or exec() access. The best you could do with October is purchase a license, use composer locally; and then just transfer the files to your server directly, but you won't be able to use the backend to install or update the core, plugins, or themes from the marketplace.
The good news is that the core maintainers have forked the project and are continuing the original project as Winter CMS (see https://github.com/wintercms/winter/issues/5; disclaimer, I'm one of them); and Winter CMS will continue to supports hosts without composer or exec() access.
Winter CMS is currently only available to install through composer, but it does support installing and updating plugins via the backend without composer. We're currently hard at work at getting our marketplace up and running, as well as our web installer, but in the meantime it uses October's marketplace instead.
I'm writing a VSCode extension that relies on Firebase Admin SDK. I'm trying to get it configured but when I run and activate the plugin, the extension host process throws a module loading error:
Could not find module: .../node_modules/firebase-admin/node_modules/grpc/src/node/extension_binary/node-v54-darwin-x64/grpc_node.node
When firebase admin was installed it built a version of the binary dependency but using a different version: node-v51. So the library is there but the version is different.
I probably need to somehow build the node-v54-darwin/x64 library when the Firebase sdk is installed via npm, but I'm not familiar with native modules, pre-gyp etc so I'm fumbling through it.
Does anyone know how to coerce npm to build the version required by the vscode host process for the grpc dependency?
I have a Spring Boot application deployed as a Cloud Foundry app on Bluemix. Unfortunately the core of this app depends on an external program (e.g. abc) which can be easily installed using apt-get install abc on a desktop environment.
Is there any way to install such a dependency in a cloud foundry environment?
Many thanks for your support
Luca
I'm working on a similar challenge with R and am using a soon-to-be-discontinued git repo which uses apt-get options to allow you to redirect your install into folders/directories where you have write authority during the staging process. You'll have to update your paths to ensure that you can access the installed code. The install process is multi-step,
define the alternate path for apt
define the path for your installation
update apt
use apt-get install ... to download the necessary packages and associated dependencies
use dpkg to install the downloaded packages
I installed the payum/payum-bundle with composer (using the PHP Storm Plugin).
I couldn't install a version newer to 2.0.1 because the newer version seems not to be marked as stable (minimum-stability in composer.lock is "stable").
I too installed the payum/paypal-express-checkout-nvp bundle to add paypay express support.
I set everything up, created a controller to test it and ended up getting the error
Attempted to load trait "GatewayAwareTrait" from namespace "Payum\Core".
Did you forget a "use" statement for another namespace?
According to this (closed) issue the problem seems to be that payum/core is at version 1.2.8 but should be at least 1.3
https://github.com/Payum/PayumBundle/issues/367
Obviously the payum/bundle installation in version 2.0.1 installed the core-part with 1.2.8.
Now... How can I force composer to update the payum/core to at least 1.3?
What I need to do is either tell composer to ignore the minimum-stability for this single bundle or to set the minimum-stability to something less then stable (which I assume not being the best idea especialy when not permanently following all dev branches of all used packages) and a hint on how then to update the payum/core part.
Any hints are very wellcome - I am stuck here...
Your assumption is wrong, the version 2.1.0 of payum/payum-bundle is marked as stable.
In order to find out why you don't install it, we need your content of composer.json.
Did you run composer update in order to try to update to the latest packages of everything?
Since 1.3.0 Payum require a virtual package http client. You must add one of its implementations as a package, after that composer will allow you to upgrade payum.
The doc suggest you to install php-http/guzzle6-adapter but you can choose any other implementations of the client.
Do
php composer.phar update payum/core php-http/guzzle6-adapter
We have been testing with Platform.sh this weekend, which uses debian as its OS. The deployment of the application was easy, until we started testing some of the core functionalities like creating a PDF.
The PDF is generated using wkhtmltopdf, which has different binaries depending on OS. Our own platform consists of CentOS7 machines, so we let composer install the Centos7 specific package: https://github.com/rvanlaak/wkhtmltopdf-amd64-centos7 For Debian this package is needed: https://github.com/h4cc/wkhtmltopdf-amd64
So basically the problem is the inconsistency in plaform. Saw that composer allows you to define specific versions for PHP and extensions, but config.platform unfortunately can not solve this problem.
Unfortunately the following hooks did resolve into a deployment error too:
composer remove rvanlaak/wkhtmltopdf-amd64-centos7 --no-update
composer require h4cc/wkhtmltopdf-amd64:~0.12 --no-update
composer update
As we can not choose the OS on platform.sh, how can we let composer check for a specific OS?