Caddy
is a another alternative to
Apache
or
nginx
. For me the biggest advantage is that it’s only one binary file to work with. It’s easy to run, setup and just “works”. It’s super modern – handles HTTP2 and automatic HTTPS encryption using let’s encrypt certificates. Obviously it has plenty of other features but we focus only on speed of deployment.
From many reasons I was always using
SQL_CALC_FOUND_ROWS
to get total number of records, when I was running limited query. Never especially thought about it, until i had some super performance issues with one of my projects. Obviously after quick profiling and googling i found
people complaining about FOUND_ROWS() low performance
. I was not aware how big impact it was until I tested.
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.
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.
let’s create phpunit.xml.dist
next step will require create separate bootstrap file for PHPUnit.