Great way to integrate SwiftMailer and Kohana 3

Just found this post:

http://www.flynsarmy.com/2010/06/integrating-swift-mailer-into-kohana-3/

by Flynsarmy

showing the simplest way to integrate SwiftMailer and Kohana 3

Create the following files/folders:
/modules/swiftmailer
/modules/swiftmailer/init.php
/modules/swiftmailer/classes

Inside /modules/swiftmailer/classes/ drop the official latest build of Swift Mailer.

Enter the following into init.php.

<?php
require Kohana::find_file('classes', 'Swift-4.0.6/lib/swift_required');

There. Wasn’t that easy? Remember to enable the module by adding it to your bootstrap.php file!

NGINX with Kohana 3.x friendly URLs

I really enjoy working with Kohana and since I got a server from one of the hosting companies listed at LowEndBox, I decided to ditch Apache and go with Nginx, thing is… I also like pretty URLs 🙂

As a backup from the comment located here: http://forum.kohanaframework.org/discussion/comment/11553/#Comment_11553

I’m copying and pasting it in my blog for easier reference, plus it’s modified to fit my servers configuration:

location / {
    index    index.php index.html;

    if (!-e $request_filename) {
        rewrite ^/(.*)$ /index.php/$1 last;
    }

    include  /home/httpd/domains/example.com/htaccess;
}

location ~ .php$ {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /home/httpd/domains/example.com/html$fastcgi_script_name;

    include /etc/nginx/fastcgi_params;
}

# kohana
set  $path_info "";
location /index.php {
    if ($uri ~ "^/index.php(/.+)$") {
        set  $path_info  $1;
    }
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /home/httpd/domains/example.com/html/index.php;

    fastcgi_param  PATH_INFO $path_info;
    include /etc/nginx/fastcgi_params;
}
  • IGlr