codeigniter

Caddy rewrite and CodeIgniter

Caddy it’s a new kid in the block in category super light web servers. Personally – I love it. Same love I feel to CodeIgniter . To marge both of them, we need only basic rewrite rule to drop into caddyfile. api.spidersoft.com.au { root /var/www/html/spidersoft.com.au gzip rewrite { to {path} {path}/ /index.php?/{uri} } fastcgi / /var/run/php-sock php }

PhpStorm PHPCodeSniffer and… CodeIgniter style guide

This article is related to my previous one about setting up PHPCodeSniffer with CodeIgniter coding standards. Installation on Linux boxes is pretty yeasy: sudo pear channel-update pear.php.net yum install php-pear-PHP-CodeSniffer php-phpunit-phpcpd On Mac OS X you have couple options. Pear or Homebrew: brew install php-code-sniffer And following that, on regular boxes CodeSniffer will be here: /usr/share/pear/PHP/CodeSniffer/Standards on Mac OS CodeSniffer will be located here: /usr/lib/php/pear/PHP/CodeSniffer/Standards or… /usr/local/Cellar/php-code-sniffer/1.5.6/CodeSniffer/Standards CodeIgniter standard can be downloaded from this location https://github.
PHPUnit and CodeIgniter 3.0

PHPUnit and CodeIgniter 3.0

Quick tutorial how to setup proper unit testing with PHPUnit and CodeIgniter 3.0. We need couple elements CodeIgniter – we are working with version 3.0rc3 PHPUnit – latest one If you don’t have phpunit installed globally, you can go with composer, just add section to your composer.json { "require-dev": { "phpunit/phpunit": "4.1.*" } } and then composer.phar install and after while we have ./vendor/bin/phpunit working phpunit.
CodeIgniter-minify update

CodeIgniter-minify update

Just introduce some new options to my quite popular library CodeIgniter-minify . From now one you can chose CSS compression engine (cssmin || minify), also FORCE rewrite CSS files. Some speed improvements were also made. Please feel to checkout library on GitGub – CodeIgniter-minify
CodeIgniter img update

CodeIgniter img update

It’s been a while since my library CodeIgniter img was updated. Purpose of this library is pretty clear – to scale images on the fly using CodeIgniter. It’s very useful in all kinds of website and CMS-like projects. All you need to do, is just load library and inside view use it like that

$this->img->rimg('path/to/image.jpg', array('width' => 100, 'height' => 200, 'alt'='my awesome image'));

First time when script hits image, will create thumbnail. Next time, website will get already scaled image. If you need change dimensions, just change it within view – don’t worry about recreating images.