Posts

Showing posts from May, 2016

Redis: The Basics

Image
What is Redis ? - Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker - Remote Dictionary Server Installation For Mac OS X: 1. Install XCode Developer Tools 2. Download the stable release on Redis official site: http://redis.io/download 3. Run the ff. command: wget http://download.redis.io/releases/redis-3.2.0.tar.gz tar xzf redis-3.2.0.tar.gz cd redis-3.2.0 # install and run globally (/usr/local/bin) make install redis-server # install and run locally make cd src && ./redis-server # install on another location make install /opt/local/bin For Ubuntu: 1. Run the ff. command: sudo apt-get install redis-server # run redis-server Data Types List: - collection of string elements, sorted according to the order of insertion. ex. 8, 9, 1, 2, 3 - implemented using a linked list, not using an array - insertion of new elements to head or tail is at constant time regardless of the length of the list ...

PHPUnit: Basics of Unit Testing

Image
What is Unit Testing ? Unit Testing is a software testing method by which individual units of code are tested to determine if they are fit to use. Benefits of Unit Testing - find problems early - facilitates changes - simplifies integration - documentation - design interface What is PHPUnit? - xUnit-style library by Sebastian Bergmann - Installable via Composer, PEAR and Phar - well integrated and well documented reference: http://phpunit.de/manual/current/en/index.html Installation (globally via Phar) wget https://phar.phpunit.de/phpunit.phar chmod +x phpunit.phar mv phpunit.phar /usr/bin/phpunit source: http://phpunit.de/manual/current/en/installation.html Installation (as vendor via Composer) Create a composer.json file in the root directory then add the ff.: { "require-dev" : { "phpunit/phpunit" : "4.8.0" }, "autoload" : { "psr-4" : { "Project\\" : "app...

Install Symfony on Vagrant Environment

Image
Vagrant is a tool for building and managing virtual machine environments. Assuming you have already installed and  vagrant up your virtual environment. Execute the following instructions on your terminal console. Download symfony installer sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony sudo chmod a+x /usr/local/bin/symfony Create project directory symfony new my_project Then, you can: * Change your current directory to /vagrant/my_project * Configure your application in app/config/parameters.yml file. * Run your application: 1. Execute the php bin/console server:run command. 2. Browse to the http://localhost:8000 URL. * Read the documentation at http://symfony.com/doc Running #1, should produce result similar to this: php bin/console server:run [OK] Server running on http://127.0.0.1:8000 // Quit the server with CONTROL-C. If you have private network map set in Vagrantfile then do not use server:run as it only listens to http...