Closed ChayimZaklad closed 9 years ago
If you haven't used composer before, check it out: https://getcomposer.org/
Composer helps you manage your dependencies during development and will create everything you need for autoloading the PHP classes (no need for explicit requires anymore).
When you're actually deploying your code to your server, you will already include the installed dependencies. So the "installation" as mentioned in the README is not actually meant for that part of the process.
Hope that answers your questions.
I get an error when I try to install it with composer. Both the composer.phar and the composer.json are in the same folder.
path:/var/www/html/apai-io$ php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
Potential causes:
Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
This is what my composer.json file looks like.
{ "name": "exeu/apai-io", "type": "library", "description": "Amazon Product Advertising PHP Library", "keywords": ["Amazon", "ECS", "Product Advertising", "SOAP", "REST", "Products"], "homepage": "https://github.com/Exeu/apai-io", "license": "Apache-2.0", "authors": [ { "name": "Jan Eichhorn", "email": "exeu65@googlemail.com", "role": "Maintainer" }, { "name": "Dejan Spasic", "email": "dejan.spasic@bitweise.biz", "role": "Developer" } ], "support": { "issues": "https://github.com/Exeu/apai-io/issues" }, "minimum-stability": "dev", "require": { "php": ">=5.3.0", "ext-curl": "" }, "require-dev": { "phpunit/phpunit": "4.3." }, "autoload": { "psr-0": { "ApaiIO": "lib/" } },
"require": {
"exeu/apai-io": "dev-master"
}
}
I recommend to read and understand the excellent documentation on getcomposer.org.
Remove your current composer.json and execute:
/path/to/php composer.phar require "exeu/apai-io:1.*"
My problem with composer has been fixed for a while now.
I see that there is a Config.dist.php file in the samples folder. Is that the only file that needs to be filled out to start running the examples, and using this library right away? (with the exception of the last line, I take it)
<?php
define('AWS_API_KEY', 'API KEY');
define('AWS_API_SECRET_KEY', 'SECRET KEY');
define('AWS_ASSOCIATE_TAG', 'ASSOCIATE TAG');
define('AWS_ANOTHER_ASSOCIATE_TAG', 'ANOTHER ASSOCIATE TAG');
These are constants and should be used only in the examples.
Loading composer repositories with package information Installing dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.
Problem 1
Potential causes:
Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
my composer.json file content as follows: { "name": "exeu/apai-io", "type": "library", "description": "Amazon Product Advertising PHP Library", "keywords": ["Amazon", "ECS", "Product Advertising", "SOAP", "REST", "Products"], "homepage": "https://github.com/Exeu/apai-io", "license": "Apache-2.0", "authors": [ { "name": "Jan Eichhorn", "email": "exeu65@googlemail.com", "role": "Maintainer" }, { "name": "Dejan Spasic", "email": "dejan.spasic@bitweise.biz", "role": "Developer" } ], "support": { "issues": "https://github.com/Exeu/apai-io/issues" }, "minimum-stability": "dev", "require": { "php": ">=5.3.0", "ext-curl": "*" }, "require": { "exeu/apai-io": "dev-master" }, "autoload": { "psr-0": { "ApaiIO": "lib/" } } }
I've gotten your sample code to work without installing your library in your recommended fashion. I just included all the libary files, in required order, in my PHP code, and I commented out the require_once of bootstrap.php. This avoided dealing with shared server management to get them to install the way you recommend.
What advantages would I have if I get it installed the way you recommend instead? And, what disadvantages do I have doing it the way I have?