Skip to content

Commit

Permalink
make it includeable with composer
Browse files Browse the repository at this point in the history
  • Loading branch information
Puskás Zsolt committed Apr 18, 2018
1 parent 280e51f commit ffcdf8f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
/vendor/*

!.gitkeep
/vendor/
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
Kohana Email module
===================

Kohana 3.3 email module using SwiftMailer or PHPMailer
Kohana 3.3 and Koseven compatible email module using SwiftMailer or PHPMailer.

## How to install
Before using the email module, we must enable it first on `APPPATH/bootstrap.php`:

### Vendor module method
1. Add it in your projects composer.json.
```json
"svenbw/kohana-email": "^1.0"
```
2. Fetch dependencies.
```
composer update
```
3. Enable vendor autoload in `APPPATH/bootstrap.php` if not already:
```php
require DOCROOT.'/vendor/autoload.php';
```
4. In the same file include it in your modules list:
```php
Kohana::modules(array(
...
'email' => DOCROOT.'/vendor/svenbw/kohana-email',
...
));
```

### Direct download method
1. Download to modules directory.
2. Fetch dependencies.
```
composer install
```
3. Include it in `APPPATH/bootstrap.php` modules list:
```php
Kohana::modules(array(
...
Expand Down Expand Up @@ -36,4 +65,3 @@ $mailer
->html('<i>Test email body</i>')
->send();
```

6 changes: 4 additions & 2 deletions init.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

// Load mailers trough composer autoload
require_once Kohana::find_file('vendor', 'autoload');
if (is_file('vendor/autoload.php'))
{
require_once 'vendor/autoload.php';
}
1 change: 0 additions & 1 deletion vendor/.gitkeep

This file was deleted.

0 comments on commit ffcdf8f

Please sign in to comment.