Composer is a dependency management tool for your PHP projects.
-
Install PHP5 CLI
$ sudo apt-get install php5-cli -
Get the Composer installer
| <?php | |
| /** | |
| * Returns response in CSV format | |
| * | |
| * Call this class from Controller as below | |
| * return Response::csv($data, $filename); | |
| */ | |
| Response::macro('csv', function($data, $filename = 'data.csv', $status = 200, $delimiter = ",", $linebreak = "\n", $headers = array()) | |
| { |
Be sure to have VirtualBox Setup and LEMP Stack installed on it before proceeding. Also ensure your guest (VirtualBox) have access to host's (your computer) Shared folder (You can find the instructions on VirtualBox Setup Guide.
Having a Shared Folder will allow your guest (the VirtualBox) access to any folders on your host. A simple use case is to allow your local development folder access to guest. Simply change the files on this folder to update your web app. This step is optional but is highly encouraged.
LEMP is the new LAMP. If you were an Apache user like most of us, simply follow this guide to easily deploy and learn develop to develop on Nginx.
Be sure that you are already running Linux be it Ubuntu, CentOS or RHEL. However, this guide will demonstrate installation guide for Ubuntu Server 14.04 LTS.
A VirtualBox is the best way to allow for local development for your web projects. Easily mimic an exact replica of your actual physical remote servers (or that of any cloud hosting providers) and test out your development frameworks before pushing it to your production or staging environments.
Warning: This guide is only meant to serve local installation of a virtual machine and not meant for 'live' or remote actual servers.
Fetch places of interest within $dist (radial distance) of $fLat (latitude) and $fLon (longitude) using Haversine formula.
SELECT name,
ACOS( SIN( RADIANS( `lat` ) ) * SIN( RADIANS( $fLat ) ) + COS( RADIANS( `lat` ) )
* COS( RADIANS( $fLat )) * COS( RADIANS( `lon` ) - RADIANS( $fLon )) ) * 6380 AS `distance`
FROM `places_of_interests`
WHERE