Trouble installing Omnipay via Netbeans composer extension

217 views Asked by At

I am currently trying to install Omnipay into my Codeigniter project. I am stuck on windows because I do not have ssh access to the box where this needs to run on. So far I have gotten a new directory in the project root that is named "vendor" and it contains a lot of empty directories referring to Symfony (for what reason is beyond me).

Then I get a runtime exception that I need to enable the openssl extension in my php to download the necessary files and this is where I am stuck at. I don't run WAMP on my computer and I just use the php.exe I downloaded to work with netbeans.

Isn't there an easier way to get omnipay to run? Like just download the files from somewhere and plug them into my project like normal? It seems to be an aweful lot of headache to get a simple library to run in my CI project.

Please forgive my ignorance towards composer but I currently see no benefit of using it for this particular project.

1

There are 1 answers

0
Adrian Macneil On

You can "just download" the files here: https://github.com/omnipay/common/archive/master.zip

The problem is, Omnipay depends on Guzzle (an HTTP library), and Guzzle depends on some Symfony components. So you will spend the rest of the day downloading dependencies and making sure you have all the necessary files. That is the problem Composer solves for you.

I don't have any experience running Composer on Windows, but I would start here:

http://getcomposer.org/doc/00-intro.md#installation-windows

Using the Installer

This is the easiest way to get Composer set up on your machine.

Download and run Composer-Setup.exe, it will install the latest Composer version and set up your PATH so that you can just call composer from any directory in your command line.

Once you have Composer installed, you should simply be able to make a file named composer.json in your project root, with the following contents:

{
    "require": {
        "omnipay/omnipay": "~2.0"
    }
}

Then use the Command Prompt and cd to your project's directory, and run composer update to download the Omnipay files and all their dependencies.