Create a VirtualHost via PHP CLI script
Usage
# sudo ./sitegen/cli ${siteName} ${webRoot}
sudo ./sitegen/cli mywebsitename.local /var/www
Magento uses an active record pattern strategy for persistence. In this system, the model object contains a resource model that maps an object to one or more database rows. A resource model is responsible for performing functions such as:
Executing all CRUD (create, read, update, delete) requests. The resource model contains the SQL code for completing these requests.
Performing additional business logic. For example, a resource model could perform data validation, start processes before or after data is saved, or perform other database operations.
If you expect to return multiple items from a database query, then you would implement a special type of resource model known as a collection. A collection is a class that loads multiple models into an array-like structure based on a set of rules. This is similar to a SQL WHERE clause.
| # Makefile for Sphinx documentation | |
| # | |
| # You can set these variables from the command line. | |
| SPHINXOPTS = | |
| SPHINXBUILD = sphinx-build | |
| PAPER = | |
| BUILDDIR = build | |
| # User-friendly check for sphinx-build |
| @see https://stackoverflow.com/questions/5156679/transform-mysql-update-statements-to-insert-statements | |
| @see https://regex101.com/r/LkyFq4/1 |
| // | |
| // Revealing pattern | |
| // | |
| var basketModule = (function() { | |
| var basket = []; //private | |
| return { //exposed to public | |
| addItem: function(values) { | |
| basket.push(values); | |
| }, | |
| getItemCount: function() { |
| // Takes a URL, param name, and data string | |
| // Sends to the server.. The server can respond with binary data to download | |
| jQuery.download = function(url, key, data){ | |
| // Build a form | |
| var form = $('<form></form>').attr('action', url).attr('method', 'post'); | |
| // Add the one key/value | |
| form.append($("<input></input>").attr('type', 'hidden').attr('name', key).attr('value', data)); | |
| //send request | |
| form.appendTo('body').submit().remove(); |
| <?php | |
| /** | |
| * In these examples: | |
| * - The Controller needs a view renderer | |
| * - The view renderer needs a Database and a Logger | |
| * | |
| * Note, that the interfaces aren't being defined here, just assume they're what you'd expect. | |
| */ | |
| interface DatabaseInterface |
| <?php | |
| if ( ! function_exists('show_logged_in_content')) { | |
| /** | |
| * Display text to logged in Donation users only | |
| * | |
| * <code> | |
| * [loggedin]This content will only be displayed to logged in users.[/loggedin] | |
| * </code> | |
| * |
| sudo add-apt-repository ppa:ondrej/php | |
| sudo apt-get update | |
| sudo apt-get install php5.6 php5.6-bcmath php5.6-bz2 php5.6-dba php5.6-imagick php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-soap php5.6-xml php5.6-zip | |
| sudo a2dismod php5 | |
| sudo a2enmod php5.6 | |
| sudo service apache2 restart |