CORT Setup
https://getcomposer.org/doc/00-intro.md#installation-nix
Once installed type $ composer
In the root of your application (The lowest level, the same area you see the /app folder in) create a file:
$ touch composer.json
JSON means Javascript Object Notation. It sounds big, but's it's quite easy, and similar to arrays. This IS in fact, JavaScript syntax you would use in real javascript.
// Object examples:
{}
{name: "ted"}
// Array example:
[]
[1, 2, 3];
// Object + Array example
{
people: [
"ted",
"john"
]
}
You may notice there are no variables assigned to the objects, this is
because composer.json
is a json file. In normal javascript you would do something
like:
var obj = {nothing: "hello"};
This is where you can find all the packages for composer you'll ever need.
https://packagist.org/
Create your composer.json file, and require include those two packages. If you are stuck look at the packagist home page.
In terminal run (If you get errors, try to see whats wrong with your JSON file)
$ composer update
You are going to have to include the /vendor/autoload.php
file somewhere, I would
ask Dan or Matt the best place to put it.
Now go to one of your controllers and see if the dependency is actually included and autoloading by creating the swift mailer object with something from their example code:
Swift_Message::newInstance('Test');
Reload your browser page where you put this in a controller, and if you get an error, it is not correct. It won't do anything, you just shouldn't get any errors.