[
  {
    "path": ".gitignore",
    "content": "/_site/\n*.DS_Store\nnode_modules\nvendor\n.bundle\n"
  },
  {
    "path": ".ruby-version",
    "content": "2.7.8\n"
  },
  {
    "path": "CNAME",
    "content": "phptherightway.com"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to PHP The Right Way\n\nEnjoy [PHP The Right Way](https://phptherightway.com) and want to get\ninvolved? Great! There are plenty of ways you can help out.\n\nPlease take a moment to review this document in order to make the contribution\nprocess easy and effective for everyone involved.\n\nFollowing these guidelines helps to communicate that you respect the time of\nthe developers managing and developing this open source project. In return,\nthey should reciprocate that respect in addressing your issue or assessing\npatches and features.\n\n\n## Using the issue tracker\n\nThe [issue tracker](https://github.com/codeguy/php-the-right-way/issues) is\nthe preferred channel for changes: spelling mistakes, wording changes, new\ncontent and generally [submitting pull requests](#pull-requests), but please\nrespect the following restrictions:\n\n* Please **do not** use the issue tracker for personal support requests (use\n  [Stack Overflow](https://stackoverflow.com/questions/tagged/php) or IRC).\n\n* Please **do not** derail or troll issues. Keep the discussion on topic and\n  respect the opinions of others.\n\n\n<a name=\"pull-requests\"></a>\n## Pull Requests\n\nPull requests are a great way to add new content to PHP The Right Way, as well\nas updating any browser issues or other style changes. Pretty much any sort of\nchange is accepted if seen as constructive.\n\nAdhering to the following process is the best way to get your work\nincluded in the project:\n\n1. [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the\n   project, clone your fork, and configure the remotes:\n\n   ```bash\n   # Clone your fork of the repo into the current directory\n   git clone https://github.com/<your-username>/php-the-right-way.git\n   # Navigate to the newly cloned directory\n   cd php-the-right-way\n   # Assign the original repo to a remote called \"upstream\"\n   git remote add upstream https://github.com/codeguy/php-the-right-way.git\n   ```\n\n2. If you cloned a while ago, get the latest changes from upstream:\n\n   ```bash\n   git checkout gh-pages\n   git pull upstream gh-pages\n   ```\n\n3. Create a new topic branch (off the main project development branch) to\n   contain your change or fix:\n\n   ```bash\n   git checkout -b <topic-branch-name>\n   ```\n\n4. Install the [Jekyll](https://github.com/jekyll/jekyll/) gem and dependencies to preview locally:\n\n    ```bash\n    # Install the needed gems through Bundler\n    bundle install --path vendor/bundle\n    # Run the local server\n    bundle exec jekyll serve\n    ```\n\n5. Commit your changes in logical chunks. Please adhere to these [git commit\n   message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)\n   or your content is unlikely be merged into the main project. Use Git's\n   [interactive rebase](https://docs.github.com/en/get-started/using-git/about-git-rebase)\n   feature to tidy up your commits before making them public.\n\n6. Locally merge (or rebase) the upstream development branch into your topic branch:\n\n   ```bash\n   git pull [--rebase] upstream gh-pages\n   ```\n\n7. Push your topic branch up to your fork:\n\n   ```bash\n   git push origin <topic-branch-name>\n   ```\n\n8. [Open a Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)\n    with a clear title and description.\n\n\n## Contribution Agreement and Usage\n\nBy submitting a pull request to this repository, you agree to allow the project\nowners to license your work under the the terms of the [Creative Commons Attribution-NonCommercial-ShareAlike\n3.0 Unported License](https://creativecommons.org/licenses/by-nc-sa/3.0/).\n\nThe same content and license will be used for all PHP The Right Way publications,\nincluding - but not limited to:\n\n* [phptherightway.com](https://phptherightway.com)\n* Translations of phptherightway.com\n* [LeanPub: PHP The Right Way](https://leanpub.com/phptherightway/)\n* Translations of \"LeanPub: PHP The Right Way\"\n\nAll content is completely free now, and always will be.\n\n## Contributor Style Guide\n\n1. Use American English spelling (*primary English repo only*)\n2. Use four (4) spaces to indent text; do not use tabs\n3. Wrap all text to 120 characters\n4. Code samples should adhere to PSR-1 or higher\n5. Use [GitHub Flavored Markdown](https://github.github.com/gfm/) for all content\n6. Use language agnostic urls when referring to external websites such as the [php.net](https://www.php.net/urlhowto.php) manual\n"
  },
  {
    "path": "Gemfile",
    "content": "source 'https://rubygems.org'\ngem 'github-pages', group: :jekyll_plugins\ngem 'rouge'\n"
  },
  {
    "path": "Gruntfile.js",
    "content": "module.exports = function(grunt) {\n    // Project configuration\n    grunt.initConfig({\n        pkg: grunt.file.readJSON('package.json'),\n        less: {\n            dist: {\n                options: {\n                    cleancss: true,\n                    compress: true,\n                    ieCompat: true\n                },\n                files: {\n                    \"css/all.css\": \"less/all.less\"\n                }\n            }\n        },\n        postcss: {\n            options: {\n                map: true,\n                processors: [\n                    require('autoprefixer')({\n                        browsers: ['last 2 versions', 'ie 9']\n                    })\n                ]\n            },\n            dist: {\n                src: 'css/all.css'\n            }\n        },\n        watch: {\n            less: {\n                files: ['less/**/*.less'],\n                tasks: ['less:dist', 'postcss:dist'],\n                options: {\n                    spawn: false\n                }\n            }\n        }\n    });\n\n    // Load plugins\n    grunt.loadNpmTasks('grunt-contrib-less');\n    grunt.loadNpmTasks('grunt-contrib-watch');\n    grunt.loadNpmTasks('grunt-postcss');\n\n    // Default task(s)\n    grunt.registerTask('default', ['less', 'postcss:dist']);\n};\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2025 Josh Lockhart\n\nhttps://creativecommons.org/licenses/by-nc-sa/3.0/\n"
  },
  {
    "path": "README.md",
    "content": "# PHP: The Right Way\n\n## Overview\n\nThis is the GitHub Pages repository for the _PHP: The Right Way_ project.\n\n* This website is a Jekyll project.\n* Each section and sub-section are a Markdown file in `_posts/`.\n* Sub-sections have `isChild: true` in their front matter.\n* The navigation and page structure are automatically generated.\n\n## Spread the Word!\n\n_PHP: The Right Way_ has web banner images you can use on your website. Show your support, and let new PHP\ndevelopers know where to find good information!\n\n[See Banner Images](https://www.phptherightway.com/banners.html)\n\n## How to Contribute\n\nYou should read the `CONTRIBUTING.md` file for precise instructions and tips. But, if you prefer a TL;DR:\n\n1. Fork and edit\n2. Optionally install [Ruby](https://rvm.io/rvm/install/) with [Jekyll](https://github.com/mojombo/jekyll/) gem to preview locally\n3. Submit pull request for consideration\n\n### Contributor Style Guide\n\n1. Use American English spelling (*primary English repo only*).\n2. Use four (4) spaces to indent text; do not use tabs.\n3. Wrap all text to 120 characters.\n4. Code samples should adhere to PSR-1 or higher.\n\n## Where\n\n<https://www.phptherightway.com>\n\n* [English](https://www.phptherightway.com)\n* [Español](https://phpdevenezuela.github.io/php-the-right-way)\n* [Français](https://eilgin.github.io/php-the-right-way/)\n* [Indonesia](https://id.phptherightway.com)\n* [Italiano](https://it.phptherightway.com)\n* [Polski](https://pl.phptherightway.com)\n* [Português do Brasil](https://br.phptherightway.com)\n* [Română](https://bgui.github.io/php-the-right-way/)\n* [Slovenščina](https://sl.phptherightway.com)\n* [Srpski](https://phpsrbija.github.io/php-the-right-way/)\n* [Türkçe](https://hkulekci.github.io/php-the-right-way/)\n* [български](https://bg.phptherightway.com)\n* [Русский язык](https://getjump.github.io/ru-php-the-right-way)\n* [Українська](https://iflista.github.io/php-the-right-way/)\n* [العربية](https://adaroobi.github.io/php-the-right-way/)\n* [فارسى](https://novid.github.io/php-the-right-way/)\n* [ภาษาไทย](https://apzentral.github.io/php-the-right-way/)\n* [한국어판](https://modernpug.github.io/php-the-right-way)\n* [日本語](https://ja.phptherightway.com)\n* [简体中文](https://laravel-china.github.io/php-the-right-way/)\n* [繁體中文](https://laravel-taiwan.github.io/php-the-right-way)\n\n### Translations\n\nIf you are interested in translating _PHP: The Right Way_, fork this repo on GitHub and publish your localized fork to your own GitHub Pages account. We'll link to your translation from the primary document.\n\nTo avoid fragmentation and reader confusion, please choose one of these options:\n\n1. We link to your GitHub Pages fork with `[username].github.io/php-the-right-way`\n2. We link to your GitHub Pages fork with a subdomain (e.g. \"ru.phptherightway.com\")\n\nIf you use a subdomain, enter the subdomain into the `CNAME` file, and ask us to setup DNS for you. If you do not use a subdomain, remove the `CNAME` file entirely else your fork will not build when pushed.\n\nAdd information about your translation in the [wiki page](https://github.com/codeguy/php-the-right-way/wiki/Translations).\n\nWhen your translation is ready, open an issue on the Issue Tracker to let us know.\n\n## Why\n\nThere's been a lot of discussion lately about how the PHP community lacks sufficient, credible information for programmers new to PHP. This repository aims to solve this problem.\n\n## Who\n\nMy name is [Josh Lockhart](https://x.com/codeguy). I'm the author of the [Slim Framework](https://www.slimframework.com/), and I work for [New Media Campaigns](https://www.newmediacampaigns.com/).\n\n### Collaborators\n\n* [Kris Jordan](https://krisjordan.com/)\n* [Phil Sturgeon](https://phil.tech/)\n\n## License\n\n[Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License](https://creativecommons.org/licenses/by-nc-sa/3.0/)\n"
  },
  {
    "path": "_config.yml",
    "content": "baseurl: /\nhighlighter: rouge\nmarkdown: kramdown\npermalink: date\nmaruku:\n    use_tex:    false\n    use_divs:   false\n    png_engine: blahtex\n    png_dir:    images/latex\n    png_url:    /images/latex\n\nplugins:\n    - jekyll-sitemap\n\ndefaults:\n    -\n      scope:\n          path: \"\"\n      values:\n          sitemap: false\n          image:\n            path: /images/og-image.png\n            width: 1024\n            height: 640\n            alt: \"PHP: The Right Way\"\n\n# Excludes should be appended to the default\n# https://github.com/jekyll/jekyll/blob/master/lib/site_template/_config.yml#L37-L55\nexclude:\n   - .sass-cache/\n   - .jekyll-cache/\n   - gemfiles/\n   - Gemfile\n   - Gemfile.lock\n   - Gruntfile.js\n   - node_modules/\n   - package.json\n   - vendor/bundle/\n   - vendor/cache/\n   - vendor/gems/\n   - vendor/ruby/\n   - CNAME\n   - CONTRIBUTING.md\n   - LICENSE\n   - README.md\n   - pages/example.md\n\nfuture: true\n\ntitle: \"PHP: The Right Way\"\ntagline: Reference for PHP best practices\ndescription: An easy-to-read, quick reference for PHP best practices, accepted coding standards, and links to authoritative PHP tutorials around the Web\nlogo: /images/og-image.png\n"
  },
  {
    "path": "_includes/welcome.md",
    "content": "# Welcome\n\nThere's a lot of outdated information on the Web that leads new PHP users astray,\npropagating bad practices and insecure code. _PHP: The Right Way_ is an easy-to-read,\nquick reference for PHP popular coding standards, links to authoritative tutorials\naround the Web, and what the contributors consider to be best practices at present.\n\n_There is no canonical way to use PHP_. This website aims to introduce new PHP\ndevelopers to some topics which they may not discover until it is too late, and aims\nto give seasoned pros some fresh ideas on those topics they've been doing for years\nwithout ever reconsidering. This website will also not tell you which tools to use, but\ninstead offer suggestions for multiple options, when possible explaining the differences\nin approach and use-case.\n\nThis is a living document and will continue to be updated with more helpful information\nand examples as they become available.\n\n## Translations\n\n_PHP: The Right Way_ is translated into many different languages:\n\n* [English](https://www.phptherightway.com)\n* [Español](https://phpdevenezuela.github.io/php-the-right-way)\n* [Français](https://eilgin.github.io/php-the-right-way/)\n* [Indonesia](https://id.phptherightway.com)\n* [Italiano](https://it.phptherightway.com)\n* [Polski](https://pl.phptherightway.com)\n* [Português do Brasil](https://br.phptherightway.com)\n* [Română](https://bgui.github.io/php-the-right-way/)\n* [Slovenščina](https://sl.phptherightway.com)\n* [Srpski](https://phpsrbija.github.io/php-the-right-way/)\n* [Türkçe](https://hkulekci.github.io/php-the-right-way/)\n* [български](https://bg.phptherightway.com)\n* [Русский язык](https://getjump.github.io/ru-php-the-right-way)\n* [Українська](https://iflista.github.io/php-the-right-way/)\n* [العربية](https://adaroobi.github.io/php-the-right-way/)\n* [فارسى](https://novid.github.io/php-the-right-way/)\n* [ภาษาไทย](https://apzentral.github.io/php-the-right-way/)\n* [한국어판](https://modernpug.github.io/php-the-right-way)\n* [日本語](https://ja.phptherightway.com)\n* [简体中文](https://laravel-china.github.io/php-the-right-way/)\n* [繁體中文](https://laravel-taiwan.github.io/php-the-right-way)\n\n## Book\n\nThe most recent version of _PHP: The Right Way_ is also available in PDF, EPUB and MOBI formats. [Go to Leanpub][1]\n\n## How to Contribute\n\nHelp make this website the best resource for new PHP programmers! [Contribute on GitHub][2]\n\n[1]: https://leanpub.com/phptherightway\n[2]: https://github.com/codeguy/php-the-right-way/tree/gh-pages\n"
  },
  {
    "path": "_layouts/default.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n    <head>\n        <meta charset=\"utf-8\"/>\n\n        {% seo %}\n\n        <meta name=\"robots\" content=\"index,follow,archive\"/>\n\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\"/>\n        <link rel=\"icon\" href=\"{{ site.baseurl }}images/favicon.png\" type=\"image/png\"/>\n        <link rel=\"stylesheet\" href=\"{{ site.baseurl }}styles/syntax.css\">\n        <style>\n        *{box-sizing:border-box}body{font-size:24px;line-height:32px;text-rendering:optimizeLegibility;word-wrap:break-word}h1,h2,h3,h4{font-family:georgia,serif}h1,.alpha{position:relative;font-size:48px;font-weight:normal;line-height:50px;text-align:center}h2,.beta{font-size:32px;font-weight:normal;line-height:36px}h3,.gamma{font-size:24px;font-weight:bold;line-height:30px}blockquote{border-left:3px solid #ccc;padding-left:20px;color:#777;font-style:italic;word-wrap:break-word}a{color:#4f5b93}a:hover{color:#8892bf}.back-to-top{text-align:center}.back-to-top a{background:#4f5b93;border-radius:3px;display:inline-block;height:40px;padding:0 20px;transition:all .1s ease;color:white;font-family:verdana,sans-serif;font-size:13px;line-height:40px;text-decoration:none;text-transform:uppercase}.back-to-top a:hover{background:#8892bf}img{max-width:100%}pre,code{color:#444;font-family:\"Source Code Pro\",Consolas,\"Andale Mono WT\",\"Andale Mono\",\"Lucida Console\",\"Lucida Sans Typewriter\",\"DejaVu Sans Mono\",\"Bitstream Vera Sans Mono\",\"Liberation Mono\",\"Nimbus Mono L\",Monaco,\"Courier New\",Courier,monospace;font-size:90%}a pre,a code{color:inherit}pre{background:#f7f7f7;border:1px solid #eee;border-radius:3px;display:block;overflow:auto;padding:20px;width:100%}@media (max-width:767px){body{font-size:18px;line-height:24px}h1,.alpha{font-size:36px;line-height:38px}h2,.beta{font-size:24px;line-height:28px}h3,.gamma{font-size:18px;line-height:23px}blockquote{margin-left:0}ul,ol{padding-left:1em}pre{padding:5px 10px}}@media (max-width:360px){body{font-size:16px;line-height:21px}h1,.alpha{font-size:28px;line-height:30px}h2,.beta{font-size:20px;line-height:23px}h3,.gamma{font-size:16px;line-height:20px}}.site-header{padding-top:40px;margin-bottom:40px;text-align:center}.site-header h1{margin:0;font-size:72px;line-height:60px}.site-header h1 em{display:block;font-size:34px;font-style:normal}.site-header h1 a{color:#333;text-decoration:none}.site-header h1 a:hover{color:#8892bf}.site-header .build-date{margin-bottom:10px;color:#999;font-family:verdana,sans-serif;font-size:11px;text-transform:uppercase}.site-header .btn-share{background:#8892bf;border-radius:3px;display:inline-block;height:30px;padding:0 20px;vertical-align:baseline;color:white;font-family:verdana,sans-serif;font-size:12px;line-height:30px;text-decoration:none;text-transform:uppercase}.site-header .fork-me{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJUAAACVCAMAAABmfEh9AAAAMFBMVEXr6+wSFiH////U1NT09PSRk5hucHb5+flMT1f8/Py+v8EtMDpXWWE8P0hgY2rg4OD5mIG8AAAFoElEQVR4AbSb0W4sKQxEyxfMdAyG///b1bCt3MSZ1CKth4coj0fVVp0GevDnc318POqj9cvlv1efl9taC6j18fj4+JO7AlWtrY9LDtblboVg5VKh9XkdpTUIVjIVsJqcPUSSVi7VowJ4pjWOHuKViUWodljlcOR9XN1KCVhpVOERPrHGOBz5gJVJFcN6Yp2NfHiIiVQxrI0l1xFWXlqE6vMZltOCGCGtbKqIdVgQI6SVRMXS6m9teUJFsI6dGNLKpgpYMg5Hvoe0cqhCPzz4yGemRagSRj6klUsV0zp2Ykgrg+r/j7zPK6SVSxXTmr/Lp2miEwMVTYs5cQKa5URCFdPiI9+AAg0FEdJKpootP14l1cTQ8p0YqXhaEcpEuvbvqg5ppVPF2RrfoSoKNMeJnIr31vDvM9XE4Ektz6m4E/3zaTn2PE1pLdmJnIo78aa5FuryKJ8R08qm4k70hTaXSsSKs5VNxZ24a6GsN+x8OBV34jIRhYpHJ8aWT6WKacXXwFKGYokv28l9gYstn00V0/IvWL4A8/1XxKD8aCSTird8G3vk1bpVFeFOzKTiTtxQEpLaKzoxmYqPfMG8oXps+ejEZKqANfu4PhF8Q1UsLOdOTKfiThSDVW3TU5zIqc5bXh+q6In7RE5F0vIvI9+bmEUi7sQ8KpJWh95TluFETnXuxG5+14RmOJFTnRdEv6FQWsZpIKc6d+INpYYZsKITk6m4E0W8YEqrZZ6nlURFnNgXpvhaBRqxRkgrnYqcnbYmvjAES4Q7MZkqphWceD3jumrIijgxj4qcQTTsuLy3IdyJqVQxrYjl9wYDsAMnplLFtOLID0AHDvaJyVSk5duUAisN7acTQ1r5VMSJAu2G1eUFVkgrnYq8NK/SxebBDVk+FXHiRPGzG7J8KuLEoXc07YpYwYnZVAc3ZApUPbghS6EiTgxQNhR+cEOWTMVuyC5Yl4kmMcL4dppPRZzY6i76rhi85fOpyA1Zg46FpoBFKYaWz6cip4EK1KbV2kKPaY2QVjYVaXlvXauJtHodODGXijhRGqyLFHSJKzoxn4rtqkVkHyHF5cGJyVQxrXhd0A2fTa+DOzFSJaYVjkZ03VAGANq5EyNVXlrhq5F2Q6HoMH5DFqmS0/IfTrRqz5isMCfmU3EnNvyLMyd1Yj4Vc6Ksv5WlSpyYT8X2ibC//xbixHwq4kSpRaQXF3Fpkzoxn4o4cZkCTSZUuBPzqUjL68KGWq6m3In5VMSJNqVhecMWkDpxYjYV2fn4TkqswrooCndipMpMa351omN5N+hU0ScfcWI6FTmxmS62rXhDOXFiOhVp+WvZhsK+ZVn+qxPzqchm31FcFGvtAVv+uxPzqUha0/bj87UsjFb4aiSfijqx7Ygc4Ddk+VTciebPP4CJk31iPhV34iara+5p/7Xl86m4E3dSu7mM/LogUr3fid3Wbq4u+55T24u03kZFnOjSlu3jNxGF/fx1wduo+FcjBbK9+ITq8tOJ76LiX1Jabe2GelUQ76QiTuyGuqFg80VBvJeKONE21KsTm+G9vJWKOFE21OeJTTgaeTMVSasBl0jI6nYip8qfrW9O1AY0+bneTMW/GrEKqLxYPZ+KpBWPRmb7p307SEEoBoIoqBAlIOj9byt/9rUT3yaeoGhhGkmL/2VY9ZdOvBcqdGKtQifWKnRircILWa3CaiRX+cr3KndiqvIvn1TlJWWqcidaVV/5QIUl5baqTytXuROtKjqxVqETaxU6sVahE1uVNzaxCp0Yqny33jtVeUmZqnzlU5WvfKpyWqnKaaUqr0ZSlVcjqcqrkVqFTsxVeCFrVE7rM51oVZTWsLZVRVrjur5Eq4K0xnXtcaEKWbf1fEFVsca1HlBFrHEtvKWGrIFBlbHGheVA6ZoPVK2rV/18dX9UR3VUR3VUX8Uz94M6xyeLAAAAAElFTkSuQmCC);background-position:top right;background-repeat:no-repeat;background-size:contain;height:100px;width:100px;position:absolute;top:0;right:0;z-index:100;width:120px}.site-navigation,.site-content,.site-footer{margin:0 auto;max-width:840px;width:92%}.site-navigation{-webkit-columns:3;-moz-columns:3;columns:3;-webkit-column-gap:40px;-moz-column-gap:40px;column-gap:40px}.site-navigation input[type=\"checkbox\"],.site-navigation label{display:none}.site-navigation ul{list-style:none;margin:0;padding:0}.site-navigation ul li{margin-bottom:20px;font-size:22px;line-height:23px}.site-navigation ul li a{display:block;color:#444;font-weight:700;text-decoration:none}.site-navigation ul li a:hover{color:#8892bf}.site-navigation ul li ul{padding-top:8px}.site-navigation ul li li{margin-bottom:6px;font-size:18px}.site-navigation ul li li a{border:none;color:#777;font-weight:normal}.site-navigation li{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}@media (max-width:820px){.site-navigation{-webkit-columns:2;-moz-columns:2;columns:2}}@media (max-width:560px){.site-navigation{-webkit-columns:1;-moz-columns:1;columns:1}}@media (max-width:375px){.site-navigation{background:rgba(255,255,255,0.95);-webkit-columns:1;-moz-columns:1;columns:1;max-height:100vh;position:fixed;bottom:0;left:0;z-index:100}.site-navigation label{background:#4f5b93;box-sizing:border-box;display:block;height:40px;padding:0 10px;width:100vh;position:absolute;bottom:0;left:0;color:white;font-family:verdana,sans-serif;font-size:13px;line-height:40px;text-transform:uppercase;z-index:2}.site-navigation>ul{background:rgba(255,255,255,0.96);border-top:3px solid #8892bf;box-shadow:rgba(0,0,0,0.25) 0 -5px 10px;box-sizing:border-box;padding:20px;overflow:auto;-webkit-overflow-scrolling:touch;position:absolute;left:0;bottom:40px;height:50vh;width:100vh;-webkit-transform:translate(0, 100vh);-ms-transform:translate(0, 100vh);transform:translate(0, 100vh);transition:all .2s ease;z-index:1}.site-navigation input[type=\"checkbox\"]:checked~ul{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);transform:translate(0, 0)}}.site-content h1{padding-top:40px;position:relative}.site-content h1:after{border:1px solid #ddd;border-bottom:none;content:\"\";display:block;height:8px;position:absolute;left:0;top:0;width:100%}.site-content.chapters{counter-reset:chapter}.site-content.chapters h1{counter-increment:chapter;padding-top:60px}.site-content.chapters h1:before{display:inline-block;content:\"Chapter \" counter(chapter) \".\";position:absolute;top:30px;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);color:#999;font-size:12px;letter-spacing:1px;line-height:20px;text-transform:uppercase;text-align:center}.site-content #welcome ul{-webkit-columns:3;-moz-columns:3;columns:3;-webkit-column-gap:30px;-moz-column-gap:30px;column-gap:30px;list-style-position:inside}.site-content .back-to-top{margin-bottom:60px}@media (max-width:870px){.site-content #welcome ul{-webkit-columns:2;-moz-columns:2;columns:2}}@media (max-width:600px){.site-content #welcome ul{-webkit-columns:1;-moz-columns:1;columns:1}}.site-footer{border-top:1px solid #ccc;margin:60px auto 0 auto;padding:40px 20px;font-family:verdana,sans-serif;font-size:16px;text-align:center}.site-footer .cc-badge{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAABUFvrSAAAAw1BMVEX///8AAAAAAACrsar///8oKSjR1NAODg4jHyDLz8pAPz/f399wcHBQUFBgYGDJzcjEyMN5fHkwMDC9wry4vbeAgIDw8PDBxcDO0c3M0MyUmJPGysW6v7q/v7+fn5/T1tKvtK61urSxt7C/w76zuLKhpKDk5OSRk5F2c3RQUVAbGxuts6yEhoR9fnxDREMgICDW1dXJyMirq6qvr68wLS3Pz8+Rj4+Pj4+LioqEgYJaV1i6ubmbl5meoJ1dXl06NjcZGRmWw6QEAAAAAnRSTlMMANomgjQAAAMCSURBVHjatZYJc6JAEIWznWFmOAQDguAdjUqMd0yi5vz/v2q7GTmkNusWW3kxNfJkPts3TMPVFfyIfiH3ttHwRs1623F0PYp03XHa9ebI6zRu74aDwcPDdQUBXCG3440Qq4ec91GchzqhM/J1FSEYuVguYudLASixnBM6JVPJNxqgtJts2mWHwMh1Ij6dQabZlEeKfDccDlo4xbAsA6e11KzLDoG9EXHvqVbb73Z9m+q+r4dEppLHAmomQ5k1EMmsi44CY74JV/gBU+ohWqtjzSMMY6iBjR4AfQAaTVLO87HkTDabiXIUuNnWieuaLFPgYs1cb1PJC6itUzCrwQ2mCe4bcr9EPEkdOmcsUa+Jo8B1J5wiF8s9J0/DpGQNCt9ogkbladKwwZ/DNnNMtpGfdizlMzkKjAXPQDyxMwUCZqpkMOjYBrBpNADnGDESZDxZ5w4L3uQec5A7chTYCecAPiupBzDHkr0OWHQIKBotwqCzidGI17kTSKlhzFJOyFFgvgSBQXRrhuGr4QUnCFhyzOIbMDLinZTH18y523UTsJmBdS7ARiCQjEcg2fTjBdfrzc6foqCsemwtUUbqvI43jG2lxHMyMACW6MLK7K56Lrjm46qXZNGnkE+LB5AvHjlHudtBvF3MUqcn5eGgybd88aI+AP4KlbMaSF0ERwj2ocZKlxs5k8OXeA6KzkGirICcfwI3ChvEKm6Q/bHkbLbbtXLKUQRPKx+joCGPorGttKXzxTutWrZ41mnxGrdjDcC1LTdvOZcddbndg2DZ5fZoJANbqcuNGtygWttMdvTLtxsE+1uFXp9vafO7LV0ZTE3o/S9NqBqXwLDQ+QeSC23IVG1zDtVFYLD0s0Yf+ALgk0cL+F8wLCL+Ubo18agFqdT+oDeZo/7RL53EzsGUxnvpZtoqzDm9WO6o49JXKaMIpjRCPk1v/1Me6sUc0rZZcE5/BaXtpAQGd4Bozul5BbEDAwoqB6GcrOLcLFesZOw99Yjl7Ql7oeIUXjynBP4h/djT5m+nuF33PcPucwAAAABJRU5ErkJggg==);background-position:top left;background-repeat:no-repeat;background-size:contain;display:inline-block;height:31px;width:88px}.site-footer h2{font-size:24px;font-weight:bold;line-height:30px;margin-bottom:10px}.site-footer ul{list-style:none;margin:0 0 20px 0;padding:0}.site-footer .license{color:#777;font-size:13px}\n        </style>\n    </head>\n    <body>\n        <header class=\"site-header\">\n            <h1><a href=\"/\">PHP <em>The Right Way</em></a></h1>\n            <div class=\"build-date\">Last Updated: {{ site.time }}</div>\n            <div class=\"share\">\n                <a class=\"btn-share\" href=\"https://x.com/intent/tweet?text=PHP+The+Right+Way&amp;url=https%3A%2F%2Fwww.phptherightway.com&amp;hashtags=PHP\" target=\"_blank\">Share on X</a>\n            </div>\n            <a class=\"fork-me\" href=\"https://github.com/codeguy/php-the-right-way\" target=\"_blank\"></a>\n        </header>\n\n        <nav class=\"site-navigation\">\n            <input type=\"checkbox\" id=\"toggle\"/>\n            <label for=\"toggle\">Table of Contents</label>\n            <ul>\n                <li><a href=\"/#welcome\">Welcome</a>\n                    <ul>\n                        <li><a href=\"/#translations\">Translations</a></li>\n                        <li><a href=\"/#how-to-contribute\">How to Contribute</a></li>\n                    </ul>\n                </li>\n                {% assign lastIsChild = false %}\n                {% for post in site.posts reversed %}\n                    {% if post.isChild != true %}\n                        {% if insideSection %}\n                            </ul>\n                            </li>\n                            {% assign insideSection = false %}\n                        {% endif %}\n                    {% endif %}\n                    <li><a href=\"/#{{ post.anchor }}\">{{ post.title }}</a>\n                    {% if post.isChild %}\n                        </li>\n                    {% else %}\n                        <ul>\n                        {% assign insideSection = true %}\n                    {% endif %}\n                    {% assign lastIsChild = post.isChild %}\n                {% endfor %}\n                    </ul>\n                </li>\n                <li><a href=\"/#credits\">Credits</a></li>\n            </ul>\n        </nav>\n\n        <div class=\"site-content chapters\">\n            {{ content }}\n        </div>\n\n        <footer class=\"site-footer\" id=\"credits\">\n            <h2>Created and maintained by</h2>\n            <ul>\n                <li><a href=\"https://joshlockhart.com\" target=\"_blank\">Josh Lockhart</a></li>\n                <li><a href=\"https://philsturgeon.uk/\" target=\"_blank\">Phil Sturgeon</a></li>\n                <li><a href=\"https://github.com/codeguy/php-the-right-way/graphs/contributors\" target=\"_blank\">Project Contributors</a></li>\n            </ul>\n            <div class=\"license\">\n                <a class=\"cc-badge\" rel=\"license\" href=\"https://creativecommons.org/licenses/by-nc-sa/3.0/\"></a>\n                <br />\n                <span xmlns:dct=\"http://purl.org/dc/terms/\" href=\"http://purl.org/dc/dcmitype/Text\" property=\"dct:title\" rel=\"dct:type\">PHP: The Right Way</span> by <a xmlns:cc=\"http://creativecommons.org/ns#\" href=\"https://joshlockhart.com\" property=\"cc:attributionName\" rel=\"cc:attributionURL\">Josh Lockhart</a>\n                <br/>\n                is licensed under a <a rel=\"license\" href=\"https://creativecommons.org/licenses/by-nc-sa/3.0/\">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.<br />Based on a work at <a xmlns:dct=\"http://purl.org/dc/terms/\" href=\"https://www.phptherightway.com\" rel=\"dct:source\">www.phptherightway.com</a>.\n            </div>\n        </footer>\n    </body>\n</html>\n"
  },
  {
    "path": "_layouts/page.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n    <head>\n        <meta charset=\"utf-8\"/>\n\n        {% seo %}\n\n        <meta name=\"robots\" content=\"index,follow,archive\"/>\n\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\"/>\n        <link rel=\"icon\" href=\"{{ site.baseurl }}images/favicon.png\" type=\"image/png\"/>\n        <link rel=\"stylesheet\" href=\"{{ site.baseurl }}styles/syntax.css\">\n        <style>\n        *{box-sizing:border-box}body{font-size:24px;line-height:32px;text-rendering:optimizeLegibility;word-wrap:break-word}h1,h2,h3,h4{font-family:georgia,serif}h1,.alpha{position:relative;font-size:48px;font-weight:normal;line-height:50px;text-align:center}h2,.beta{font-size:32px;font-weight:normal;line-height:36px}h3,.gamma{font-size:24px;font-weight:bold;line-height:30px}blockquote{border-left:3px solid #ccc;padding-left:20px;color:#777;font-style:italic;word-wrap:break-word}a{color:#4f5b93}a:hover{color:#8892bf}.back-to-top{text-align:center}.back-to-top a{background:#4f5b93;border-radius:3px;display:inline-block;height:40px;padding:0 20px;transition:all .1s ease;color:white;font-family:verdana,sans-serif;font-size:13px;line-height:40px;text-decoration:none;text-transform:uppercase}.back-to-top a:hover{background:#8892bf}img{max-width:100%}pre,code{color:#444;font-family:\"Source Code Pro\",Consolas,\"Andale Mono WT\",\"Andale Mono\",\"Lucida Console\",\"Lucida Sans Typewriter\",\"DejaVu Sans Mono\",\"Bitstream Vera Sans Mono\",\"Liberation Mono\",\"Nimbus Mono L\",Monaco,\"Courier New\",Courier,monospace;font-size:90%}a pre,a code{color:inherit}pre{background:#f7f7f7;border:1px solid #eee;border-radius:3px;display:block;overflow:auto;padding:20px;width:100%}@media (max-width:767px){body{font-size:18px;line-height:24px}h1,.alpha{font-size:36px;line-height:38px}h2,.beta{font-size:24px;line-height:28px}h3,.gamma{font-size:18px;line-height:23px}blockquote{margin-left:0}ul,ol{padding-left:1em}pre{padding:5px 10px}}@media (max-width:360px){body{font-size:16px;line-height:21px}h1,.alpha{font-size:28px;line-height:30px}h2,.beta{font-size:20px;line-height:23px}h3,.gamma{font-size:16px;line-height:20px}}.site-header{padding-top:40px;margin-bottom:40px;text-align:center}.site-header h1{margin:0;font-size:72px;line-height:60px}.site-header h1 em{display:block;font-size:34px;font-style:normal}.site-header h1 a{color:#333;text-decoration:none}.site-header h1 a:hover{color:#8892bf}.site-header .build-date{margin-bottom:10px;color:#999;font-family:verdana,sans-serif;font-size:11px;text-transform:uppercase}.site-header .btn-share{background:#8892bf;border-radius:3px;display:inline-block;height:30px;padding:0 20px;vertical-align:baseline;color:white;font-family:verdana,sans-serif;font-size:12px;line-height:30px;text-decoration:none;text-transform:uppercase}.site-header .fork-me{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJUAAACVCAMAAABmfEh9AAAAMFBMVEXr6+wSFiH////U1NT09PSRk5hucHb5+flMT1f8/Py+v8EtMDpXWWE8P0hgY2rg4OD5mIG8AAAFoElEQVR4AbSb0W4sKQxEyxfMdAyG///b1bCt3MSZ1CKth4coj0fVVp0GevDnc318POqj9cvlv1efl9taC6j18fj4+JO7AlWtrY9LDtblboVg5VKh9XkdpTUIVjIVsJqcPUSSVi7VowJ4pjWOHuKViUWodljlcOR9XN1KCVhpVOERPrHGOBz5gJVJFcN6Yp2NfHiIiVQxrI0l1xFWXlqE6vMZltOCGCGtbKqIdVgQI6SVRMXS6m9teUJFsI6dGNLKpgpYMg5Hvoe0cqhCPzz4yGemRagSRj6klUsV0zp2Ykgrg+r/j7zPK6SVSxXTmr/Lp2miEwMVTYs5cQKa5URCFdPiI9+AAg0FEdJKpootP14l1cTQ8p0YqXhaEcpEuvbvqg5ppVPF2RrfoSoKNMeJnIr31vDvM9XE4Ektz6m4E/3zaTn2PE1pLdmJnIo78aa5FuryKJ8R08qm4k70hTaXSsSKs5VNxZ24a6GsN+x8OBV34jIRhYpHJ8aWT6WKacXXwFKGYokv28l9gYstn00V0/IvWL4A8/1XxKD8aCSTird8G3vk1bpVFeFOzKTiTtxQEpLaKzoxmYqPfMG8oXps+ejEZKqANfu4PhF8Q1UsLOdOTKfiThSDVW3TU5zIqc5bXh+q6In7RE5F0vIvI9+bmEUi7sQ8KpJWh95TluFETnXuxG5+14RmOJFTnRdEv6FQWsZpIKc6d+INpYYZsKITk6m4E0W8YEqrZZ6nlURFnNgXpvhaBRqxRkgrnYqcnbYmvjAES4Q7MZkqphWceD3jumrIijgxj4qcQTTsuLy3IdyJqVQxrYjl9wYDsAMnplLFtOLID0AHDvaJyVSk5duUAisN7acTQ1r5VMSJAu2G1eUFVkgrnYq8NK/SxebBDVk+FXHiRPGzG7J8KuLEoXc07YpYwYnZVAc3ZApUPbghS6EiTgxQNhR+cEOWTMVuyC5Yl4kmMcL4dppPRZzY6i76rhi85fOpyA1Zg46FpoBFKYaWz6cip4EK1KbV2kKPaY2QVjYVaXlvXauJtHodODGXijhRGqyLFHSJKzoxn4rtqkVkHyHF5cGJyVQxrXhd0A2fTa+DOzFSJaYVjkZ03VAGANq5EyNVXlrhq5F2Q6HoMH5DFqmS0/IfTrRqz5isMCfmU3EnNvyLMyd1Yj4Vc6Ksv5WlSpyYT8X2ibC//xbixHwq4kSpRaQXF3Fpkzoxn4o4cZkCTSZUuBPzqUjL68KGWq6m3In5VMSJNqVhecMWkDpxYjYV2fn4TkqswrooCndipMpMa351omN5N+hU0ScfcWI6FTmxmS62rXhDOXFiOhVp+WvZhsK+ZVn+qxPzqchm31FcFGvtAVv+uxPzqUha0/bj87UsjFb4aiSfijqx7Ygc4Ddk+VTciebPP4CJk31iPhV34iara+5p/7Xl86m4E3dSu7mM/LogUr3fid3Wbq4u+55T24u03kZFnOjSlu3jNxGF/fx1wduo+FcjBbK9+ITq8tOJ76LiX1Jabe2GelUQ76QiTuyGuqFg80VBvJeKONE21KsTm+G9vJWKOFE21OeJTTgaeTMVSasBl0jI6nYip8qfrW9O1AY0+bneTMW/GrEKqLxYPZ+KpBWPRmb7p307SEEoBoIoqBAlIOj9byt/9rUT3yaeoGhhGkmL/2VY9ZdOvBcqdGKtQifWKnRircILWa3CaiRX+cr3KndiqvIvn1TlJWWqcidaVV/5QIUl5baqTytXuROtKjqxVqETaxU6sVahE1uVNzaxCp0Yqny33jtVeUmZqnzlU5WvfKpyWqnKaaUqr0ZSlVcjqcqrkVqFTsxVeCFrVE7rM51oVZTWsLZVRVrjur5Eq4K0xnXtcaEKWbf1fEFVsca1HlBFrHEtvKWGrIFBlbHGheVA6ZoPVK2rV/18dX9UR3VUR3VUX8Uz94M6xyeLAAAAAElFTkSuQmCC);background-position:top right;background-repeat:no-repeat;background-size:contain;height:100px;width:100px;position:absolute;top:0;right:0;z-index:100;width:120px}.site-navigation,.site-content,.site-footer{margin:0 auto;max-width:840px;width:92%}.site-navigation{-webkit-columns:3;-moz-columns:3;columns:3;-webkit-column-gap:40px;-moz-column-gap:40px;column-gap:40px}.site-navigation input[type=\"checkbox\"],.site-navigation label{display:none}.site-navigation ul{list-style:none;margin:0;padding:0}.site-navigation ul li{margin-bottom:20px;font-size:22px;line-height:23px}.site-navigation ul li a{display:block;color:#444;font-weight:700;text-decoration:none}.site-navigation ul li a:hover{color:#8892bf}.site-navigation ul li ul{padding-top:8px}.site-navigation ul li li{margin-bottom:6px;font-size:18px}.site-navigation ul li li a{border:none;color:#777;font-weight:normal}.site-navigation li{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}@media (max-width:820px){.site-navigation{-webkit-columns:2;-moz-columns:2;columns:2}}@media (max-width:560px){.site-navigation{-webkit-columns:1;-moz-columns:1;columns:1}}@media (max-width:375px){.site-navigation{background:rgba(255,255,255,0.95);-webkit-columns:1;-moz-columns:1;columns:1;max-height:100vh;position:fixed;bottom:0;left:0;z-index:100}.site-navigation label{background:#4f5b93;box-sizing:border-box;display:block;height:40px;padding:0 10px;width:100vh;position:absolute;bottom:0;left:0;color:white;font-family:verdana,sans-serif;font-size:13px;line-height:40px;text-transform:uppercase;z-index:2}.site-navigation>ul{background:rgba(255,255,255,0.96);border-top:3px solid #8892bf;box-shadow:rgba(0,0,0,0.25) 0 -5px 10px;box-sizing:border-box;padding:20px;overflow:auto;-webkit-overflow-scrolling:touch;position:absolute;left:0;bottom:40px;height:50vh;width:100vh;-webkit-transform:translate(0, 100vh);-ms-transform:translate(0, 100vh);transform:translate(0, 100vh);transition:all .2s ease;z-index:1}.site-navigation input[type=\"checkbox\"]:checked~ul{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);transform:translate(0, 0)}}.site-content h1{padding-top:40px;position:relative}.site-content h1:after{border:1px solid #ddd;border-bottom:none;content:\"\";display:block;height:8px;position:absolute;left:0;top:0;width:100%}.site-content.chapters{counter-reset:chapter}.site-content.chapters h1{counter-increment:chapter;padding-top:60px}.site-content.chapters h1:before{display:inline-block;content:\"Chapter \" counter(chapter) \".\";position:absolute;top:30px;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);color:#999;font-size:12px;letter-spacing:1px;line-height:20px;text-transform:uppercase;text-align:center}.site-content #welcome ul{-webkit-columns:3;-moz-columns:3;columns:3;-webkit-column-gap:30px;-moz-column-gap:30px;column-gap:30px;list-style-position:inside}.site-content .back-to-top{margin-bottom:60px}@media (max-width:870px){.site-content #welcome ul{-webkit-columns:2;-moz-columns:2;columns:2}}@media (max-width:600px){.site-content #welcome ul{-webkit-columns:1;-moz-columns:1;columns:1}}.site-footer{border-top:1px solid #ccc;margin:60px auto 0 auto;padding:40px 20px;font-family:verdana,sans-serif;font-size:16px;text-align:center}.site-footer .cc-badge{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAABUFvrSAAAAw1BMVEX///8AAAAAAACrsar///8oKSjR1NAODg4jHyDLz8pAPz/f399wcHBQUFBgYGDJzcjEyMN5fHkwMDC9wry4vbeAgIDw8PDBxcDO0c3M0MyUmJPGysW6v7q/v7+fn5/T1tKvtK61urSxt7C/w76zuLKhpKDk5OSRk5F2c3RQUVAbGxuts6yEhoR9fnxDREMgICDW1dXJyMirq6qvr68wLS3Pz8+Rj4+Pj4+LioqEgYJaV1i6ubmbl5meoJ1dXl06NjcZGRmWw6QEAAAAAnRSTlMMANomgjQAAAMCSURBVHjatZYJc6JAEIWznWFmOAQDguAdjUqMd0yi5vz/v2q7GTmkNusWW3kxNfJkPts3TMPVFfyIfiH3ttHwRs1623F0PYp03XHa9ebI6zRu74aDwcPDdQUBXCG3440Qq4ec91GchzqhM/J1FSEYuVguYudLASixnBM6JVPJNxqgtJts2mWHwMh1Ij6dQabZlEeKfDccDlo4xbAsA6e11KzLDoG9EXHvqVbb73Z9m+q+r4dEppLHAmomQ5k1EMmsi44CY74JV/gBU+ohWqtjzSMMY6iBjR4AfQAaTVLO87HkTDabiXIUuNnWieuaLFPgYs1cb1PJC6itUzCrwQ2mCe4bcr9EPEkdOmcsUa+Jo8B1J5wiF8s9J0/DpGQNCt9ogkbladKwwZ/DNnNMtpGfdizlMzkKjAXPQDyxMwUCZqpkMOjYBrBpNADnGDESZDxZ5w4L3uQec5A7chTYCecAPiupBzDHkr0OWHQIKBotwqCzidGI17kTSKlhzFJOyFFgvgSBQXRrhuGr4QUnCFhyzOIbMDLinZTH18y523UTsJmBdS7ARiCQjEcg2fTjBdfrzc6foqCsemwtUUbqvI43jG2lxHMyMACW6MLK7K56Lrjm46qXZNGnkE+LB5AvHjlHudtBvF3MUqcn5eGgybd88aI+AP4KlbMaSF0ERwj2ocZKlxs5k8OXeA6KzkGirICcfwI3ChvEKm6Q/bHkbLbbtXLKUQRPKx+joCGPorGttKXzxTutWrZ41mnxGrdjDcC1LTdvOZcddbndg2DZ5fZoJANbqcuNGtygWttMdvTLtxsE+1uFXp9vafO7LV0ZTE3o/S9NqBqXwLDQ+QeSC23IVG1zDtVFYLD0s0Yf+ALgk0cL+F8wLCL+Ubo18agFqdT+oDeZo/7RL53EzsGUxnvpZtoqzDm9WO6o49JXKaMIpjRCPk1v/1Me6sUc0rZZcE5/BaXtpAQGd4Bozul5BbEDAwoqB6GcrOLcLFesZOw99Yjl7Ql7oeIUXjynBP4h/djT5m+nuF33PcPucwAAAABJRU5ErkJggg==);background-position:top left;background-repeat:no-repeat;background-size:contain;display:inline-block;height:31px;width:88px}.site-footer h2{font-size:24px;font-weight:bold;line-height:30px;margin-bottom:10px}.site-footer ul{list-style:none;margin:0 0 20px 0;padding:0}.site-footer .license{color:#777;font-size:13px}\n        </style>\n    </head>\n    <body>\n        <header class=\"site-header\">\n            <h1><a href=\"/\">PHP <em>The Right Way</em></a></h1>\n            <div class=\"build-date\">Last Updated: {{ site.time }}</div>\n            <div class=\"share\">\n                <a class=\"btn-share\" href=\"https://x.com/intent/tweet?text=PHP+The+Right+Way&amp;url=https%3A%2F%2Fwww.phptherightway.com&amp;hashtags=PHP\" target=\"_blank\">Share on X</a>\n            </div>\n            <a class=\"fork-me\" href=\"https://github.com/codeguy/php-the-right-way\" target=\"_blank\"></a>\n        </header>\n\n        <div class=\"site-content\">\n            {{ content }}\n        </div>\n\n        <footer class=\"site-footer\" id=\"credits\">\n            <h2>Created and maintained by</h2>\n            <ul>\n                <li><a href=\"https://joshlockhart.com\" target=\"_blank\">Josh Lockhart</a></li>\n                <li><a href=\"https://philsturgeon.co.uk/\" target=\"_blank\">Phil Sturgeon</a></li>\n                <li><a href=\"https://github.com/codeguy/php-the-right-way/graphs/contributors\" target=\"_blank\">Project Contributors</a></li>\n            </ul>\n            <div class=\"license\">\n                <a class=\"cc-badge\" rel=\"license\" href=\"https://creativecommons.org/licenses/by-nc-sa/3.0/\"></a>\n                <br />\n                <span xmlns:dct=\"http://purl.org/dc/terms/\" href=\"http://purl.org/dc/dcmitype/Text\" property=\"dct:title\" rel=\"dct:type\">PHP: The Right Way</span> by <a xmlns:cc=\"http://creativecommons.org/ns#\" href=\"https://joshlockhart.com\" property=\"cc:attributionName\" rel=\"cc:attributionURL\">Josh Lockhart</a>\n                <br/>\n                is licensed under a <a rel=\"license\" href=\"https://creativecommons.org/licenses/by-nc-sa/3.0/\">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.<br />Based on a work at <a xmlns:dct=\"http://purl.org/dc/terms/\" href=\"https://www.phptherightway.com\" rel=\"dct:source\">www.phptherightway.com</a>.\n            </div>\n        </footer>\n    </body>\n</html>\n"
  },
  {
    "path": "_posts/01-01-01-Getting-Started.md",
    "content": "---\nanchor: getting_started\n---\n\n# Getting Started {#getting_started_title}\n\n"
  },
  {
    "path": "_posts/01-02-01-Use-the-Current-Stable-Version.md",
    "content": "---\ntitle:   Use the Current Stable Version (8.5)\nisChild: true\nanchor:  use_the_current_stable_version\n---\n\n## Use the Current Stable Version (8.5) {#use_the_current_stable_version_title}\n\nIf you are getting started with PHP, start with the current stable release of [PHP 8.5][php-release]. PHP 8.x adds many [new features](#language_highlights) over the older 7.x and 5.x versions. The engine has been largely re-written, and PHP is now even quicker than older versions. PHP 8 is a major update of the language and contains many new features and optimizations.\n\nYou should try to upgrade to the latest stable version quickly - PHP 7.4 [is already End of Life][php-supported]. Upgrading is easy, as there are not many backwards compatibility breaks [PHP 8.0][php-bc-80], [PHP 8.1][php-bc-81], [PHP 8.2][php-bc-82], [PHP 8.3][php-bc-83], [PHP 8.4][php-bc-84], [PHP 8.5][php-bc-85]. If you are not sure which version a function or feature is in, you can check the PHP documentation on the [php.net][php-docs] website.\n\n[php-release]: https://www.php.net/downloads.php\n[php-supported]: https://www.php.net/supported-versions.php\n[php-docs]: https://www.php.net/manual/\n[php-bc-80]: https://www.php.net/manual/migration80.incompatible.php\n[php-bc-81]: https://www.php.net/manual/migration81.incompatible.php\n[php-bc-82]: https://www.php.net/manual/migration82.incompatible.php\n[php-bc-83]: https://www.php.net/manual/migration83.incompatible.php\n[php-bc-84]: https://www.php.net/manual/migration84.incompatible.php\n[php-bc-85]: https://www.php.net/manual/migration85.incompatible.php"
  },
  {
    "path": "_posts/01-03-01-Built-in-Web-Server.md",
    "content": "---\ntitle:   Built-in Web Server\nisChild: true\nanchor:  builtin_web_server\n---\n\n## Built-in web server {#builtin_web_server_title}\n\nWith PHP 5.4 or newer, you can start learning PHP without installing and configuring a full-fledged web server.\nTo start the server, run the following command from your terminal in your project's web root:\n\n{% highlight console %}\n> php -S localhost:8000\n{% endhighlight %}\n\n* [Learn about the built-in, command line web server][cli-server]\n\n\n[cli-server]: https://www.php.net/features.commandline.webserver\n"
  },
  {
    "path": "_posts/01-04-01-Mac-Setup.md",
    "content": "---\nisChild: true\nanchor:  mac_setup\n---\n\n## macOS Setup {#mac_setup_title}\n\nmacOS 12 (Monterey) and later does not come prepackaged with PHP. Earlier macOS versions include PHP but are behind the latest stable release. There are multiple ways to install the latest PHP version on macOS.\n\n### Install PHP via Homebrew\n\n[Homebrew] is a package manager for macOS that helps you easily install PHP and various extensions. The Homebrew core repository provides \"formulae\" for PHP 8.1, 8.2, 8.3, 8.4 and 8.5. Install the latest version with this command:\n\n```\nbrew install php\n```\n\nYou can switch between Homebrew PHP versions by modifying your `PATH` variable. Alternatively, you can use [brew-php-switcher][brew-php-switcher] to switch PHP versions automatically.\n\nYou can also switch between PHP versions manually by unlinking and linking the wanted version:\n\n```\nbrew unlink php\nbrew link --overwrite php@8.2\n```\n\n```\nbrew unlink php\nbrew link --overwrite php@8.3\n```\n\n### Install PHP via Macports\n\nThe [MacPorts] Project is an open-source community initiative to design an\neasy-to-use system for compiling, installing, and upgrading either\ncommand-line, X11 or Aqua based open-source software on the macOS operating\nsystem.\n\nMacPorts supports pre-compiled binaries, so you don't need to recompile every\ndependency from the source tarball files, it saves your life if you don't\nhave any package installed on your system.\n\nAt this point, you can install `php54`, `php55`, `php56`, `php70`, `php71`, `php72`, `php73`, `php74`, `php80`, `php81`, `php82`, `php83`, or `php84` using the `port install` command, for example:\n\n    sudo port install php74\n    sudo port install php83\n\nAnd you can run `select` command to switch your active PHP:\n\n    sudo port select --set php php83\n\n### Install PHP via phpbrew\n\n[phpbrew] is a tool for installing and managing multiple PHP versions. This can be really useful if two different\napplications/projects require different versions of PHP, and you are not using virtual machines.\n\n### Install PHP via Liip's binary installer\n\nAnother popular option is [php-osx.liip.ch] which provides one liner installation methods for versions 5.3 through 7.3.\nIt doesn't overwrite the PHP binaries installed by Apple, but installs everything in a separate location (/usr/local/php5).\n\n### Compile from Source\n\nAnother option that gives you control over the version of PHP you install, is to [compile it yourself][mac-compile].\nIn that case be sure to have installed either [Xcode][xcode-gcc-substitution] or Apple's substitute\n[\"Command Line Tools for XCode\"] downloadable from Apple's Developer Center.\n\n### All-in-One Installers\n\nThe solutions listed above mainly handle PHP itself, and do not supply things like [Apache][apache], [Nginx][nginx] or a SQL server.\n\"All-in-one\" solutions such as [MAMP][mamp-downloads] and [XAMPP][xampp] will install these other bits of software for\nyou and tie them all together, but ease of setup comes with a trade-off of flexibility.\n\n[Homebrew]: https://brew.sh/\n[MacPorts]: https://www.macports.org/install.php\n[phpbrew]: https://github.com/phpbrew/phpbrew\n[php-osx.liip.ch]: https://web.archive.org/web/20220505163210/https://php-osx.liip.ch/\n[mac-compile]: https://www.php.net/install.macosx.compile\n[xcode-gcc-substitution]: https://github.com/kennethreitz/osx-gcc-installer\n[\"Command Line Tools for XCode\"]: https://developer.apple.com/downloads\n[apache]: https://httpd.apache.org/\n[nginx]: https://www.nginx.com/\n[mamp-downloads]: https://www.mamp.info/en/downloads/\n[xampp]: https://www.apachefriends.org/\n[brew-php-switcher]: https://github.com/philcook/brew-php-switcher\n"
  },
  {
    "path": "_posts/01-05-01-Windows-Setup.md",
    "content": "---\nisChild: true\nanchor:  windows_setup\n---\n\n## Windows Setup {#windows_setup_title}\n\nYou can download the binaries from [windows.php.net/download][php-downloads]. After the extraction of PHP, it is recommended to set the [PATH][windows-path] to the root of your PHP folder (where php.exe is located) so you can execute PHP from anywhere.\n\nFor learning and local development, you can use the built in webserver with PHP 5.4+ so you don't need to worry about\nconfiguring it. If you would like an \"all-in-one\" which includes a full-blown webserver and MySQL too then tools such\nas the [XAMPP][xampp], [EasyPHP][easyphp], [OpenServer][openserver] and [WAMP][wamp] will\nhelp get a Windows development environment up and running fast. That said, these tools will be a little different from\nproduction so be careful of environment differences if you are working on Windows and deploying to Linux.\n\nIf you need to run your production system on Windows, then IIS7 will give you the most stable and best performance. You\ncan use [phpmanager][phpmanager] (a GUI plugin for IIS7) to make configuring and managing PHP simple. IIS7 comes with\nFastCGI built in and ready to go, you just need to configure PHP as a handler. For support and additional resources\nthere is a [dedicated area on iis.net][php-iis] for PHP.\n\nGenerally running your application on different environment in development and production can lead to strange bugs popping up when you go\nlive. If you are developing on Windows and deploying to Linux (or anything non-Windows) then you should consider using a [Virtual Machine](/#virtualization_title).\n\nChris Tankersley has a very helpful blog post on what tools he uses to do [PHP development using Windows][windows-tools].\n\n[easyphp]: https://www.easyphp.org/\n[phpmanager]: http://phpmanager.codeplex.com/\n[openserver]: https://ospanel.io/\n[wamp]: https://www.wampserver.com/en/\n[php-downloads]: https://windows.php.net/download/\n[php-iis]: https://php.iis.net/\n[windows-path]: https://www.windows-commandline.com/set-path-command-line/\n[windows-tools]: https://ctankersley.com/2016/11/13/developing-on-windows-2016/\n[xampp]: https://www.apachefriends.org/\n"
  },
  {
    "path": "_posts/01-06-01-Linux-Setup.md",
    "content": "---\nisChild: true\nanchor:  linux_setup\n---\n\n## Linux Setup {#linux_setup_title}\n\nMost GNU/Linux distributions come with PHP available from the official repositories, but those packages usually are a little behind the current stable version. There are multiple ways to get newer PHP versions on such distributions.\n\n### Ubuntu-based distributions\n\nOn Ubuntu and Debian-based GNU/Linux distributions, for instance, the best alternatives for native packages are provided and maintained by [Ondřej Surý][Ondrej Sury Blog], through his Personal Package Archive (PPA) on Ubuntu and DPA/bikeshed on Debian. Find instructions for each of these below.\n\nFor Ubuntu distributions, the [PPA by Ondřej Surý][Ondrej Sury PPA] provides supported PHP versions along with many PECL extensions. To add this PPA to your system, perform the following steps in your terminal:\n\n1. First, add the PPA to your system's software sources using the command:\n\n   ```bash\n   sudo add-apt-repository ppa:ondrej/php\n   ```\n\n2. After adding the PPA, update your system's package list:\n\n   ```bash\n   sudo apt update\n   ```\n\nThis will ensure that your system can access and install the latest PHP packages available in the PPA.\n\n### Debian-based distributions\n\nFor Debian-based distributions, Ondřej Surý also provides a [bikeshed][bikeshed] (Debian equivalent of a PPA). To add the bikeshed to your system and update it, follow these steps:\n\n1. Ensure that you have root access. If not, you might need to use `sudo` for the following commands.\n\n2. Update your system's package list:\n\n   ```bash\n   sudo apt-get update\n   ```\n\n3. Install `lsb-release`, `ca-certificates`, and `curl`:\n\n   ```bash\n   sudo apt-get -y install lsb-release ca-certificates curl\n   ```\n\n4. Download the signing key for the repository:\n\n   ```bash\n   sudo curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg\n   ```\n\n5. Add the repository to your system's software sources:\n\n   ```bash\n   sudo sh -c 'echo \"deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main\" > /etc/apt/sources.list.d/php.list'\n   ```\n\n6. Finally, update your system's package list again:\n\n   ```bash\n   sudo apt-get update\n   ```\n\nWith these steps, your system will be able to install the latest PHP packages from the bikeshed.\n\n### RPM-based distributions\n\nOn RPM-based distributions (CentOS, Fedora, RHEL, etc.) you can use the [Remi's RPM repository][remi-repo] to install the latest PHP version or to have multiple PHP versions simultaneously available.\n\nThere is a [configuration wizard][remi-wizard] available to configure your RPM-based distribution.\n\nAll that said, you can always use containers or compile the PHP source code from scratch.\n\n[Ondrej Sury Blog]: https://deb.sury.org/\n[Ondrej Sury PPA]: https://launchpad.net/~ondrej/+archive/ubuntu/php\n[bikeshed]: https://packages.sury.org/php/\n[remi-repo]: https://rpms.remirepo.net/\n[remi-wizard]: https://rpms.remirepo.net/wizard/\n"
  },
  {
    "path": "_posts/01-07-01-Common-Directory-Structure.md",
    "content": "---\ntitle:   Common Directory Structure\nisChild: true\nanchor:  common_directory_structure\n---\n\n## Common Directory structure {#common_directory_structure_title}\n\nA common question among those starting out with writing programs for the web is, \"where do I put my stuff?\" Over the years, this answer has consistently been \"where the `DocumentRoot` is.\" Although this answer is not complete, it's a great place to start.\n\nFor security reasons, configuration files should not be accessible by a site's visitors; therefore, public scripts are kept in a public directory and private configurations and data are kept outside of that directory.\n\nFor each team, CMS, or framework one works in, a standard directory structure is used by each of those entities. However, if one is starting a project alone, knowing which filesystem structure to use can be daunting.\n\n[Paul M. Jones] has done some fantastic research into common practices of tens of thousands of github projects in the realm of PHP. He has compiled a standard file and directory structure, the [Standard PHP Package Skeleton], based on this research. In this directory structure, `DocumentRoot` should point to `public/`, unit tests should be in the `tests/` directory, and third party libraries, as installed by [composer], belong in the `vendor/` directory. For other files and directories, abiding by the [Standard PHP Package Skeleton] will make the most sense to contributors of a project.\n\n[Paul M. Jones]: https://paul-m-jones.com/\n[Standard PHP Package Skeleton]: https://github.com/php-pds/skeleton\n[Composer]: /#composer_and_packagist\n"
  },
  {
    "path": "_posts/02-01-01-Code-Style-Guide.md",
    "content": "---\nanchor: code_style_guide\n---\n\n# Code Style Guide {#code_style_guide_title}\n\nThe PHP community is large and diverse, composed of innumerable libraries, frameworks, and components. It is common for\nPHP developers to choose several of these and combine them into a single project. It is important that PHP code adheres\n(as close as possible) to a common code style to make it easy for developers to mix and match various libraries for\ntheir projects.\n\nThe [Framework Interop Group][fig] has proposed and approved a series of style recommendations. Not all of them relate\nto code-style, but those that do are [PSR-1][psr1], [PSR-12][psr12], [PSR-4][psr4] and [PER Coding Style][per-cs]. These\nrecommendations are merely a set of rules that many projects like Drupal, Zend, Symfony, Laravel, CakePHP, phpBB, AWS SDK,\nFuelPHP, Lithium, etc. are adopting. You can use them for your own projects, or continue to use your own\npersonal style.\n\nIdeally, you should write PHP code that adheres to a known standard. This could be any combination of PSRs, or one\nof the coding standards made by PEAR or Zend. This means other developers can easily read and work with your code, and\napplications that implement the components can have consistency even when working with lots of third-party code.\n\n* [Read about PSR-1][psr1]\n* [Read about PSR-12][psr12]\n* [Read about PSR-4][psr4]\n* [Read about PER Coding Style][per-cs]\n* [Read about PEAR Coding Standards][pear-cs]\n* [Read about Symfony Coding Standards][symfony-cs]\n\nYou can use [PHP_CodeSniffer][phpcs] to check code against any one of these recommendations, and plugins for text\neditors like [Sublime Text][st-cs] to be given real-time feedback.\n\nYou can fix the code layout automatically by using one of the following tools:\n\n- One is the [PHP Coding Standards Fixer][phpcsfixer] which has a very well tested codebase.\n- Also, the [PHP Code Beautifier and Fixer][phpcbf] tool which is included with PHP_CodeSniffer can be used to adjust your code accordingly.\n\nAnd you can run phpcs manually from shell:\n\n    phpcs -sw --standard=PSR1 file.php\n\nIt will show errors and describe how to fix them.\nIt can also be helpful to include the `phpcs` command in a git pre-commit hook with the `--filter=GitStaged` CLI argument.\nThat way, code which contain violations against the chosen standard cannot enter the repository until those\nviolations have been fixed.\n\nIf you have PHP_CodeSniffer, then you can fix the code layout problems reported by it, automatically, with the\n[PHP Code Beautifier and Fixer][phpcbf].\n\n    phpcbf -w --standard=PSR1 file.php\n\nAnother option is to use the [PHP Coding Standards Fixer][phpcsfixer].\nIt will show what kind of errors the code structure had before it fixed them.\n\n    php-cs-fixer fix -v --rules=@PSR1 file.php\n\nEnglish is preferred for all symbol names and code infrastructure. Comments may be written in any language easily\nreadable by all current and future parties who may be working on the codebase.\n\nFinally, a good supplementary resource for writing clean PHP code is [Clean Code PHP][cleancode].\n\n[fig]: https://www.php-fig.org/\n[psr1]: https://www.php-fig.org/psr/psr-1/\n[psr12]: https://www.php-fig.org/psr/psr-12/\n[psr4]: https://www.php-fig.org/psr/psr-4/\n[per-cs]: https://www.php-fig.org/per/coding-style/\n[pear-cs]: https://pear.php.net/manual/en/standards.php\n[symfony-cs]: https://symfony.com/doc/current/contributing/code/standards.html\n[phpcs]: https://github.com/PHPCSStandards/PHP_CodeSniffer\n[phpcbf]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically\n[st-cs]: https://github.com/benmatselby/sublime-phpcs\n[phpcsfixer]: https://cs.symfony.com/\n[cleancode]: https://github.com/jupeter/clean-code-php\n"
  },
  {
    "path": "_posts/03-01-01-Language-Highlights.md",
    "content": "---\nanchor: language_highlights\n---\n\n# Language Highlights {#language_highlights_title}\n"
  },
  {
    "path": "_posts/03-02-01-Programming-Paradigms.md",
    "content": "---\nisChild: true\nanchor:  programming_paradigms\n---\n\n## Programming Paradigms {#programming_paradigms_title}\n\nPHP is a flexible, dynamic language that supports a variety of programming techniques. It has evolved dramatically over\nthe years, notably adding a solid object-oriented model in PHP 5.0 (2004), anonymous functions and namespaces in\nPHP 5.3 (2009), and traits in PHP 5.4 (2012).\n\n### Object-oriented Programming\n\nPHP has a very complete set of object-oriented programming features including support for classes, abstract classes,\ninterfaces, inheritance, constructors, cloning, exceptions, and more.\n\n* [Read about Object-oriented PHP][oop]\n* [Read about Traits][traits]\n\n### Functional Programming\n\nPHP supports first-class functions, meaning that a function can be assigned to a variable. Both user-defined and\nbuilt-in functions can be referenced by a variable and invoked dynamically. Functions can be passed as arguments to\nother functions (a feature called _Higher-order Functions_) and functions can return other functions.\n\nRecursion, a feature that allows a function to call itself, is supported by the language, but most PHP code\nis focused on iteration.\n\nNew anonymous functions (with support for closures) are present since PHP 5.3 (2009).\n\nPHP 5.4 added the ability to bind closures to an object's scope and also improved support for callables such that they\ncan be used interchangeably with anonymous functions in almost all cases.\n\n* Continue reading on [Functional Programming in PHP](/pages/Functional-Programming.html)\n* [Read about Anonymous Functions][anonymous-functions]\n* [Read about the Closure class][closure-class]\n* [More details in the Closures RFC][closures-rfc]\n* [Read about Callables][callables]\n* [Read about dynamically invoking functions with `call_user_func_array()`][call-user-func-array]\n\n### Meta Programming\n\nPHP supports various forms of meta-programming through mechanisms like the Reflection API and Magic Methods. There are\nmany Magic Methods available like `__get()`, `__set()`, `__clone()`, `__toString()`, `__invoke()`, etc. that allow\ndevelopers to hook into class behavior. Ruby developers often say that PHP is lacking `method_missing`, but it is\navailable as `__call()` and `__callStatic()`.\n\n* [Read about Magic Methods][magic-methods]\n* [Read about Reflection][reflection]\n* [Read about Overloading][overloading]\n\n\n[oop]: https://www.php.net/language.oop5\n[traits]: https://www.php.net/language.oop5.traits\n[anonymous-functions]: https://www.php.net/functions.anonymous\n[closure-class]: https://www.php.net/class.closure\n[closures-rfc]: https://wiki.php.net/rfc/closures\n[callables]: https://www.php.net/language.types.callable\n[call-user-func-array]: https://www.php.net/function.call-user-func-array\n[magic-methods]: https://www.php.net/language.oop5.magic\n[reflection]: https://www.php.net/intro.reflection\n[overloading]: https://www.php.net/language.oop5.overloading\n"
  },
  {
    "path": "_posts/03-03-01-Namespaces.md",
    "content": "---\nisChild: true\nanchor:  namespaces\n---\n\n## Namespaces {#namespaces_title}\n\nAs mentioned above, the PHP community has a lot of developers creating lots of code. This means that one library's PHP\ncode might use the same class name as another. When both libraries are used in the same namespace, they collide\nand cause trouble.\n\n_Namespaces_ solve this problem. As described in the PHP reference manual, namespaces may be compared to operating\nsystem directories that _namespace_ files; two files with the same name may co-exist in separate directories. Likewise,\ntwo PHP classes with the same name may co-exist in separate PHP namespaces. It's as simple as that.\n\nIt is important for you to namespace your code so that it may be used by other developers without fear of colliding\nwith other libraries.\n\nOne recommended way to use namespaces is outlined in [PSR-4][psr4], which aims to provide a standard file, class and\nnamespace convention to allow plug-and-play code.\n\nIn October 2014 the PHP-FIG deprecated the previous autoloading standard: [PSR-0][psr0]. Both PSR-0 and PSR-4 are still perfectly usable.  The latter requires PHP 5.3, so many PHP 5.2-only projects implement PSR-0.\n\nIf you're going to use an autoloader standard for a new application or package, look into PSR-4.\n\n* [Read about Namespaces][namespaces]\n* [Read about PSR-0][psr0]\n* [Read about PSR-4][psr4]\n\n\n[namespaces]: https://www.php.net/language.namespaces\n[psr0]: https://www.php-fig.org/psr/psr-0/\n[psr4]: https://www.php-fig.org/psr/psr-4/\n"
  },
  {
    "path": "_posts/03-04-01-Standard-PHP-Library.md",
    "content": "---\ntitle:   Standard PHP Library\nisChild: true\nanchor:  standard_php_library\n---\n\n## Standard PHP Library {#standard_php_library_title}\n\nThe Standard PHP Library (SPL) is packaged with PHP and provides a collection of classes and interfaces. It is made up\nprimarily of commonly needed datastructure classes (stack, queue, heap, and so on), and iterators which can traverse\nover these datastructures or your own classes which implement SPL interfaces.\n\n* [Read about the SPL][spl]\n* [SPL video course on LinkedIn.com (paid)][linkedin]\n\n\n[spl]: https://www.php.net/book.spl\n[linkedin]: https://www.linkedin.com/learning/learning-the-standard-php-library?trk=lynda_redirect_learning\n"
  },
  {
    "path": "_posts/03-05-01-Command-Line-Interface.md",
    "content": "---\nisChild: true\nanchor:  command_line_interface\n---\n\n## Command Line Interface {#command_line_interface_title}\n\nPHP was created to write web applications, but is also useful for scripting command line interface (CLI) programs.\nCommand line PHP programs can help automate common tasks like testing, deployment, and application administration.\n\nCLI PHP programs are powerful because you can use your app's code directly without having to create and secure a web\nGUI for it. Just be sure **not** to put your CLI PHP scripts in your public web root!\n\nTry running PHP from your command line:\n\n{% highlight console %}\n> php -i\n{% endhighlight %}\n\nThe `-i` option will print your PHP configuration just like the [`phpinfo()`][phpinfo] function.\n\nThe `-a` option provides an interactive shell, similar to ruby's IRB or python's interactive shell. There are a number\nof other useful [command line options][cli-options], too.\n\nLet's write a simple \"Hello, $name\" CLI program. To try it out, create a file named `hello.php`, as below.\n\n{% highlight php %}\n<?php\nif ($argc !== 2) {\n    echo \"Usage: php hello.php <name>\" . PHP_EOL;\n    exit(1);\n}\n$name = $argv[1];\necho \"Hello, $name\" . PHP_EOL;\n{% endhighlight %}\n\nPHP sets up two special variables based on the arguments your script is run with. [`$argc`][argc] is an integer\nvariable containing the argument *count* and [`$argv`][argv] is an array variable containing each argument's *value*.\nThe first argument is always the name of your PHP script file, in this case `hello.php`.\n\nThe `exit()` expression is used with a non-zero number to let the shell know that the command failed. Commonly used\nexit codes can be found [here][exit-codes].\n\nTo run our script, above, from the command line:\n\n{% highlight console %}\n> php hello.php\nUsage: php hello.php <name>\n> php hello.php world\nHello, world\n{% endhighlight %}\n\n\n * [Learn about running PHP from the command line][php-cli]\n\n[phpinfo]: https://www.php.net/function.phpinfo\n[cli-options]: https://www.php.net/features.commandline.options\n[argc]: https://www.php.net/reserved.variables.argc\n[argv]: https://www.php.net/reserved.variables.argv\n[exit-codes]: https://www.gsp.com/cgi-bin/man.cgi?section=3&amp;topic=sysexits\n[php-cli]: https://www.php.net/manual/en/features.commandline.php\n"
  },
  {
    "path": "_posts/03-06-01-XDebug.md",
    "content": "---\ntitle:   Xdebug\nisChild: true\nanchor:  xdebug\n---\n\n## Xdebug {#xdebug_title}\n\nOne of the most useful tools in software development is a proper debugger. It allows you to trace the execution of your\ncode and monitor the contents of the stack. Xdebug, PHP's debugger, can be utilized by various IDEs to provide\nBreakpoints and stack inspection. It can also allow tools like PHPUnit and KCacheGrind to perform code coverage\nanalysis and code profiling.\n\nIf you find yourself in a bind, willing to resort to `var_dump()`/`print_r()`, and you still can't find the solution -\nmaybe you need to use the debugger.\n\n[Installing Xdebug][xdebug-install] can be tricky, but one of its most important features is \"Remote Debugging\" - if\nyou develop code locally and then test it inside a VM or on another server, Remote Debugging is the feature that you\nwill want to enable right away.\n\nTraditionally, you will modify your Apache VHost or .htaccess file with these values:\n\n{% highlight ini %}\nphp_value xdebug.remote_host 192.168.?.?\nphp_value xdebug.remote_port 9000\n{% endhighlight %}\n\nThe \"remote host\" and \"remote port\" will correspond to your local computer and the port that you configure your IDE to\nlisten on. Then it's just a matter of putting your IDE into \"listen for connections\" mode, and loading the URL:\n\n    http://your-website.example.com/index.php?XDEBUG_SESSION_START=1\n\nYour IDE will now intercept the current state as the script executes, allowing you to set breakpoints and probe the\nvalues in memory.\n\nGraphical debuggers make it very easy to step through code, inspect variables, and eval code against the live runtime.\nMany IDEs have built-in or plugin-based support for graphical debugging with Xdebug. MacGDBp is a free, open-source,\nstand-alone Xdebug GUI for macOS.\n\n * [Learn more about Xdebug][xdebug-docs]\n * [Learn more about MacGDBp][macgdbp-install]\n\n\n[xdebug-install]: https://xdebug.org/docs/install\n[xdebug-docs]: https://xdebug.org/docs/\n[macgdbp-install]: https://www.bluestatic.org/software/macgdbp/\n"
  },
  {
    "path": "_posts/04-01-01-Dependency-Management.md",
    "content": "---\nanchor: dependency_management\n---\n\n# Dependency Management {#dependency_management_title}\n\nThere are a ton of PHP libraries, frameworks, and components to choose from. Your project will likely use \nseveral of them — these are project dependencies. PHP did not have a good way to manage\nthese project dependencies. Even if you managed them manually, you still had to worry about autoloaders.\nThat is no longer an issue.\n\nCurrently there are two major package management systems for PHP - [Composer] and [PEAR]. Composer is currently\nthe most popular package manager for PHP, however for a long time PEAR was the primary package manager in use.\nKnowing PEAR's history is a good idea, since you may still find references to it even if you never use it.\n\n[Composer]: /#composer_and_packagist\n[PEAR]: /#pear\n"
  },
  {
    "path": "_posts/04-02-01-Composer-and-Packagist.md",
    "content": "---\ntitle:   Composer and Packagist\nisChild: true\nanchor:  composer_and_packagist\n---\n\n## Composer and Packagist {#composer_and_packagist_title}\n\nComposer is the recommended dependency manager for PHP. List your project's dependencies in a `composer.json` file and,\nwith a few simple commands, Composer will automatically download your project's dependencies and setup autoloading for\nyou. Composer is analogous to NPM in the node.js world, or Bundler in the Ruby world.\n\nThere is a plethora of PHP libraries that are compatible with Composer and ready to be used in your project. These\n\"packages\" are listed on [Packagist], the official repository for Composer-compatible PHP libraries.\n\n### How to Install Composer\n\nThe safest way to download composer is by [following the official instructions](https://getcomposer.org/download/).\nThis will verify the installer is not corrupt or tampered with.\nThe installer installs a `composer.phar` binary in your _current working directory_.\n\nWe recommend installing Composer *globally* (e.g. a single copy in `/usr/local/bin`). To do so, run this command next:\n\n{% highlight console %}\nmv composer.phar /usr/local/bin/composer\n{% endhighlight %}\n\n**Note:** If the above fails due to permissions, prefix with `sudo`.\n\nTo run a locally installed Composer you'd use `php composer.phar`, globally it's simply `composer`.\n\n#### Installing on Windows\n\nFor Windows users the easiest way to get up and running is to use the [ComposerSetup] installer, which\nperforms a global install and sets up your `$PATH` so that you can just call `composer` from any\ndirectory in your command line.\n\n### How to Define and Install Dependencies\n\nComposer keeps track of your project's dependencies in a file called `composer.json`. You can manage it\nby hand if you like, or use Composer itself. The `composer require` command adds a project dependency\nand if you don't have a `composer.json` file, one will be created. Here's an example that adds [Twig]\nas a dependency of your project.\n\n{% highlight console %}\ncomposer require twig/twig:^2.0\n{% endhighlight %}\n\nAlternatively, the `composer init` command will guide you through creating a full `composer.json` file\nfor your project. Either way, once you've created your `composer.json` file you can tell Composer to\ndownload and install your dependencies into the `vendor/` directory. This also applies to projects\nyou've downloaded that already provide a `composer.json` file:\n\n{% highlight console %}\ncomposer install\n{% endhighlight %}\n\nNext, add this line to your application's primary PHP file; this will tell PHP to use Composer's\nautoloader for your project dependencies.\n\n{% highlight php %}\n<?php\nrequire 'vendor/autoload.php';\n{% endhighlight %}\n\nNow you can use your project dependencies, and they'll be autoloaded on demand.\n\n### Updating your dependencies\n\nComposer creates a file called `composer.lock` which stores the exact version of each package it\ndownloaded when you first ran `composer install`. If you share your project with others,\nensure the `composer.lock` file is included, so that when they run `composer install` they'll\nget the same versions as you.  To update your dependencies, run `composer update`. Don't use\n`composer update` when deploying, only `composer install`, otherwise you may end up with different\npackage versions on production.\n\nThis is most useful when you define your version requirements flexibly. For instance, a version\nrequirement of `~1.8` means \"anything newer than `1.8.0`, but less than `2.0.x-dev`\". You can also use\nthe `*` wildcard as in `1.8.*`. Now Composer's `composer update` command will upgrade all your\ndependencies to the newest version that fits the restrictions you define.\n\n### Update Notifications\n\nTo receive notifications about new version releases you can sign up for [libraries.io], a web service\nthat can monitor dependencies and send you alerts on updates.\n\n### Checking your dependencies for security issues\n\nThe [Local PHP Security Checker] is a command-line tool, which will examine your `composer.lock`\nfile and tell you if you need to update any of your dependencies.\n\n### Handling global dependencies with Composer\n\nComposer can also handle global dependencies and their binaries. Usage is straight-forward, all you need\nto do is prefix your command with `global`. If for example you wanted to install PHPUnit and have it\navailable globally, you'd run the following command:\n\n{% highlight console %}\ncomposer global require phpunit/phpunit\n{% endhighlight %}\n\nThis will create a `~/.composer` folder where your global dependencies reside. To have the installed\npackages' binaries available everywhere, you'd then add the `~/.composer/vendor/bin` folder to your\n`$PATH` variable.\n\n* [Learn about Composer]\n\n[Packagist]: https://packagist.org/\n[Twig]: https://twig.symfony.com/\n[libraries.io]: https://libraries.io/\n[Local PHP Security Checker]: https://github.com/fabpot/local-php-security-checker\n[Learn about Composer]: https://getcomposer.org/doc/00-intro.md\n[ComposerSetup]: https://getcomposer.org/Composer-Setup.exe\n"
  },
  {
    "path": "_posts/04-03-01-PEAR.md",
    "content": "---\ntitle:   PEAR\nisChild: true\nanchor:  pear\n---\n\n## PEAR {#pear_title}\n\nA veteran package manager that some PHP developers enjoy is [PEAR][1]. It behaves similarly to Composer,\nbut has some notable differences.\n\nPEAR requires each package to have a specific structure, which means that the author of the package must prepare it for\nusage with PEAR. Using a project which was not prepared to work with PEAR is not possible.\n\nPEAR installs packages globally, which means after installing them once they are available to all projects on that\nserver. This can be good if many projects rely on the same package with the same version but might lead to problems if\nversion conflicts between two projects arise.\n\n### How to install PEAR\n\nYou can install PEAR by downloading the `.phar` installer and executing it. The PEAR documentation has\ndetailed [install instructions][2] for every operating system.\n\nIf you are using Linux, you can also have a look at your distribution package manager. Debian and Ubuntu,\nfor example, have an apt `php-pear` package.\n\n### How to install a package\n\nIf the package is listed on the [PEAR packages list][3], you can install it by specifying the official name:\n\n{% highlight console %}\npear install foo\n{% endhighlight %}\n\nIf the package is hosted on another channel, you need to `discover` the channel first and also specify it when\ninstalling. See the [Using channel docs][4] for more information on this topic.\n\n* [Learn about PEAR][1]\n\n### Handling PEAR dependencies with Composer\n\nIf you are already using [Composer][5] and you would like to install some PEAR code too, you can use Composer to\nhandle your PEAR dependencies. PEAR repositories are no longer directly supported by Composer version 2, so you must manually add a repository to install PEAR packages:\n\n{% highlight json %}\n{\n    \"repositories\": [\n        {\n            \"type\": \"package\",\n            \"package\": {\n                \"name\": \"pear2/pear2-http-request\",\n                \"version\": \"2.5.1\",\n                \"dist\": {\n                    \"url\": \"https://github.com/pear2/HTTP_Request/archive/refs/heads/master.zip\",\n                    \"type\": \"zip\"\n                }\n            }\n        }\n    ],\n    \"require\": {\n        \"pear2/pear2-http-request\": \"*\"\n    },\n    \"autoload\": {\n        \"psr-4\": {\"PEAR2\\\\HTTP\\\\\": \"vendor/pear2/pear2-http-request/src/HTTP/\"}\n    }\n}\n{% endhighlight %}\n\nThe first section `\"repositories\"` will be used to let Composer know it should \"initialize\" (or \"discover\" in PEAR\nterminology) the pear repo. Then the `require` section will prefix the package name like this:\n\n> pear-channel/package\n\nThe \"pear\" prefix is hardcoded to avoid any conflicts, as a pear channel could be the same as another packages vendor\nname for example, then the channel short name (or full URL) can be used to reference which channel the package is in.\n\nWhen this code is installed it will be available in your vendor directory and automatically available through the\nComposer autoloader:\n\n> vendor/pear2/pear2-http-request/pear2/HTTP/Request.php\n\nTo use this PEAR package simply reference it like so:\n\n{% highlight php %}\n<?php\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse PEAR2\\HTTP\\Request;\n\n$request = new Request();\n{% endhighlight %}\n\n* [Learn more about using repositories with Composer][6]\n\n\n[1]: https://pear.php.net/\n[2]: https://pear.php.net/manual/installation.getting.php\n[3]: https://pear.php.net/packages.php\n[4]: https://pear.php.net/manual/guide.users.commandline.channels.php\n[5]: /#composer_and_packagist\n[6]: https://getcomposer.org/doc/05-repositories.md\n"
  },
  {
    "path": "_posts/05-01-01-Coding-Practices.md",
    "content": "---\nanchor: coding_practices\n---\n\n# Coding Practices {#coding_practices_title}\n"
  },
  {
    "path": "_posts/05-02-01-The-Basics.md",
    "content": "---\nisChild: true\nanchor:  the_basics\n---\n\n## The Basics {#the_basics_title}\n\nPHP is a vast language that allows coders of all levels the ability to produce code not only quickly, but efficiently.\nHowever, while advancing through the language, we often forget the basics that we first learnt (or overlooked) in favor\nof short cuts and/or bad habits. To help combat this common issue, this section is aimed at reminding coders of the\nbasic coding practices within PHP.\n\n* Continue reading on [The Basics](/pages/The-Basics.html)"
  },
  {
    "path": "_posts/05-03-01-Date-and-Time.md",
    "content": "---\ntitle:   Date and Time\nisChild: true\nanchor:  date_and_time\n---\n\n## Date and Time {#date_and_time_title}\n\nPHP has a class named DateTime to help you when reading, writing, comparing or calculating with date and time. There\nare many date and time related functions in PHP besides DateTime, but it provides nice object-oriented interface to\nmost common uses. DateTime can handle time zones, but that is outside the scope of this short introduction.\n\nTo start working with DateTime, convert raw date and time string to an object with `createFromFormat()` factory method\nor do `new DateTime` to get the current date and time. Use `format()` method to convert DateTime back to a string for\noutput.\n\n{% highlight php %}\n<?php\n$raw = '22. 11. 1968';\n$start = DateTime::createFromFormat('d. m. Y', $raw);\n\necho 'Start date: ' . $start->format('Y-m-d') . PHP_EOL;\n{% endhighlight %}\n\nCalculating with DateTime is possible with the DateInterval class. DateTime has methods like `add()` and `sub()` that\ntake a DateInterval as an argument. Do not write code that expects the same number of seconds in every day. Both daylight\nsaving and time zone alterations will break that assumption. Use date intervals instead. To calculate date difference\nuse the `diff()` method. It will return new DateInterval, which is super easy to display.\n\n{% highlight php %}\n<?php\n// create a copy of $start and add one month and 6 days\n$end = clone $start;\n$end->add(new DateInterval('P1M6D'));\n\n$diff = $end->diff($start);\necho 'Difference: ' . $diff->format('%m month, %d days (total: %a days)') . PHP_EOL;\n// Difference: 1 month, 6 days (total: 37 days)\n{% endhighlight %}\n\nYou can use standard comparisons on DateTime objects:\n\n{% highlight php %}\n<?php\nif ($start < $end) {\n    echo \"Start is before the end!\" . PHP_EOL;}\n{% endhighlight %}\n\nOne last example to demonstrate the DatePeriod class. It is used to iterate over recurring events. It can take two\nDateTime objects, start and end, and the interval for which it will return all events in between.\n\n{% highlight php %}\n<?php\n// output all thursdays between $start and $end\n$periodInterval = DateInterval::createFromDateString('first thursday');\n$periodIterator = new DatePeriod($start, $periodInterval, $end, DatePeriod::EXCLUDE_START_DATE);\nforeach ($periodIterator as $date) {\n    // output each date in the period\n    echo $date->format('Y-m-d') . ' ';\n}\n{% endhighlight %}\n\nA popular PHP API extension is [Carbon](https://carbon.nesbot.com/). It inherits everything in the DateTime class, so involves minimal code alterations, but extra features include Localization support, further ways to add, subtract and format a DateTime object, plus a means to test your code by simulating a date and time of your choosing.\n\n* [Read about DateTime][datetime]\n* [Read about date formatting][dateformat] (accepted date format string options)\n\n[datetime]: https://www.php.net/book.datetime\n[dateformat]: https://www.php.net/function.date\n"
  },
  {
    "path": "_posts/05-04-01-Design-Patterns.md",
    "content": "---\nisChild: true\nanchor:  design_patterns\n---\n\n## Design Patterns {#design_patterns_title}\n\nWhen you are building your application it is helpful to use common patterns in your code and common patterns for the\noverall structure of your project. Using common patterns is helpful because it makes it much easier to manage your code\nand lets other developers quickly understand how everything fits together.\n\nIf you use a framework then most of the higher level code and project structure will be based on that framework, so a\nlot of the pattern decisions are made for you. But it is still up to you to pick out the best patterns to follow in the\ncode you build on top of the framework. If, on the other hand, you are not using a framework to build your application\nthen you have to find the patterns that best suit the type and size of application that you're building.\n\nYou can learn more about PHP design patterns and see working examples at:\n\n* <https://refactoring.guru/design-patterns/php>\n* [https://designpatternsphp.readthedocs.io/](https://designpatternsphp.readthedocs.io/en/latest/) ([PDF download](https://www.computer-pdf.com/web-programming/php/924-tutorial-designpatternsphp-documentation.html))\n"
  },
  {
    "path": "_posts/05-05-01-PHP-and-UTF8.md",
    "content": "---\ntitle:   Working with UTF-8\nisChild: true\nanchor:  php_and_utf8\n---\n\n## Working with UTF-8 {#php_and_utf8_title}\n\n_This section was originally written by [Alex Cabal](https://alexcabal.com/) over at\n[PHP Best Practices](https://phpbestpractices.org/#utf-8) and has been used as the basis for our own UTF-8 advice_.\n\n### There's no one-liner. Be careful, detailed, and consistent.\n\nRight now PHP does not support Unicode at a low level. There are ways to ensure that UTF-8 strings are processed OK,\nbut it's not easy, and it requires digging in to almost all levels of the web app, from HTML to SQL to PHP. We'll aim\nfor a brief, practical summary.\n\n### UTF-8 at the PHP level\n\nThe basic string operations, like concatenating two strings and assigning strings to variables, don't need anything\nspecial for UTF-8. However, most string functions, like `strpos()` and `strlen()`, do need special consideration. These\nfunctions often have an `mb_*` counterpart: for example, `mb_strpos()` and `mb_strlen()`. These `mb_*` strings are made\navailable to you via the [Multibyte String Extension], and are specifically designed to operate on Unicode strings.\n\nYou must use the `mb_*` functions whenever you operate on a Unicode string. For example, if you use `substr()` on a\nUTF-8 string, there's a good chance the result will include some garbled half-characters. The correct function to use\nwould be the multibyte counterpart, `mb_substr()`.\n\nThe hard part is remembering to use the `mb_*` functions at all times. If you forget even just once, your Unicode\nstring has a chance of being garbled during further processing.\n\nNot all string functions have an `mb_*` counterpart. If there isn't one for what you want to do, then you might be out\nof luck.\n\nYou should use the `mb_internal_encoding()` function at the top of every PHP script you write (or at the top of your\nglobal include script), and the `mb_http_output()` function right after it if your script is outputting to a browser.\nExplicitly defining the encoding of your strings in every script will save you a lot of headaches down the road.\n\nAdditionally, many PHP functions that operate on strings have an optional parameter letting you specify the character\nencoding. You should always explicitly indicate UTF-8 when given the option. For example, `htmlentities()` has an\noption for character encoding, and you should always specify UTF-8 if dealing with such strings. Note that as of PHP 5.4.0, UTF-8 is the default encoding for `htmlentities()` and `htmlspecialchars()`.\n\nFinally, If you are building a distributed application and cannot be certain that the `mbstring` extension will be\nenabled, then consider using the [symfony/polyfill-mbstring] Composer package. This will use `mbstring` if it is available, and\nfall back to non UTF-8 functions if not.\n\n[Multibyte String Extension]: https://www.php.net/book.mbstring\n[symfony/polyfill-mbstring]: https://packagist.org/packages/symfony/polyfill-mbstring\n\n### UTF-8 at the Database level\n\nIf your PHP script accesses MySQL, there's a chance your strings could be stored as non-UTF-8 strings in the database\neven if you follow all of the precautions above.\n\nTo make sure your strings go from PHP to MySQL as UTF-8, make sure your database and tables are all set to the\n`utf8mb4` character set and collation, and that you use the `utf8mb4` character set in the PDO connection string. See\nexample code below. This is _critically important_.\n\nNote that you must use the `utf8mb4` character set for complete UTF-8 support, not the `utf8` character set! See\nFurther Reading for why.\n\n### UTF-8 at the browser level\n\nUse the `mb_http_output()` function to ensure that your PHP script outputs UTF-8 strings to your browser.\n\nThe browser will then need to be told by the HTTP response that this page should be considered as UTF-8. Today, it is common to set the character set in the HTTP response header like this:\n\n{% highlight php %}\n<?php\nheader('Content-Type: text/html; charset=UTF-8')\n{% endhighlight %}\n\nThe historic approach to doing that was to include the [charset `<meta>` tag](http://htmlpurifier.org/docs/enduser-utf8.html) in your page's `<head>` tag.\n\n{% highlight php %}\n<?php\n// Tell PHP that we're using UTF-8 strings until the end of the script\nmb_internal_encoding('UTF-8');\n$utf_set = ini_set('default_charset', 'utf-8');\nif (!$utf_set) {\n    throw new Exception('could not set default_charset to utf-8, please ensure it\\'s set on your system!');\n}\n\n// Tell PHP that we'll be outputting UTF-8 to the browser\nmb_http_output('UTF-8');\n \n// Our UTF-8 test string\n$string = 'Êl síla erin lû e-govaned vîn.';\n\n// Transform the string in some way with a multibyte function\n// Note how we cut the string at a non-Ascii character for demonstration purposes\n$string = mb_substr($string, 0, 15);\n\n// Connect to a database to store the transformed string\n// See the PDO example in this document for more information\n// Note the `charset=utf8mb4` in the Data Source Name (DSN)\n$link = new PDO(\n    'mysql:host=your-hostname;dbname=your-db;charset=utf8mb4',\n    'your-username',\n    'your-password',\n    array(\n        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n        PDO::ATTR_PERSISTENT => false\n    )\n);\n\n// Store our transformed string as UTF-8 in our database\n// Your DB and tables are in the utf8mb4 character set and collation, right?\n$handle = $link->prepare('insert into ElvishSentences (Id, Body, Priority) values (default, :body, :priority)');\n$handle->bindParam(':body', $string, PDO::PARAM_STR);\n$priority = 45;\n$handle->bindParam(':priority', $priority, PDO::PARAM_INT); // explicitly tell pdo to expect an int\n$handle->execute();\n\n// Retrieve the string we just stored to prove it was stored correctly\n$handle = $link->prepare('select * from ElvishSentences where Id = :id');\n$id = 7;\n$handle->bindParam(':id', $id, PDO::PARAM_INT);\n$handle->execute();\n\n// Store the result into an object that we'll output later in our HTML\n// This object won't kill your memory because it fetches the data Just-In-Time to\n$result = $handle->fetchAll(\\PDO::FETCH_OBJ);\n\n// An example wrapper to allow you to escape data to html\nfunction escape_to_html($dirty){\n    echo htmlspecialchars($dirty, ENT_QUOTES, 'UTF-8');\n}\n\nheader('Content-Type: text/html; charset=UTF-8'); // Unnecessary if your default_charset is set to utf-8 already\n?><!doctype html>\n<html>\n    <head>\n        <meta charset=\"UTF-8\">\n        <title>UTF-8 test page</title>\n    </head>\n    <body>\n        <?php\n        foreach($result as $row){\n            escape_to_html($row->Body);  // This should correctly output our transformed UTF-8 string to the browser\n        }\n        ?>\n    </body>\n</html>\n{% endhighlight %}\n\n### Further reading\n\n* [PHP Manual: String Operations](https://www.php.net/language.operators.string)\n* [PHP Manual: String Functions](https://www.php.net/ref.strings)\n    * [`strpos()`](https://www.php.net/function.strpos)\n    * [`strlen()`](https://www.php.net/function.strlen)\n    * [`substr()`](https://www.php.net/function.substr)\n* [PHP Manual: Multibyte String Functions](https://www.php.net/ref.mbstring)\n    * [`mb_strpos()`](https://www.php.net/function.mb-strpos)\n    * [`mb_strlen()`](https://www.php.net/function.mb-strlen)\n    * [`mb_substr()`](https://www.php.net/function.mb-substr)\n    * [`mb_internal_encoding()`](https://www.php.net/function.mb-internal-encoding)\n    * [`mb_http_output()`](https://www.php.net/function.mb-http-output)\n    * [`htmlentities()`](https://www.php.net/function.htmlentities)\n    * [`htmlspecialchars()`](https://www.php.net/function.htmlspecialchars)\n* [Stack Overflow: What factors make PHP Unicode-incompatible?](https://stackoverflow.com/questions/571694/what-factors-make-php-unicode-incompatible)\n* [Stack Overflow: Best practices in PHP and MySQL with international strings](https://stackoverflow.com/questions/140728/best-practices-in-php-and-mysql-with-international-strings)\n* [How to support full Unicode in MySQL databases](https://mathiasbynens.be/notes/mysql-utf8mb4)\n* [Bringing Unicode to PHP with Portable UTF-8](https://www.sitepoint.com/bringing-unicode-to-php-with-portable-utf8/)\n* [Stack Overflow: DOMDocument loadHTML does not encode UTF-8 correctly](https://stackoverflow.com/questions/8218230/php-domdocument-loadhtml-not-encoding-utf-8-correctly)\n"
  },
  {
    "path": "_posts/05-06-01-Internationalization-and-Localization.md",
    "content": "---\ntitle:   Internationalization and Localization\nisChild: true\nanchor:  i18n_l10n\n---\n\n## Internationalization (i18n) and Localization (l10n) {#i18n_l10n_title}\n\n_Disclaimer for newcomers: i18n and l10n are numeronyms, a kind of abbreviation where numbers are used to shorten\nwords - in our case, internationalization becomes i18n and localization, l10n._\n\nFirst of all, we need to define those two similar concepts and other related things:\n\n- **Internationalization** is when you organize your code so it can be adapted to different languages or regions\nwithout refactorings. This action is usually done once - preferably, at the beginning of the project, or else you will\nprobably need some huge changes in the source!\n- **Localization** happens when you adapt the interface (mainly) by translating contents, based on the i18n work done\nbefore. It usually is done every time a new language or region needs support and is updated when new interface pieces\nare added, as they need to be available in all supported languages.\n- **Pluralization** defines the rules required between distinct languages to interoperate strings containing numbers and \ncounters. For instance, in English when you have only one item, it is singular, and anything different from that is \ncalled plural; plural in this language is indicated by adding an S after some words, and sometimes changes parts of it.\nIn other languages, such as Russian or Serbian, there are two plural forms in addition to the singular - you may even\nfind languages with a total of four, five or six forms, such as Slovenian, Irish or Arabic.\n\n## Common ways to implement\nThe easiest way to internationalize PHP software is by using array files and using those strings in templates, such as\n`<h1><?=$TRANS['title_about_page']?></h1>`. This way is, however, hardly recommended for serious projects, as it poses\nsome maintenance issues along the road - some might appear in the very beginning, such as pluralization. So, please,\ndon't try this if your project will contain more than a couple of pages.\n\nThe most classic way and often taken as reference for i18n and l10n is a [Unix tool called `gettext`][gettext]. It dates\nback to 1995 and is still a complete implementation for translating software. It is easy enough to get running, while\nstill sporting powerful supporting tools. It is about Gettext we will be talking here. Also, to help you not get messy\nover the command-line, we will be presenting a great GUI application that can be used to easily update your l10n source.\n\n### Other tools\n\nThere are common libraries used that support Gettext and other implementations of i18n. Some of them may seem easier to\ninstall or sport additional features or i18n file formats. In this document, we focus on the tools provided with the\nPHP core, but here we list others for completion:\n\n- [aura/intl][aura-intl]: Provides internationalization (I18N) tools, specifically package-oriented per-locale message\ntranslation. It uses array formats for messages. Does not provide a message extractor, but does provide advanced\nmessage formatting via the `intl` extension (including pluralized messages).\n- [php-gettext/Gettext][php-gettext]: Gettext support with an OO interface; includes improved helper functions, powerful\nextractors for several file formats (some of them not supported natively by the `gettext` command), and can also export\nto other formats besides `.mo/.po` files. Can be useful if you need to integrate your translation files into other\nparts of the system, like a JavaScript interface.\n- [symfony/translation][symfony]: supports a lot of different formats, but recommends using verbose XLIFF's. Doesn't\ninclude helper functions nor a built-in extractor, but supports placeholders using `strtr()` internally.\n- [laminas/laminas-i18n][laminas]: supports array and INI files, or Gettext formats. Implements a caching layer to save you from\nreading the filesystem every time. It also includes view helpers, and locale-aware input filters and validators.\nHowever, it has no message extractor.\n\nOther frameworks also include i18n modules, but those are not available outside of their codebases:\n\n- [Laravel] supports basic array files, has no automatic extractor but includes a `@lang` helper for template files.\n- [Yii] supports array, Gettext, and database-based translation, and includes a messages extractor. It is backed by the\n[`Intl`][intl] extension, available since PHP 5.3, and based on the [ICU project]; this enables Yii to run powerful\nreplacements, like spelling out numbers, formatting dates, times, intervals, currency, and ordinals.\n\nIf you decide to go for one of the libraries that provide no extractors, you may want to use the gettext formats, so\nyou can use the original gettext toolchain (including Poedit) as described in the rest of the chapter.\n\n## Gettext\n\n### Installation\nYou might need to install Gettext and the related PHP library by using your package manager, like `apt-get` or `yum`.\nAfter installed, enable it by adding `extension=gettext.so` (Linux/Unix) or `extension=php_gettext.dll` (Windows) to\nyour `php.ini`.\n\nHere we will also be using [Poedit] to create translation files. You will probably find it in your system's package\nmanager; it is available for Unix, macOS, and Windows, and can be [downloaded for free on their website][poedit_download]\nas well.\n\n### Structure\n\n#### Types of files\nThere are three files you usually deal with while working with gettext. The main ones are PO (Portable Object) and\nMO (Machine Object) files, the first being a list of readable \"translated objects\" and the second, the corresponding\nbinary to be interpreted by gettext when doing localization. There's also a POT (Template) file, which simply contains\nall existing keys from your source files, and can be used as a guide to generate and update all PO files. Those template\nfiles are not mandatory: depending on the tool you are using to do l10n, you can go just fine with only PO/MO files.\nYou will always have one pair of PO/MO files per language and region, but only one POT per domain.\n\n### Domains\nThere are some cases, in big projects, where you might need to separate translations when the same words convey \ndifferent meaning given a context. In those cases, you split them into different _domains_. They are, basically, named\ngroups of POT/PO/MO files, where the filename is the said _translation domain_. Small and medium-sized projects usually,\nfor simplicity, use only one domain; its name is arbitrary, but we will be using \"main\" for our code samples.\nIn [Symfony] projects, for example, domains are used to separate the translation for validation messages.\n\n#### Locale code\nA locale is simply a code that identifies one version of a language. It is defined following the [ISO 639-1][639-1] and \n[ISO 3166-1 alpha-2][3166-1] specs: two lower-case letters for the language, optionally followed by an underline and two\nupper-case letters identifying the country or regional code. For [rare languages][rare], three letters are used.\n\nFor some speakers, the country part may seem redundant. In fact, some languages have dialects in different\ncountries, such as Austrian German (`de_AT`) or Brazilian Portuguese (`pt_BR`). The second part is used to distinguish\nbetween those dialects - when it is not present, it is taken as a \"generic\" or \"hybrid\" version of the language.\n\n### Directory structure\nTo use Gettext, we will need to adhere to a specific structure of folders. First, you will need to select an arbitrary\nroot for your l10n files in your source repository. Inside it, you will have a folder for each needed locale, and a\nfixed `LC_MESSAGES` folder that will contain all your PO/MO pairs. Example:\n\n{% highlight console %}\n<project root>\n ├─ src/\n ├─ templates/\n └─ locales/\n    ├─ forum.pot\n    ├─ site.pot\n    ├─ de/\n    │  └─ LC_MESSAGES/\n    │     ├─ forum.mo\n    │     ├─ forum.po\n    │     ├─ site.mo\n    │     └─ site.po\n    ├─ es_ES/\n    │  └─ LC_MESSAGES/\n    │     └─ ...\n    ├─ fr/\n    │  └─ ...\n    ├─ pt_BR/\n    │  └─ ...\n    └─ pt_PT/\n       └─ ...\n{% endhighlight %}\n\n### Plural forms\nAs we said in the introduction, different languages might sport different plural rules. However, gettext saves us from\nthis trouble once again. When creating a new `.po` file, you will have to declare the [plural rules][plural] for that\nlanguage, and translated pieces that are plural-sensitive will have a different form for each of those rules. When\ncalling Gettext in code, you will have to specify the number related to the sentence, and it will work out the correct\nform to use - even using string substitution if needed.\n\nPlural rules include the number of plurals available and a boolean test with `n` that would define in which rule the\ngiven number falls (starting the count with 0). For example:\n\n- Japanese: `nplurals=1; plural=0` - only one rule\n- English: `nplurals=2; plural=(n != 1);` - two rules, first if N is one, second rule otherwise\n- Brazilian Portuguese: `nplurals=2; plural=(n > 1);` - two rules, second if N is bigger than one, first otherwise\n\nNow that you understood the basis of how plural rules works - and if you didn't, please look at a deeper explanation\non the [LingoHub tutorial][lingohub_plurals] -, you might want to copy the ones you need from a [list][plural] instead\nof writing them by hand.\n\nWhen calling out Gettext to do localization on sentences with counters, you will have to provide it the\nrelated number as well. Gettext will work out what rule should be in effect and use the correct localized version.\nYou will need to include in the `.po` file a different sentence for each plural rule defined.\n\n### Sample implementation\nAfter all that theory, let's get a little practical. Here's an excerpt of a `.po` file - don't mind with its format,\nbut with the overall content instead; you will learn how to edit it easily later:\n\n{% highlight po %}\nmsgid \"\"\nmsgstr \"\"\n\"Language: pt_BR\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Plural-Forms: nplurals=2; plural=(n > 1);\\n\"\n\nmsgid \"We are now translating some strings\"\nmsgstr \"Nós estamos traduzindo algumas strings agora\"\n\nmsgid \"Hello %1$s! Your last visit was on %2$s\"\nmsgstr \"Olá %1$s! Sua última visita foi em %2$s\"\n\nmsgid \"Only one unread message\"\nmsgid_plural \"%d unread messages\"\nmsgstr[0] \"Só uma mensagem não lida\"\nmsgstr[1] \"%d mensagens não lidas\"\n{% endhighlight %}\n\nThe first section works like a header, having the `msgid` and `msgstr` especially empty. It describes the file encoding,\nplural forms and other things that are less relevant.\nThe second section translates a simple string from English to\nBrazilian Portuguese, and the third does the same, but leveraging string replacement from [`sprintf`][sprintf] so the\ntranslation may contain the user name and visit date.\nThe last section is a sample of pluralization forms, displaying\nthe singular and plural version as `msgid` in English and their corresponding translations as `msgstr` 0 and 1\n(following the number given by the plural rule). There, string replacement is used as well so the number can be seen\ndirectly in the sentence, by using `%d`. The plural forms always have two `msgid` (singular and plural), so it is\nadvised not to use a complex language as the source of translation.\n\n### Discussion on l10n keys\nAs you might have noticed, we are using as source ID the actual sentence in English. That `msgid` is the same used\nthroughout all your `.po` files, meaning other languages will have the same format and the same `msgid` fields but\ntranslated `msgstr` lines.\n\nTalking about translation keys, there are two main \"schools\" here:\n\n1. _`msgid` as a real sentence_.\n    The main advantages are:\n    - if there are pieces of the software untranslated in any given language, the key displayed will still maintain some\n    meaning. Example: if you happen to translate by heart from English to Spanish but need help to translate to French,\n    you might publish the new page with missing French sentences, and parts of the website would be displayed in English\n    instead;\n    - it is much easier for the translator to understand what's going on and do a proper translation based on the\n    `msgid`;\n    - it gives you \"free\" l10n for one language - the source one;\n    - The only disadvantage: if you need to change the actual text, you would need to replace the same `msgid`\n    across several language files.\n\n2. _`msgid` as a unique, structured key_.\nIt would describe the sentence role in the application in a structured way, including the template or part where the\nstring is located instead of its content.\n    - it is a great way to have the code organized, separating the text content from the template logic.\n    - however, that could bring problems to the translator that would miss the context. A source language file would be\n    needed as a basis for other translations. Example: the developer would ideally have an `en.po` file, that\n    translators would read to understand what to write in `fr.po` for instance.\n    - missing translations would display meaningless keys on screen (`top_menu.welcome` instead of `Hello there, User!`\n    on the said untranslated French page). That is good it as would force translation to be complete before publishing -\n    however, bad as translation issues would be remarkably awful in the interface. Some libraries, though, include an\n    option to specify a given language as \"fallback\", having a similar behavior as the other approach.\n\nThe [Gettext manual][manual] favors the first approach as, in general, it is easier for translators and users in\ncase of trouble. That is how we will be working here as well. However, the [Symfony documentation][symfony-keys] favors\nkeyword-based translation, to allow for independent changes of all translations without affecting templates as well.\n\n### Everyday usage\nIn a typical application, you would use some Gettext functions while writing static text in your pages. Those sentences\nwould then appear in `.po` files, get translated, compiled into `.mo` files and then, used by Gettext when rendering\nthe actual interface. Given that, let's tie together what we have discussed so far in a step-by-step example:\n\n#### 1. A sample template file, including some different gettext calls\n{% highlight php %}\n<?php include 'i18n_setup.php' ?>\n<div id=\"header\">\n    <h1><?=sprintf(gettext('Welcome, %s!'), $name)?></h1>\n    <!-- code indented this way only for legibility -->\n    <?php if ($unread): ?>\n        <h2><?=sprintf(\n            ngettext('Only one unread message',\n                     '%d unread messages',\n                     $unread),\n            $unread)?>\n        </h2>\n    <?php endif ?>\n</div>\n\n<h1><?=gettext('Introduction')?></h1>\n<p><?=gettext('We\\'re now translating some strings')?></p>\n{% endhighlight %}\n\n- [`gettext()`][func] simply translates a `msgid` into its corresponding `msgstr` for a given language. There's also\nthe shorthand function `_()` that works the same way;\n- [`ngettext()`][n_func] does the same but with plural rules;\n- There are also [`dgettext()`][d_func] and [`dngettext()`][dn_func], that allow you to override the domain for a single\ncall. More on domain configuration in the next example.\n\n#### 2. A sample setup file (`i18n_setup.php` as used above), selecting the correct locale and configuring Gettext\n{% highlight php %}\n<?php\n/**\n * Verifies if the given $locale is supported in the project\n * @param string $locale\n * @return bool\n */\nfunction valid($locale) {\n   return in_array($locale, ['en_US', 'en', 'pt_BR', 'pt', 'es_ES', 'es']);\n}\n\n//setting the source/default locale, for informational purposes\n$lang = 'en_US';\n\nif (isset($_GET['lang']) && valid($_GET['lang'])) {\n    // the locale can be changed through the query-string\n    $lang = $_GET['lang'];    //you should sanitize this!\n    setcookie('lang', $lang); //it's stored in a cookie so it can be reused\n} elseif (isset($_COOKIE['lang']) && valid($_COOKIE['lang'])) {\n    // if the cookie is present instead, let's just keep it\n    $lang = $_COOKIE['lang']; //you should sanitize this!\n} elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n    // default: look for the languages the browser says the user accepts\n    $langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n    array_walk($langs, function (&$lang) { $lang = strtr(strtok($lang, ';'), ['-' => '_']); });\n    foreach ($langs as $browser_lang) {\n        if (valid($browser_lang)) {\n            $lang = $browser_lang;\n            break;\n        }\n    }\n}\n\n// here we define the global system locale given the found language\nputenv(\"LANG=$lang\");\n\n// this might be useful for date functions (LC_TIME) or money formatting (LC_MONETARY), for instance\nsetlocale(LC_ALL, $lang);\n\n// this will make Gettext look for ../locales/<lang>/LC_MESSAGES/main.mo\nbindtextdomain('main', '../locales');\n\n// indicates in what encoding the file should be read\nbind_textdomain_codeset('main', 'UTF-8');\n\n// if your application has additional domains, as cited before, you should bind them here as well\nbindtextdomain('forum', '../locales');\nbind_textdomain_codeset('forum', 'UTF-8');\n\n// here we indicate the default domain the gettext() calls will respond to\ntextdomain('main');\n\n// this would look for the string in forum.mo instead of main.mo\n// echo dgettext('forum', 'Welcome back!');\n?>\n{% endhighlight %}\n\n#### 3. Preparing translation for the first run\nOne of the great advantages Gettext has over custom framework i18n packages is its extensive and powerful file format.\n\"Oh man, that’s quite hard to understand and edit by hand, a simple array would be easier!\" Make no mistake,\napplications like [Poedit] are here to help - _a lot_. You can get the program from [their website][poedit_download],\nit’s free and available for all platforms. It’s a pretty easy tool to get used to, and a very powerful one at the same\ntime - using all features Gettext has available. This guide is based on PoEdit 1.8.\n\nIn the first run, you should select “File > New...” from the menu. You’ll be asked straight ahead for the language:\nhere you can select/filter the language you want to translate to, or use that format we mentioned before, such as\n`en_US` or `pt_BR`.\n\nNow, save the file - using that directory structure we mentioned as well. Then you should click “Extract from sources”,\nand here you’ll configure various settings for the extraction and translation tasks. You’ll be able to find all those\nlater through “Catalog > Properties”:\n\n- Source paths: here you must include all folders from the project where `gettext()` (and siblings) are called - this\nis usually your templates/views folder(s). This is the only mandatory setting;\n- Translation properties:\n    - Project name and version, Team and Team’s email address: useful information that goes in the .po file header;\n    - Plural forms: here go those rules we mentioned before - there’s a link in there with samples as well. You can\n    leave it with the default option most of the time, as PoEdit already includes a handy database of plural rules for\n    many languages.\n    - Charsets: UTF-8, preferably;\n    - Source code charset: set here the charset used by your codebase - probably UTF-8 as well, right?\n- Source keywords: The underlying software knows how `gettext()` and similar function calls look like in several\nprogramming languages, but you might as well create your own translation functions. It will be here you’ll add those\nother methods. This will be discussed later in the “Tips” section.\n\nAfter setting those points it will run a scan through your source files to find all the localization calls. After every\nscan PoEdit will display a summary of what was found and what was removed from the source files. New entries will fed\nempty into the translation table, and you’ll start typing in the localized versions of those strings. Save it and a .mo\nfile will be (re)compiled into the same folder and ta-dah: your project is internationalized.\n\n#### 4. Translating strings\nAs you may have noticed before, there are two main types of localized strings: simple ones and those with plural\nforms. The first ones have simply two boxes: source and localized string. The source string cannot be modified as\nGettext/Poedit do not include the powers to alter your source files - you should change the source itself and rescan\nthe files. Tip: you may right-click a translation line and it will hint you with the source files and lines where that\nstring is being used.\nOn the other hand, plural form strings include two boxes to show the two source strings, and tabs so you can configure\nthe different final forms.\n\nWhenever you change your sources and need to update the translations, just hit Refresh and Poedit will rescan the code,\nremoving non-existent entries, merging the ones that changed and adding new ones. It may also try to guess some\ntranslations, based on other ones you did. Those guesses and the changed entries will receive a \"Fuzzy\" marker,\nindicating it needs review, appearing golden in the list. It is also useful if you have a translation team and someone\ntries to write something they are not sure about: just mark Fuzzy, and someone else will review later.\n\nFinally, it is advised to leave \"View > Untranslated entries first\" marked, as it will help you _a lot_ to not forget\nany entry. From that menu, you can also open parts of the UI that allow you to leave contextual information for\ntranslators if needed.\n\n### Tips & Tricks\n\n#### Possible caching issues\nIf you are running PHP as a module on Apache (`mod_php`), you might face issues with the `.mo` file being cached. It\nhappens the first time it is read, and then, to update it, you might need to restart the server. On Nginx and PHP5 it\nusually takes only a couple of page refreshes to refresh the translation cache, and on PHP7 it is rarely needed.\n\n#### Additional helper functions\nAs preferred by many people, it is easier to use `_()` instead of `gettext()`. Many custom i18n libraries from\nframeworks use something similar to `t()` as well, to make translated code shorter. However, that is the only function\nthat sports a shortcut. You might want to add in your project some others, such as `__()` or `_n()` for `ngettext()`,\nor maybe a fancy `_r()` that would join `gettext()` and `sprintf()` calls. Other libraries, such as\n[php-gettext's Gettext][php-gettext] also provide helper functions like these.\n\nIn those cases, you'll need to instruct the Gettext utility on how to extract the strings from those new functions.\nDon't be afraid; it is very easy. It is just a field in the `.po` file, or a Settings screen on Poedit. In the editor,\nthat option is inside \"Catalog > Properties > Source keywords\". Remember: Gettext already knows the default functions\nfor many languages, so don’t be afraid if that list seems empty. You need to include there the specifications of those\nnew functions, following [a specific format][func_format]:\n\n- if you create something like `t()` that simply returns the translation for a string, you can specify it as `t`.\nGettext will know the only function argument is the string to be translated;\n- if the function has more than one argument, you can specify in which one the first string is - and if needed, the\nplural form as well. For instance, if we call our function like this: `__('one user', '%d users', $number)`, the\nspecification would be `__:1,2`, meaning the first form is the first argument, and the second form is the second\nargument. If your number comes as the first argument instead, the spec would be `__:2,3`, indicating the first form is\nthe second argument, and so on.\n\nAfter including those new rules in the `.po` file, a new scan will bring in your new strings just as easy as before.\n\n### References\n\n* [Wikipedia: i18n and l10n](https://en.wikipedia.org/wiki/Internationalization_and_localization)\n* [Wikipedia: Gettext](https://en.wikipedia.org/wiki/Gettext)\n* [LingoHub: PHP internationalization with gettext tutorial][lingohub]\n* [PHP Manual: Gettext](https://www.php.net/manual/book.gettext.php)\n* [Gettext Manual][manual]\n\n[Poedit]: https://poedit.net\n[poedit_download]: https://poedit.net/download\n[lingohub]: https://lingohub.com/blog/2013/07/php-internationalization-with-gettext-tutorial/\n[lingohub_plurals]: https://lingohub.com/blog/2013/07/php-internationalization-with-gettext-tutorial/#Plurals\n[plural]: https://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html\n[gettext]: https://en.wikipedia.org/wiki/Gettext\n[manual]: https://www.gnu.org/software/gettext/manual/gettext.html\n[639-1]: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\n[3166-1]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\n[rare]: https://www.gnu.org/software/gettext/manual/gettext.html#Rare-Language-Codes\n[func_format]: https://www.gnu.org/software/gettext/manual/gettext.html#Language-specific-options\n[aura-intl]: https://github.com/auraphp/Aura.Intl\n[php-gettext]: https://github.com/php-gettext/Gettext\n[symfony]: https://symfony.com/components/Translation\n[laminas]: https://docs.laminas.dev/laminas-i18n/\n[laravel]: https://laravel.com/docs/master/localization\n[yii]: https://www.yiiframework.com/doc/guide/2.0/en/tutorial-i18n\n[intl]: https://www.php.net/manual/intro.intl.php\n[ICU project]: https://icu.unicode.org/\n[symfony-keys]: https://symfony.com/doc/current/translation.html#using-real-or-keyword-messages\n\n[sprintf]: https://www.php.net/manual/function.sprintf.php\n[func]: https://www.php.net/manual/function.gettext.php\n[n_func]: https://www.php.net/manual/function.ngettext.php\n[d_func]: https://www.php.net/manual/function.dgettext.php\n[dn_func]: https://www.php.net/manual/function.dngettext.php\n"
  },
  {
    "path": "_posts/06-01-01-Dependency-Injection.md",
    "content": "---\ntitle:  Dependency Injection\nanchor: dependency_injection\n---\n\n# Dependency Injection {#dependency_injection_title}\n\nFrom [Wikipedia](https://wikipedia.org/wiki/Dependency_injection):\n\n> Dependency injection is a software design pattern that allows the removal of hard-coded dependencies and makes it\n> possible to change them, whether at run-time or compile-time.\n\nThis quote makes the concept sound much more complicated than it actually is. Dependency Injection is providing a\ncomponent with its dependencies either through constructor injection, method calls or the setting of properties. It is\nthat simple.\n"
  },
  {
    "path": "_posts/06-02-01-Basic-Concept.md",
    "content": "---\nisChild: true\nanchor:  basic_concept\n---\n\n## Basic Concept {#basic_concept_title}\n\nWe can demonstrate the concept with a simple, yet naive example.\n\nHere we have a `Database` class that requires an adapter to speak to the database. We instantiate the adapter in the\nconstructor and create a hard dependency. This makes testing difficult and means the `Database` class is very tightly\ncoupled to the adapter.\n\n{% highlight php %}\n<?php\nnamespace Database;\n\nclass Database\n{\n    protected $adapter;\n\n    public function __construct()\n    {\n        $this->adapter = new MySqlAdapter;\n    }\n}\n\nclass MysqlAdapter {}\n{% endhighlight %}\n\nThis code can be refactored to use Dependency Injection and therefore loosen the dependency.\nHere, we inject the dependency in a constructor and use the [constructor property promotion][php-constructor-promotion] so it is available as a property across the class:\n\n{% highlight php %}\n<?php\nnamespace Database;\n\nclass Database\n{\n    public function __construct(protected MySqlAdapter $adapter)\n    {\n    }\n}\n\nclass MysqlAdapter {}\n{% endhighlight %}\n\nNow we are giving the `Database` class its dependency rather than creating it itself. We could even create a method\nthat would accept an argument of the dependency and set it that way, or if the `$adapter` property was `public` we\ncould set it directly.\n\n[php-constructor-promotion]: https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor.promotion\n"
  },
  {
    "path": "_posts/06-03-01-Complex-Problem.md",
    "content": "---\nisChild: true\nanchor:  complex_problem\n---\n\n## Complex Problem {#complex_problem_title}\n\nIf you have ever read about Dependency Injection then you have probably seen the terms *\"Inversion of Control\"* or\n*\"Dependency Inversion Principle\"*. These are the complex problems that Dependency Injection solves.\n\n### Inversion of Control\n\nInversion of Control is as it says, \"inverting the control\" of a system by keeping organizational control entirely\nseparate from our objects. In terms of Dependency Injection, this means loosening our dependencies by controlling and\ninstantiating them elsewhere in the system.\n\nFor years, PHP frameworks have been achieving Inversion of Control, however, the question became, which part of control\nare we inverting, and where to? For example, MVC frameworks would generally provide a super object or base controller\nthat other controllers must extend to gain access to its dependencies. This **is** Inversion of Control, however,\ninstead of loosening dependencies, this method simply moved them.\n\nDependency Injection allows us to more elegantly solve this problem by only injecting the dependencies we need, when we\nneed them, without the need for any hard coded dependencies at all.\n\n### S.O.L.I.D.\n\n#### Single Responsibility Principle\n\nThe Single Responsibility Principle is about actors and high-level architecture. It states that “A class should have\nonly one reason to change.” This means that every class should _only_ have responsibility over a single part of the\nfunctionality provided by the software. The largest benefit of this approach is that it enables improved code\n_reusability_. By designing our class to do just one thing, we can use (or re-use) it in any other program without\nchanging it.\n\n#### Open/Closed Principle\n\nThe Open/Closed Principle is about class design and feature extensions. It states that “Software entities (classes,\nmodules, functions, etc.) should be open for extension, but closed for modification.” This means that we should design\nour modules, classes and functions in a way that when a new functionality is needed, we should not modify our existing\ncode but rather write new code that will be used by existing code. Practically speaking, this means that we should write\nclasses that implement and adhere to _interfaces_, then type-hint against those interfaces instead of specific classes.\n\nThe largest benefit of this approach is that we can very easily extend our code with support for something new without\nhaving to modify existing code, meaning that we can reduce QA time, and the risk for negative impact to the application\nis substantially reduced. We can deploy new code, faster, and with more confidence.\n\n#### Liskov Substitution Principle\n\nThe Liskov Substitution Principle is about subtyping and inheritance. It states that “Child classes should never break\nthe parent class’ type definitions.” Or, in Robert C. Martin’s words, “Subtypes must be substitutable for their base\ntypes.”\n\nFor example, if we have a `FileInterface` interface which defines an `embed()` method, and we have `Audio` and `Video`\nclasses which both implement the `FileInterface` interface, then we can expect that the usage of the `embed()` method will always\ndo the thing that we intend. If we later create a `PDF` class or a `Gist` class which implement the `FileInterface`\ninterface, we will already know and understand what the `embed()` method will do. The largest benefit of this approach\nis that we have the ability to build flexible and easily-configurable programs, because when we change one object of a\ntype (e.g., `FileInterface`) to another we don't need to change anything else in our program.\n\n#### Interface Segregation Principle\n\nThe Interface Segregation Principle (ISP) is about _business-logic-to-clients_ communication. It states that “No client\nshould be forced to depend on methods it does not use.” This means that instead of having a single monolithic interface\nthat all conforming classes need to implement, we should instead provide a set of smaller, concept-specific interfaces\nthat a conforming class implements one or more of.\n\nFor example, a `Car` or `Bus` class would be interested in a `steeringWheel()` method, but a `Motorcycle` or `Tricycle`\nclass would not. Conversely, a `Motorcycle` or `Tricycle` class would be interested in a `handlebars()` method, but a\n`Car` or `Bus` class would not. There is no need to have all of these types of vehicles implement support for both\n`steeringWheel()` as well as `handlebars()`, so we should break-apart the source interface.\n\n#### Dependency Inversion Principle\n\nThe Dependency Inversion Principle is about removing hard-links between discrete classes so that new functionality can\nbe leveraged by passing a different class. It states that one should *\"Depend on Abstractions. Do not depend on\nconcretions.\"*. Put simply, this means our dependencies should be interfaces/contracts or abstract classes rather than\nconcrete implementations. We can easily refactor the above example to follow this principle.\n\n{% highlight php %}\n<?php\nnamespace Database;\n\nclass Database\n{\n    public function __construct(protected AdapterInterface $adapter)\n    {\n    }\n}\n\ninterface AdapterInterface {}\n\nclass MysqlAdapter implements AdapterInterface {}\n{% endhighlight %}\n\nThere are several benefits to the `Database` class now depending on an interface rather than a concretion.\n\nConsider that we are working in a team and the adapter is being worked on by a colleague. In our first example, we\nwould have to wait for said colleague to finish the adapter before we could properly mock it for our unit tests. Now\nthat the dependency is an interface/contract we can happily mock that interface knowing that our colleague will build\nthe adapter based on that contract.\n\nAn even bigger benefit to this method is that our code is now much more scalable. If a year down the line we decide\nthat we want to migrate to a different type of database, we can write an adapter that implements the original interface\nand injects that instead, no more refactoring would be required as we can ensure that the adapter follows the contract\nset by the interface.\n"
  },
  {
    "path": "_posts/06-04-01-Containers.md",
    "content": "---\nisChild: true\nanchor:  containers\n---\n\n## Containers {#containers_title}\n\nThe first thing you should understand about Dependency Injection Containers is that they are not the same thing as\nDependency Injection. A container is a convenience utility that helps us implement Dependency Injection, however, they\ncan be and often are misused to implement an anti-pattern, Service Location. Injecting a DI container as a Service\nLocator in to your classes arguably creates a harder dependency on the container than the dependency you are replacing.\nIt also makes your code much less transparent and ultimately harder to test.\n\nMost modern frameworks have their own Dependency Injection Container that allows you to wire your dependencies together\nthrough configuration. What this means in practice is that you can write application code that is as clean and\nde-coupled as the framework it is built on.\n"
  },
  {
    "path": "_posts/06-05-01-Further-Reading.md",
    "content": "---\nisChild: true\nanchor:  further_reading\n---\n\n## Further Reading {#further_reading_title}\n\n* [What is Dependency Injection?](http://fabien.potencier.org/what-is-dependency-injection.html)\n* [Dependency Injection: An analogy](https://mwop.net/blog/260-Dependency-Injection-An-analogy.html)\n* [Dependency Injection: Huh?](https://code.tutsplus.com/tutorials/dependency-injection-huh--net-26903)\n* [Dependency Injection as a tool for testing](https://medium.com/philipobenito/dependency-injection-as-a-tool-for-testing-902c21c147f1)\n"
  },
  {
    "path": "_posts/07-01-01-Databases.md",
    "content": "---\ntitle:  Databases\nanchor: databases\n---\n\n# Databases {#databases_title}\n\nMany times your PHP code will use a database to persist information. You have a few options to connect and interact\nwith your database. The recommended option **until PHP 5.1.0** was to use native drivers such as [mysqli], [pgsql],\n[mssql], etc.\n\nNative drivers are great if you are only using _one_ database in your application, but if, for example, you are using\nMySQL and a little bit of MSSQL, or you need to connect to an Oracle database, then you will not be able to use the\nsame drivers. You'll need to learn a brand new API for each database &mdash; and that can get silly.\n\n\n[mysqli]: https://www.php.net/mysqli\n[pgsql]: https://www.php.net/pgsql\n[mssql]: https://www.php.net/mssql\n"
  },
  {
    "path": "_posts/07-02-01-Databases_MySQL.md",
    "content": "---\nisChild: true\ntitle:   MySQL Extension\nanchor:  mysql_extension\n---\n\n## MySQL Extension {#mysql_extension_title}\n\nThe [mysql] extension for PHP is incredibly old and has been superseded by two other extensions:\n\n- [mysqli]\n- [pdo]\n\nNot only did development stop long ago on [mysql], but it\n**has been [officially removed in PHP 7.0][mysql_removed]**.\n\nTo save digging into your `php.ini` settings to see which module you are using, one option is to search for `mysql_*`\nin your editor of choice. If any functions such as `mysql_connect()` and `mysql_query()` show up, then `mysql` is\nin use.\n\nEven if you are not using PHP 7.x or later yet, failing to consider this upgrade as soon as possible will lead to greater\nhardship when the PHP upgrade does come about. The best option is to replace mysql usage with [mysqli] or [PDO] in\nyour applications within your own development schedules so you won't be rushed later on.\n\n**If you are upgrading from [mysql] to [mysqli], beware lazy upgrade guides that suggest you can simply find and replace `mysql_*` with `mysqli_*`. Not only is that a gross oversimplification, it misses out on the advantages that mysqli provides, such as parameter binding, which is also offered in [PDO][pdo].**\n\n* [MySQLi Prepared Statements][mysqli_prepared_statements]\n* [PHP: Choosing an API for MySQL][mysql_api]\n\n[mysql]: https://www.php.net/mysqli\n[mysql_removed]: https://www.php.net/manual/migration70.removed-exts-sapis.php\n[mysqli]: https://www.php.net/mysqli\n[pdo]: https://www.php.net/pdo\n[mysql_api]: https://www.php.net/mysqlinfo.api.choosing\n[mysqli_prepared_statements]: https://websitebeaver.com/prepared-statements-in-php-mysqli-to-prevent-sql-injection\n"
  },
  {
    "path": "_posts/07-03-01-Databases_PDO.md",
    "content": "---\nisChild: true\ntitle:   PDO Extension\nanchor:  pdo_extension\n---\n\n## PDO Extension {#pdo_extension_title}\n\n[PDO] is a database connection abstraction library &mdash; built into PHP since 5.1.0 &mdash; that provides a common\ninterface to talk with many different databases. For example, you can use basically identical code to interface with\nMySQL or SQLite:\n\n{% highlight php %}\n<?php\n// PDO + MySQL\n$pdo = new PDO('mysql:host=example.com;dbname=database', 'user', 'password');\n$statement = $pdo->query(\"SELECT some_field FROM some_table\");\n$row = $statement->fetch(PDO::FETCH_ASSOC);\necho htmlentities($row['some_field']);\n\n// PDO + SQLite\n$pdo = new PDO('sqlite:/path/db/foo.sqlite');\n$statement = $pdo->query(\"SELECT some_field FROM some_table\");\n$row = $statement->fetch(PDO::FETCH_ASSOC);\necho htmlentities($row['some_field']);\n{% endhighlight %}\n\nPDO will not translate your SQL queries or emulate missing features; it is purely for connecting to multiple types of\ndatabase with the same API.\n\nMore importantly, `PDO` allows you to safely inject foreign input (e.g. IDs) into your SQL queries without worrying\nabout database SQL injection attacks.\nThis is possible using PDO statements and bound parameters.\n\nLet's assume a PHP script receives a numeric ID as a query parameter. This ID should be used to fetch a user record\nfrom a database. This is the `wrong` way to do this:\n\n{% highlight php %}\n<?php\n$pdo = new PDO('sqlite:/path/db/users.db');\n$pdo->query(\"SELECT name FROM users WHERE id = \" . $_GET['id']); // <-- NO!\n{% endhighlight %}\n\nThis is terrible code. You are inserting a raw query parameter into a SQL query. This will get you hacked in a\nheartbeat, using a practice called [SQL Injection]. Just imagine if a hacker passes in an inventive `id` parameter by\ncalling a URL like `http://domain.com/?id=1%3BDELETE+FROM+users`. This will set the `$_GET['id']` variable to `1;DELETE\nFROM users` which will delete all of your users! Instead, you should sanitize the ID input using PDO bound parameters.\n\n{% highlight php %}\n<?php\n$pdo = new PDO('sqlite:/path/db/users.db');\n$stmt = $pdo->prepare('SELECT name FROM users WHERE id = :id');\n$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT); // <-- filter your data first (see [Data Filtering](#data_filtering)), especially important for INSERT, UPDATE, etc.\n$stmt->bindParam(':id', $id, PDO::PARAM_INT); // <-- Automatically sanitized for SQL by PDO\n$stmt->execute();\n{% endhighlight %}\n\nThis is correct code. It uses a bound parameter on a PDO statement. This escapes the foreign input ID before it is\nintroduced to the database preventing potential SQL injection attacks.\n\nFor writes, such as INSERT or UPDATE, it's especially critical to still [filter your data](#data_filtering) first and sanitize it for other things (removal of HTML tags, JavaScript, etc).  PDO will only sanitize it for SQL, not for your application.\n\n* [Learn about PDO][pdo]\n\nYou should also be aware that database connections use up resources and it was not unheard-of to have resources\nexhausted if connections were not implicitly closed, however this was more common in other languages. Using PDO you can\nimplicitly close the connection by destroying the object by ensuring all remaining references to it are deleted, i.e.\nset to NULL. If you don't do this explicitly, PHP will automatically close the connection when your script ends -\nunless of course you are using persistent connections.\n\n* [Learn about PDO connections]\n\n\n[pdo]: https://www.php.net/pdo\n[SQL Injection]: https://web.archive.org/web/20210413233627/http://wiki.hashphp.org/Validation\n[Learn about PDO connections]: https://www.php.net/pdo.connections\n"
  },
  {
    "path": "_posts/07-04-01-Interacting-via-Code.md",
    "content": "---\nisChild: true\ntitle:   Interacting with Databases\nanchor:  databases_interacting\n---\n\n## Interacting with Databases {#databases_interacting_title}\n\nWhen developers first start to learn PHP, they often end up mixing their database interaction up with their\npresentation logic, using code that might look like this:\n\n{% highlight php %}\n<ul>\n<?php\nforeach ($db->query('SELECT * FROM table') as $row) {\n    echo \"<li>\".$row['field1'].\" - \".$row['field1'].\"</li>\";\n}\n?>\n</ul>\n{% endhighlight %}\n\nThis is bad practice for all sorts of reasons, mainly that it's hard to debug, hard to test, hard to read and it is\ngoing to output a lot of fields if you don't put a limit on there.\n\nWhile there are many other solutions to doing this - depending on if you prefer [OOP](/#object-oriented-programming) or\n[functional programming](/#functional-programming) - there must be some element of separation.\n\nConsider the most basic step:\n\n{% highlight php %}\n<?php\nfunction getAllFoos($db) {\n    return $db->query('SELECT * FROM table');\n}\n\n$results = getAllFoos($db);\nforeach ($results as $row) {\n    echo \"<li>\".$row['field1'].\" - \".$row['field1'].\"</li>\"; // BAD!!\n}\n{% endhighlight %}\n\nThat is a good start. Put those two items in two different files and you've got some clean separation.\n\nCreate a class to place that method in and you have a \"Model\". Create a simple `.php` file to put the presentation\nlogic in and you have a \"View\", which is very nearly [MVC] - a common OOP architecture for most\n[frameworks](/#frameworks).\n\n**foo.php**\n\n{% highlight php %}\n<?php\n$db = new PDO('mysql:host=localhost;dbname=testdb;charset=utf8mb4', 'username', 'password');\n\n// Make your model available\ninclude 'models/FooModel.php';\n\n// Create an instance\n$fooModel = new FooModel($db);\n// Get the list of Foos\n$fooList = $fooModel->getAllFoos();\n\n// Show the view\ninclude 'views/foo-list.php';\n{% endhighlight %}\n\n\n**models/FooModel.php**\n\n{% highlight php %}\n<?php\nclass FooModel\n{\n    public function __construct(protected PDO $db)\n    {\n    }\n\n    public function getAllFoos() {\n        return $this->db->query('SELECT * FROM table');\n    }\n}\n{% endhighlight %}\n\n**views/foo-list.php**\n\n{% highlight php %}\n<?php foreach ($fooList as $row): ?>\n    <li><?= $row['field1'] ?> - <?= $row['field1'] ?></li>\n<?php endforeach ?>\n{% endhighlight %}\n\nThis is essentially the same as what most modern frameworks are doing, albeit a little more manual. You might not\nneed to do all of that every time, but mixing together too much presentation logic and database interaction can be a\nreal problem if you ever want to [unit-test](/#unit-testing) your application.\n\n\n[MVC]: https://code.tutsplus.com/tutorials/mvc-for-noobs--net-10488\n"
  },
  {
    "path": "_posts/07-05-01-Abstraction-Layers.md",
    "content": "---\nisChild: true\ntitle:   Abstraction Layers\nanchor:  databases_abstraction_layers\n---\n\n## Abstraction Layers {#databases_abstraction_layers_title}\n\nMany frameworks provide their own abstraction layer which may or may not sit on top of [PDO][1]. These will often\nemulate features for one database system that is missing from another by wrapping your queries in PHP methods, giving\nyou actual database abstraction instead of just the connection abstraction that PDO provides. This will of course add a\nlittle overhead, but if you are building a portable application that needs to work with MySQL, PostgreSQL and SQLite\nthen a little overhead will be worth it for the sake of code cleanliness.\n\nSome abstraction layers have been built using the [PSR-0][psr0] or [PSR-4][psr4] namespace standards so can be\ninstalled in any application you like:\n\n* [Atlas][5]\n* [Aura SQL][6]\n* [Doctrine2 DBAL][2]\n* [Medoo][8]\n* [Propel][7]\n* [laminas-db][4]\n\n\n[1]: https://www.php.net/book.pdo\n[2]: https://www.doctrine-project.org/projects/dbal.html\n[4]: https://docs.laminas.dev/laminas-db/\n[5]: https://atlasphp.io\n[6]: https://github.com/auraphp/Aura.Sql\n[7]: https://propelorm.org/\n[8]: https://medoo.in/\n[psr0]: https://www.php-fig.org/psr/psr-0/\n[psr4]: https://www.php-fig.org/psr/psr-4/\n"
  },
  {
    "path": "_posts/08-01-01-Templating.md",
    "content": "---\ntitle:  Templating\nanchor: templating\n---\n\n# Templating {#templating_title}\n\nTemplates provide a convenient way of separating your controller and domain logic from your presentation logic.\nTemplates typically contain the HTML of your application, but may also be used for other formats, such as XML.\nTemplates are often referred to as \"views\", which make up **part of** the second component of the\n[model–view–controller](/pages/Design-Patterns.html#model-view-controller) (MVC) software architecture pattern."
  },
  {
    "path": "_posts/08-02-01-Benefits.md",
    "content": "---\nisChild: true\nanchor:  templating_benefits\n---\n\n## Benefits {#templating_benefits_title}\n\nThe main benefit to using templates is the clear separation they create between the presentation logic and the rest of\nyour application. Templates have the sole responsibility of displaying formatted content. They are not responsible for\ndata lookup, persistence or other more complex tasks. This leads to cleaner, more readable code which is especially\nhelpful in a team environment where developers work on the server-side code (controllers, models) and designers work on\nthe client-side code (markup).\n\nTemplates also improve the organization of presentation code. Templates are typically placed in a \"views\" folder, each\ndefined within a single file. This approach encourages code reuse where larger blocks of code are broken into smaller,\nreusable pieces, often called partials. For example, your site header and footer can each be defined as templates,\nwhich are then included before and after each page template.\n\nFinally, depending on the library you use, templates can offer more security by automatically escaping user-generated\ncontent. Some libraries even offer sand-boxing, where template designers are only given access to white-listed\nvariables and functions."
  },
  {
    "path": "_posts/08-03-01-Plain-PHP-Templates.md",
    "content": "---\ntitle: Plain PHP Templates\nisChild: true\nanchor:  plain_php_templates\n---\n\n## Plain PHP Templates {#plain_php_templates_title}\n\nPlain PHP templates are simply templates that use native PHP code. They are a natural choice since PHP is actually a\ntemplate language itself. That simply means that you can combine PHP code within other code, like HTML. This is\nbeneficial to PHP developers as there is no new syntax to learn, they know the functions available to them, and their\ncode editors already have PHP syntax highlighting and auto-completion built-in. Further, plain PHP templates tend to be\nvery fast as no compiling stage is required.\n\nEvery modern PHP framework employs some kind of template system, most of which use plain PHP by default. Outside of\nframeworks, libraries like [Plates][plates] or [Aura.View][aura] make working with plain PHP templates easier by\noffering modern template functionality such as inheritance, layouts and extensions.\n\n### Simple example of a plain PHP template\n\nUsing the [Plates][plates] library.\n\n{% highlight php %}\n<?php // user_profile.php ?>\n\n<?php $this->insert('header', ['title' => 'User Profile']) ?>\n\n<h1>User Profile</h1>\n<p>Hello, <?=$this->escape($name)?></p>\n\n<?php $this->insert('footer') ?>\n{% endhighlight %}\n\n### Example of plain PHP templates using inheritance\n\nUsing the [Plates][plates] library.\n\n{% highlight php %}\n<?php // template.php ?>\n\n<html>\n<head>\n    <title><?=$title?></title>\n</head>\n<body>\n\n<main>\n    <?=$this->section('content')?>\n</main>\n\n</body>\n</html>\n{% endhighlight %}\n\n{% highlight php %}\n<?php // user_profile.php ?>\n\n<?php $this->layout('template', ['title' => 'User Profile']) ?>\n\n<h1>User Profile</h1>\n<p>Hello, <?=$this->escape($name)?></p>\n{% endhighlight %}\n\n\n[plates]: https://platesphp.com/\n[aura]: https://github.com/auraphp/Aura.View\n"
  },
  {
    "path": "_posts/08-04-01-Compiled-Templates.md",
    "content": "---\nisChild: true\nanchor:  compiled_templates\n---\n\n## Compiled Templates {#compiled_templates_title}\n\nWhile PHP has evolved into a mature, object oriented language, it [hasn't improved much][article_templating_engines] as\na templating language. Compiled templates, like [Twig], [Brainy], or [Smarty]*, fill this void by offering a new syntax that has\nbeen geared specifically to templating. From automatic escaping, to inheritance and simplified control structures,\ncompiled templates are designed to be easier to write, cleaner to read and safer to use. Compiled templates can even be\nshared across different languages, [Mustache] being a good example of this. Since these templates must be compiled\nthere is a slight performance hit, however this is very minimal when proper caching is used.\n\n**While Smarty offers automatic escaping, this feature is NOT enabled by default.*\n\n### Simple example of a compiled template\n\nUsing the [Twig] library.\n\n{% highlight html+jinja %}\n{% raw %}\n{% include 'header.html' with {'title': 'User Profile'} %}\n\n<h1>User Profile</h1>\n<p>Hello, {{ name }}</p>\n\n{% include 'footer.html' %}\n{% endraw %}\n{% endhighlight %}\n\n### Example of compiled templates using inheritance\n\nUsing the [Twig] library.\n\n{% highlight html+jinja %}\n{% raw %}\n// template.html\n\n<html>\n<head>\n    <title>{% block title %}{% endblock %}</title>\n</head>\n<body>\n\n<main>\n    {% block content %}{% endblock %}\n</main>\n\n</body>\n</html>\n{% endraw %}\n{% endhighlight %}\n\n{% highlight html+jinja %}\n{% raw %}\n// user_profile.html\n\n{% extends \"template.html\" %}\n\n{% block title %}User Profile{% endblock %}\n{% block content %}\n    <h1>User Profile</h1>\n    <p>Hello, {{ name }}</p>\n{% endblock %}\n{% endraw %}\n{% endhighlight %}\n\n\n[article_templating_engines]: http://fabien.potencier.org/templating-engines-in-php.html\n[Twig]: https://twig.symfony.com/\n[Brainy]: https://github.com/box/brainy\n[Smarty]: https://www.smarty.net/\n[Mustache]: https://mustache.github.io/\n"
  },
  {
    "path": "_posts/08-05-01-Further-Reading.md",
    "content": "---\nisChild: true\nanchor:  templating_further_reading\n---\n\n## Further Reading {#templating_further_reading_title}\n\n### Articles & Tutorials\n\n* [Templating Engines in PHP](http://fabien.potencier.org/templating-engines-in-php.html)\n* [An Introduction to Views & Templating in CodeIgniter](https://code.tutsplus.com/tutorials/an-introduction-to-views-templating-in-codeigniter--net-25648)\n* [Getting Started With PHP Templating](https://www.smashingmagazine.com/2011/10/getting-started-with-php-templating/)\n* [Roll Your Own Templating System in PHP](https://code.tutsplus.com/tutorials/roll-your-own-templating-system-in-php--net-16596)\n* [Master Pages](https://laracasts.com/series/laravel-from-scratch/episodes/7)\n* [Working With Templates in Symfony 2](https://code.tutsplus.com/tutorials/working-with-templates-in-symfony-2--cms-21172)\n* [Writing Safer Templates](https://github.com/box/brainy/wiki/Writing-Safe-Templates)\n\n### Libraries\n\n* [Aura.View](https://github.com/auraphp/Aura.View) *(native)*\n* [Blade](https://laravel.com/docs/blade) *(compiled, framework specific)*\n* [Brainy](https://github.com/box/brainy) *(compiled)*\n* [Latte](https://github.com/nette/latte) *(compiled)*\n* [Mustache](https://github.com/bobthecow/mustache.php) *(compiled)*\n* [PHPTAL](https://phptal.org/) *(compiled)*\n* [Plates](https://platesphp.com/) *(native)*\n* [Smarty](https://www.smarty.net/) *(compiled)*\n* [Twig](https://twig.symfony.com/) *(compiled)*\n* [laminas-view](https://docs.laminas.dev/laminas-view/) *(native, framework specific)*\n"
  },
  {
    "path": "_posts/09-01-01-Errors-and-Exceptions.md",
    "content": "---\ntitle:  Errors and Exceptions\nanchor: errors_and_exceptions\n---\n\n# Errors and Exceptions {#errors_and_exceptions_title}\n\n"
  },
  {
    "path": "_posts/09-02-01-Errors.md",
    "content": "---\nisChild: true\nanchor:  errors\n---\n\n## Errors {#errors_title}\n\nIn many \"exception-heavy\" programming languages, whenever anything goes wrong an exception will be thrown. This is\ncertainly a viable way to do things, but PHP is an \"exception-light\" programming language. While it does have\nexceptions and more of the core is starting to use them when working with objects, most of PHP itself will try to keep\nprocessing regardless of what happens, unless a fatal error occurs.\n\nFor example:\n\n{% highlight console %}\n$ php -a\nphp > echo $foo;\nNotice: Undefined variable: foo in php shell code on line 1\n{% endhighlight %}\n\nThis is only a notice error, and PHP will happily carry on. This can be confusing for those coming from\n\"exception-heavy\" languages, because referencing a missing variable in Python for example will throw an exception:\n\n{% highlight console %}\n$ python\n>>> print foo\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nNameError: name 'foo' is not defined\n{% endhighlight %}\n\nThe only real difference is that Python will freak out over any small thing, so that developers can be super sure any\npotential issue or edge-case is caught, whereas PHP will keep on processing unless something extreme happens, at which\npoint it will throw an error and report it.\n\n### Error Severity\n\nPHP has several levels of error severity. The three most common types of messages are errors, notices and warnings.\nThese have different levels of severity; `E_ERROR`, `E_NOTICE`, and `E_WARNING`. Errors are fatal run-time errors and\nare usually caused by faults in your code and need to be fixed as they'll cause PHP to stop executing. Notices are\nadvisory messages caused by code that may or may not cause problems during the execution of the script, execution is\nnot halted. Warnings are non-fatal errors, execution of the script will not be halted.\n\nAnother type of error message reported at compile time are `E_STRICT` messages. These messages are used to suggest\nchanges to your code to help ensure best interoperability and forward compatibility with upcoming versions of PHP.\n\n### Changing PHP's Error Reporting Behaviour\n\nError Reporting can be changed by using PHP settings and/or PHP function calls. Using the built in PHP function\n`error_reporting()` you can set the level of errors for the duration of the script execution by passing one of the\npredefined error level constants, meaning if you only want to see Errors and Warnings - but not Notices - then you can\nconfigure that:\n\n{% highlight php %}\n<?php\nerror_reporting(E_ERROR | E_WARNING);\n{% endhighlight %}\n\nYou can also control whether or not errors are displayed to the screen (good for development) or hidden, and logged\n(good for production). For more information on this check out the [Error Reporting][errorreport] section.\n\n### Inline Error Suppression\n\nYou can also tell PHP to suppress specific errors with the Error Control Operator `@`. You put this operator at the\nbeginning of an expression, and any error that's a direct result of the expression is silenced.\n\n{% highlight php %}\n<?php\necho @$foo['bar'];\n{% endhighlight %}\n\nThis will output `$foo['bar']` if it exists, but will simply return a null and print nothing if the variable `$foo` or\n`'bar'` key does not exist. Without the error control operator, this expression could create a `PHP Notice: Undefined\nvariable: foo` or `PHP Notice: Undefined index: bar` error.\n\nThis might seem like a good idea, but there are a few undesirable tradeoffs. PHP handles expressions using an `@` in a\nless performant way than expressions without an `@`. Premature optimization may be the root of all programming\narguments, but if performance is particularly important for your application/library it's important to understand the\nerror control operator's performance implications.\n\nSecondly, the error control operator **completely** swallows the error. The error is not displayed, and the error is\nnot sent to the error log. Also, stock/production PHP systems have no way to turn off the error control operator. While\nyou may be correct that the error you're seeing is harmless, a different, less harmless error will be just as silent.\n\nIf there's a way to avoid the error suppression operator, you should consider it. For example, our code above could be\nrewritten like this:\n\n{% highlight php %}\n<?php\n// Null Coalescing Operator\necho $foo['bar'] ?? '';\n{% endhighlight %}\n\nOne instance where error suppression might make sense is where `fopen()` fails to find a file to load. You could check\nfor the existence of the file before you try to load it, but if the file is deleted after the check and before the\n`fopen()` (which might sound impossible, but it can happen) then `fopen()` will return false _and_ throw an error. This\nis potentially something PHP should resolve, but is one case where error suppression might seem like the only valid\nsolution.\n\nEarlier we mentioned there's no way in a stock PHP system to turn off the error control operator. However, [Xdebug] has\nan `xdebug.scream` ini setting which will disable the error control operator. You can set this via your `php.ini` file\nwith the following.\n\n{% highlight ini %}\nxdebug.scream = On\n{% endhighlight %}\n\nYou can also set this value at runtime with the `ini_set` function\n\n{% highlight php %}\n<?php\nini_set('xdebug.scream', '1')\n{% endhighlight %}\n\nThis is most useful when you're debugging code and suspect an informative error is suppressed. Use scream with care,\nand as a temporary debugging tool. There's lots of PHP library code that may not work with the error control operator\ndisabled.\n\n* [Error Control Operators]\n* [SitePoint]\n* [Xdebug]\n\n### ErrorException\n\nPHP is perfectly capable of being an \"exception-heavy\" programming language, and only requires a few lines of code to\nmake the switch. Basically you can throw your \"errors\" as \"exceptions\" using the `ErrorException` class, which extends\nthe `Exception` class.\n\nThis is a common practice implemented by a large number of modern frameworks such as Symfony and Laravel. In debug\nmode *(or dev mode)* both of these frameworks will display a nice and clean *stack trace*.\n\nThere are also some packages available for better error and exception handling and reporting. Like [Whoops!], which comes with the default installation of Laravel and can be used in any framework as well.\n\nBy throwing errors as exceptions in development you can handle them better than the usual result, and if you see an\nexception during development you can wrap it in a catch statement with specific instructions on how to handle the\nsituation. Each exception you catch instantly makes your application that little bit more robust.\n\nMore information on this and details on how to use `ErrorException` with error handling can be found at\n[ErrorException Class][errorexception].\n\n* [Error Control Operators]\n* [Predefined Constants for Error Handling]\n* [`error_reporting()`][error_reporting]\n* [Reporting][errorreport]\n\n\n[errorreport]: /#error_reporting\n[Xdebug]: https://xdebug.org/docs/basic\n[Error Control Operators]: https://www.php.net/language.operators.errorcontrol\n[SitePoint]: https://www.sitepoint.com/\n[Whoops!]: https://filp.github.io/whoops/\n[errorexception]: https://www.php.net/class.errorexception\n[Predefined Constants for Error Handling]: https://www.php.net/errorfunc.constants\n[error_reporting]: https://www.php.net/function.error-reporting\n"
  },
  {
    "path": "_posts/09-03-01-Exceptions.md",
    "content": "---\nisChild: true\nanchor:  exceptions\n---\n\n## Exceptions {#exceptions_title}\n\nExceptions are a standard part of most popular programming languages, but they are often overlooked by PHP programmers.\nLanguages like Ruby are extremely Exception heavy, so whenever something goes wrong such as a HTTP request failing, or\na DB query goes wrong, or even if an image asset could not be found, Ruby (or the gems being used) will throw an\nexception to the screen meaning you instantly know there is a mistake.\n\nPHP itself is fairly lax with this, and a call to `file_get_contents()` will usually just get you a `FALSE` and a\nwarning.\nMany older PHP frameworks like CodeIgniter will just return a false, log a message to their proprietary logs and maybe\nlet you use a method like `$this->upload->get_error()` to see what went wrong. The problem here is that you have to go\nlooking for a mistake and check the docs to see what the error method is for this class, instead of having it made\nextremely obvious.\n\nAnother problem is when classes automatically throw an error to the screen and exit the process. When you do this you\nstop another developer from being able to dynamically handle that error. Exceptions should be thrown to make a\ndeveloper aware of an error; they then can choose how to handle this. E.g.:\n\n{% highlight php %}\n<?php\n$email = new Fuel\\Email;\n$email->subject('My Subject');\n$email->body('How the heck are you?');\n$email->to('guy@example.com', 'Some Guy');\n\ntry\n{\n    $email->send();\n}\ncatch(Fuel\\Email\\ValidationFailedException $e)\n{\n    // The validation failed\n}\ncatch(Fuel\\Email\\SendingFailedException $e)\n{\n    // The driver could not send the email\n}\nfinally\n{\n    // Executed regardless of whether an exception has been thrown, and before normal execution resumes\n}\n{% endhighlight %}\n\n### SPL Exceptions\n\nThe generic `Exception` class provides very little debugging context for the developer; however, to remedy this, it is\npossible to create a specialized `Exception` type by sub-classing the generic `Exception` class:\n\n{% highlight php %}\n<?php\nclass ValidationException extends Exception {}\n{% endhighlight %}\n\nThis means you can add multiple catch blocks and handle different Exceptions differently. This can lead to the\ncreation of a <em>lot</em> of custom Exceptions, some of which could have been avoided using the SPL Exceptions\nprovided in the [SPL extension][splext].\n\nIf for example you use the `__call()` Magic Method and an invalid method is requested then instead of throwing a\nstandard Exception which is vague, or creating a custom Exception just for that, you could just\n`throw new BadMethodCallException;`.\n\n* [Read about Exceptions][exceptions]\n* [Read about SPL Exceptions][splexe]\n* [Nesting Exceptions In PHP][nesting-exceptions-in-php]\n\n\n[splext]: /#standard_php_library\n[exceptions]: https://www.php.net/language.exceptions\n[splexe]: https://www.php.net/spl.exceptions\n[nesting-exceptions-in-php]: https://www.brandonsavage.net/exceptional-php-nesting-exceptions-in-php/\n"
  },
  {
    "path": "_posts/10-01-01-Security.md",
    "content": "---\nanchor: security\n---\n\n# Security {#security_title}\n\nThe best resource I've found on PHP security is [The 2018 Guide to Building Secure PHP Software](https://paragonie.com/blog/2017/12/2018-guide-building-secure-php-software) by\n[Paragon Initiative](https://paragonie.com/).\n"
  },
  {
    "path": "_posts/10-02-01-Web-Application-Security.md",
    "content": "---\nisChild: true\nanchor:  web_application_security\n---\n\n## Web Application Security {#web_application_security_title}\n\nIt is very important for every PHP developer to learn [the basics of web application security][4], which can be broken\ndown into a handful of broad topics:\n\n1. Code-data separation.\n   * When data is executed as code, you get SQL Injection, Cross-Site Scripting, Local/Remote File Inclusion, etc.\n   * When code is printed as data, you get information leaks (source code disclosure or, in the case of C programs,\n     enough information to bypass [ASLR][5]).\n2. Application logic.\n   * Missing authentication or authorization controls.\n   * Input validation.\n3. Operating environment.\n   * PHP versions.\n   * Third party libraries.\n   * The operating system.\n4. Cryptography weaknesses.\n   * [Weak random numbers][6].\n   * [Chosen-ciphertext attacks][7].\n   * [Side-channel information leaks][8].\n\nThere are bad people ready and willing to exploit your web application. It is important that you take necessary\nprecautions to harden your web application's security. Luckily, the fine folks at\n[The Open Web Application Security Project][1] (OWASP) have compiled a comprehensive list of known security issues and\nmethods to protect yourself against them. This is a must read for the security-conscious developer. [Survive The Deep End: PHP Security][3] by Padraic Brady is also another good web application security guide for PHP.\n\n* [Read the OWASP Security Guide][2]\n\n\n[1]: https://www.owasp.org/\n[2]: https://www.owasp.org/index.php/Guide_Table_of_Contents\n[3]: https://phpsecurity.readthedocs.io/en/latest/index.html\n[4]: https://paragonie.com/blog/2015/08/gentle-introduction-application-security\n[5]: https://www.techtarget.com/searchsecurity/definition/address-space-layout-randomization-ASLR\n[6]: https://paragonie.com/blog/2016/01/on-design-and-implementation-stealth-backdoor-for-web-applications\n[7]: https://paragonie.com/blog/2015/05/using-encryption-and-authentication-correctly\n[8]: https://blog.ircmaxell.com/2014/11/its-all-about-time.html\n"
  },
  {
    "path": "_posts/10-03-01-Password-Hashing.md",
    "content": "---\nisChild: true\nanchor:  password_hashing\n---\n\n## Password Hashing {#password_hashing_title}\n\nEventually everyone builds a PHP application that relies on user login. Usernames and passwords are stored in a\ndatabase and later used to authenticate users upon login.\n\nIt is important that you properly [_hash_][3] passwords before storing them. Hashing and encrypting are [two very different things][7]\nthat often get confused.\n\nHashing is an irreversible, one-way function. This produces a fixed-length string that cannot be feasibly reversed.\nThis means you can compare a hash against another to determine if they both came from the same source string, but you\ncannot determine the original string. If passwords are not hashed and your database is accessed by an unauthorized\nthird-party, all user accounts are now compromised.\n\nUnlike hashing, encryption is reversible (provided you have the key). Encryption is useful in other areas, but is a poor\nstrategy for securely storing passwords.\n\nPasswords should also be individually [_salted_][5] by adding a random string to each password before hashing. This prevents dictionary attacks and the use of \"rainbow tables\" (a reverse list of cryptographic hashes for common passwords.)\n\nHashing and salting are vital as often users use the same password for multiple services and password quality can be poor.\n\nAdditionally, you should use [a specialized _password hashing_ algorithm][6] rather than fast, general-purpose\ncryptographic hash function (e.g. SHA256). The short list of acceptable password hashing algorithms (as of June 2018)\nto use are:\n\n* Argon2 (available in PHP 7.2 and newer)\n* Scrypt\n* **Bcrypt** (PHP provides this one for you; see below)\n* PBKDF2 with HMAC-SHA256 or HMAC-SHA512\n\nFortunately, nowadays PHP makes this easy.\n\n**Hashing passwords with `password_hash`**\n\nIn PHP 5.5 `password_hash()` was introduced. At this time it is using BCrypt, the strongest algorithm currently\nsupported by PHP. It will be updated in the future to support more algorithms as needed though. The `password_compat`\nlibrary was created to provide forward compatibility for PHP >= 5.3.7.\n\nBelow we hash a string, and then check the hash against a new string. Because our two source strings are different\n('secret-password' vs. 'bad-password') this login will fail.\n\n{% highlight php %}\n<?php\nrequire 'password.php';\n\n$passwordHash = password_hash('secret-password', PASSWORD_DEFAULT);\n\nif (password_verify('bad-password', $passwordHash)) {\n    // Correct Password\n} else {\n    // Wrong password\n}\n{% endhighlight %}\n\n`password_hash()` takes care of password salting for you. The salt is stored, along with the algorithm and \"cost\", as part of the hash.  `password_verify()` extracts this to determine how to check the password, so you don't need a separate database field to store your salts.\n\n* [Learn about `password_hash()`] [1]\n* [`password_compat` for PHP >= 5.3.7 && < 5.5] [2]\n* [Learn about hashing in regards to cryptography] [3]\n* [Learn about salts] [5]\n* [PHP `password_hash()` RFC] [4]\n\n\n[1]: https://www.php.net/function.password-hash\n[2]: https://github.com/ircmaxell/password_compat\n[3]: https://wikipedia.org/wiki/Cryptographic_hash_function\n[4]: https://wiki.php.net/rfc/password_hash\n[5]: https://wikipedia.org/wiki/Salt_(cryptography)\n[6]: https://paragonie.com/blog/2016/02/how-safely-store-password-in-2016\n[7]: https://paragonie.com/blog/2015/08/you-wouldnt-base64-a-password-cryptography-decoded\n\n"
  },
  {
    "path": "_posts/10-04-01-Data-Filtering.md",
    "content": "---\nisChild: true\nanchor:  data_filtering\n---\n\n## Data Filtering {#data_filtering_title}\n\nNever ever (ever) trust foreign input introduced to your PHP code. Always sanitize and validate foreign input before\nusing it in code. The `filter_var()` and `filter_input()` functions can sanitize text and validate text formats (e.g.\nemail addresses).\n\nForeign input can be anything: `$_GET` and `$_POST` form input data, some values in the `$_SERVER` superglobal, and the\nHTTP request body via `fopen('php://input', 'r')`. Remember, foreign input is not limited to form data submitted by the\nuser. Uploaded and downloaded files, session values, cookie data, and data from third-party web services are foreign\ninput, too.\n\nWhile foreign data can be stored, combined, and accessed later, it is still foreign input. Every time you process,\noutput, concatenate, or include data in your code, ask yourself if the data is filtered properly and can it be trusted.\n\nData may be _filtered_ differently based on its purpose. For example, when unfiltered foreign input is passed into HTML\npage output, it can execute HTML and JavaScript on your site! This is known as Cross-Site Scripting (XSS) and can be a\nvery dangerous attack. One way to avoid XSS is to sanitize all user-generated data before outputting it to your page by\nremoving HTML tags with the `strip_tags()` function or escaping characters with special meaning into their respective\nHTML entities with the `htmlentities()` or `htmlspecialchars()` functions.\n\nAnother example is passing options to be executed on the command line. This can be extremely dangerous (and is usually\na bad idea), but you can use the built-in `escapeshellarg()` function to sanitize the executed command's arguments.\n\nOne last example is accepting foreign input to determine a file to load from the filesystem. This can be exploited by\nchanging the filename to a file path. You need to remove `\"/\"`, `\"../\"`, [null bytes][6], or other characters from the\nfile path so it can't load hidden, non-public, or sensitive files.\n\n* [Learn about data filtering][1]\n* [Learn about `filter_var`][4]\n* [Learn about `filter_input`][5]\n* [Learn about handling null bytes][6]\n\n### Sanitization\n\nSanitization removes (or escapes) illegal or unsafe characters from foreign input.\n\nFor example, you should sanitize foreign input before including the input in HTML or inserting it into a raw SQL query.\nWhen you use bound parameters with [PDO](#databases), it will sanitize the input for you.\n\nSometimes it is required to allow some safe HTML tags in the input when including it in the HTML page. This is very\nhard to do and many avoid it by using other more restricted formatting like Markdown or BBCode, although whitelisting\nlibraries like [HTML Purifier][html-purifier] exist for this reason.\n\n[See Sanitization Filters][2]\n\n### Unserialization\n\nIt is dangerous to `unserialize()` data from users or other untrusted sources.  Doing so can allow malicious users to instantiate objects (with user-defined properties) whose destructors will be executed, **even if the objects themselves aren't used**.  You should therefore avoid unserializing untrusted data.\n\nUse a safe, standard data interchange format such as JSON (via [`json_decode`][json_decode] and [`json_encode`][json_encode]) if you need to pass serialized data to the user.\n\n### Validation\n\nValidation ensures that foreign input is what you expect. For example, you may want to validate an email address, a\nphone number, or age when processing a registration submission.\n\n[See Validation Filters][3]\n\n\n[1]: https://www.php.net/book.filter\n[2]: https://www.php.net/filter.filters.sanitize\n[3]: https://www.php.net/filter.filters.validate\n[4]: https://www.php.net/function.filter-var\n[5]: https://www.php.net/function.filter-input\n[6]: https://www.php.net/security.filesystem.nullbytes\n[html-purifier]: http://htmlpurifier.org/\n[json_decode]: https://www.php.net/manual/function.json-decode.php\n[json_encode]: https://www.php.net/manual/function.json-encode.php\n"
  },
  {
    "path": "_posts/10-05-01-Configuration-Files.md",
    "content": "---\nisChild: true\nanchor:  configuration_files\n---\n\n## Configuration Files {#configuration_files_title}\n\nWhen creating configuration files for your applications, best practices recommend that one of the following methods be\nfollowed:\n\n- It is recommended that you store your configuration information where it cannot be accessed directly and pulled in\nvia the file system.\n- If you must store your configuration files in the document root, name the files with a `.php` extension. This ensures\nthat, even if the script is accessed directly, it will not be output as plain text.\n- Information in configuration files should be protected accordingly, either through encryption or group/user file\nsystem permissions.\n- It is a good idea to ensure that you do not commit configuration files containing sensitive information e.g. passwords or API tokens to source control.\n"
  },
  {
    "path": "_posts/10-06-01-Register-Globals.md",
    "content": "---\nisChild: true\nanchor:  register_globals\n---\n\n## Register Globals {#register_globals_title}\n\n**NOTE:** As of PHP 5.4.0 the `register_globals` setting has been removed and can no longer be used. This is only\nincluded as a warning for anyone in the process of upgrading a legacy application.\n\nWhen enabled, the `register_globals` configuration setting makes several types of variables (including ones from\n`$_POST`, `$_GET` and `$_REQUEST`) available in the global scope of your application. This can easily lead to security\nissues as your application cannot effectively tell where the data is coming from.\n\nFor example: `$_GET['foo']` would be available via `$foo`, which can override variables that have been declared.\n\nIf you are using PHP < 5.4.0 __make sure__ that `register_globals` is __off__.\n"
  },
  {
    "path": "_posts/10-07-01-Error-Reporting.md",
    "content": "---\nisChild: true\nanchor:  error_reporting\n---\n\n## Error Reporting {#error_reporting_title}\n\nError logging can be useful in finding the problem spots in your application, but it can also expose information about\nthe structure of your application to the outside world. To effectively protect your application from issues that could\nbe caused by the output of these messages, you need to configure your server differently in development versus\nproduction (live).\n\n### Development\n\nTo show every possible error during **development**, configure the following settings in your `php.ini`:\n\n{% highlight ini %}\ndisplay_errors = On\ndisplay_startup_errors = On\nerror_reporting = -1\nlog_errors = On\n{% endhighlight %}\n\n> Passing in the value `-1` will show every possible error, even when new levels and constants are added in future PHP\n> versions. The `E_ALL` constant also behaves this way as of PHP 5.4. -\n> [php.net](https://www.php.net/function.error-reporting)\n\nThe `E_STRICT` error level constant was introduced in 5.3.0 and is not part of `E_ALL`, however it became part of\n`E_ALL` in 5.4.0. What does this mean? In terms of reporting every possible error in version 5.3 it means you must\nuse either `-1` or `E_ALL | E_STRICT`.\n\n**Reporting every possible error by PHP version**\n\n* &lt; 5.3 `-1` or `E_ALL`\n* &nbsp; 5.3 `-1` or `E_ALL | E_STRICT`\n* &gt; 5.3 `-1` or `E_ALL`\n\n### Production\n\nTo hide errors on your **production** environment, configure your `php.ini` as:\n\n{% highlight ini %}\ndisplay_errors = Off\ndisplay_startup_errors = Off\nerror_reporting = E_ALL\nlog_errors = On\n{% endhighlight %}\n\nWith these settings in production, errors will still be logged to the error logs for the web server, but will not be\nshown to the user. For more information on these settings, see the PHP manual:\n\n* [error_reporting](https://www.php.net/errorfunc.configuration#ini.error-reporting)\n* [display_errors](https://www.php.net/errorfunc.configuration#ini.display-errors)\n* [display_startup_errors](https://www.php.net/errorfunc.configuration#ini.display-startup-errors)\n* [log_errors](https://www.php.net/errorfunc.configuration#ini.log-errors)\n"
  },
  {
    "path": "_posts/11-01-01-Testing.md",
    "content": "---\nanchor: testing\n---\n\n# Testing {#testing_title}\n\nWriting automated tests for your PHP code is considered a best practice and can lead to well-built applications.\nAutomated tests are a great tool for making sure your application does not break when you are making changes or adding\nnew functionality and should not be ignored.\n\nThere are several different types of testing tools (or frameworks) available for PHP, which use different approaches -\nall of which are trying to avoid manual testing and the need for large Quality Assurance teams, just to make sure\nrecent changes didn't break existing functionality."
  },
  {
    "path": "_posts/11-02-01-Test-Driven-Development.md",
    "content": "---\nisChild: true\nanchor:  test_driven_development\n---\n\n## Test Driven Development {#test_driven_development_title}\n\nFrom [Wikipedia](https://wikipedia.org/wiki/Test-driven_development):\n\n> Test-driven development (TDD) is a software development process that relies on the repetition of a very short\n> development cycle: first the developer writes a failing automated test case that defines a desired improvement or new\n> function, then produces code to pass that test and finally refactors the new code to acceptable standards. Kent Beck,\n> who is credited with having developed or 'rediscovered' the technique, stated in 2003 that TDD encourages simple\n> designs and inspires confidence.\n\nThere are several different types of testing that you can do for your application:\n\n### Unit Testing\n\nUnit Testing is a programming approach to ensure functions, classes and methods are working as expected, from the point\nyou build them all the way through the development cycle. By checking values going in and out of various functions and\nmethods, you can make sure the internal logic is working correctly. By using Dependency Injection and building \"mock\"\nclasses and stubs you can verify that dependencies are correctly used for even better test coverage.\n\nWhen you create a class or function you should create a unit test for each behavior it must have. At a very basic level\nyou should make sure it errors if you send it bad arguments and make sure it works if you send it valid arguments. This\nwill help ensure that when you make changes to this class or function later on in the development cycle that the old\nfunctionality continues to work as expected. The only alternative to this would be `var_dump()` in a test.php, which is\nno way to build an application - large or small.\n\nThe other use for unit tests is contributing to open source. If you can write a test that shows broken functionality\n(i.e. fails), then fix it, and show the test passing, patches are much more likely to be accepted. If you run a project\nwhich accepts pull requests then you should suggest this as a requirement.\n\n[PHPUnit](https://phpunit.de/) is the de-facto testing framework for writing unit tests for PHP applications, but there\nare several alternatives:\n\n* [atoum](https://github.com/atoum/atoum)\n* [Kahlan](https://github.com/kahlan/kahlan)\n* [Peridot](https://peridot-php.github.io/)\n* [Pest](https://pestphp.com/)\n* [SimpleTest](https://github.com/simpletest/simpletest)\n\n### Integration Testing\n\nFrom [Wikipedia](https://wikipedia.org/wiki/Integration_testing):\n\n> Integration testing (sometimes called Integration and Testing, abbreviated \"I&T\") is the phase in software testing in\n> which individual software modules are combined and tested as a group. It occurs after unit testing and before\n> validation testing. Integration testing takes as its input modules that have been unit tested, groups them in larger\n> aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the\n> integrated system ready for system testing.\n\nMany of the same tools that can be used for unit testing can be used for integration testing as many of the same\nprinciples are used.\n\n### Functional Testing\n\nSometimes also known as acceptance testing, functional testing consists of using tools to create automated tests that\nactually use your application instead of just verifying that individual units of code are behaving correctly and that\nindividual units can speak to each other correctly. These tools typically work using real data and simulating actual\nusers of the application.\n\n#### Functional Testing Tools\n\n* [Codeception](https://codeception.com/) is a full-stack testing framework that includes acceptance testing tools\n* [Cypress](https://www.cypress.io/)\n* [Mink](https://mink.behat.org/)\n* [Selenium](https://www.selenium.dev/)\n* [Storyplayer](https://github.com/MeltwaterArchive/storyplayer) is a full-stack testing framework that includes support for creating and destroying test environments on demand\n"
  },
  {
    "path": "_posts/11-03-01-Behavior-Driven-Development.md",
    "content": "---\nisChild: true\nanchor:  behavior_driven_development\n---\n\n## Behavior Driven Development {#behavior_driven_development_title}\n\nThere are two different types of Behavior-Driven Development (BDD): SpecBDD and StoryBDD. SpecBDD focuses on technical\nbehavior of code, while StoryBDD focuses on business or feature behaviors or interactions. PHP has frameworks for both\ntypes of BDD.\n\nWith StoryBDD, you write human-readable stories that describe the behavior of your application. These stories can then\nbe run as actual tests against your application. The framework used in PHP applications for StoryBDD is [Behat], which\nis inspired by Ruby's [Cucumber] project and implements the Gherkin DSL for describing feature behavior.\n\nWith SpecBDD, you write specifications that describe how your actual code should behave. Instead of testing a function\nor method, you are describing how that function or method should behave. PHP offers the [PHPSpec] framework for this\npurpose. This framework is inspired by the [RSpec project][Rspec] for Ruby.\n\n### BDD Links\n\n* [Behat], the StoryBDD framework for PHP, inspired by Ruby's [Cucumber] project;\n* [PHPSpec], the SpecBDD framework for PHP, inspired by Ruby's [RSpec] project;\n* [Codeception] is a full-stack testing framework that uses BDD principles.\n\n\n[Behat]: https://behat.org/\n[Cucumber]: https://cucumber.io/\n[PHPSpec]: https://phpspec.net/\n[RSpec]: https://rspec.info/\n[Codeception]: https://codeception.com/\n"
  },
  {
    "path": "_posts/11-04-01-Complementary-Testing-Tools.md",
    "content": "---\nisChild: true\nanchor:  complementary_testing_tools\n---\n\n## Complementary Testing Tools {#complementary_testing_tools_title}\n\nBesides individual testing and behavior driven frameworks, there are also a number of generic frameworks and helper\nlibraries useful for any preferred approach taken.\n\n### Tool Links\n\n* [Selenium] is a browser automation tool which can be [integrated with PHPUnit]\n* [Mockery] is a Mock Object Framework which can be integrated with [PHPUnit] or [PHPSpec]\n* [Prophecy] is a highly opinionated yet very powerful and flexible PHP object mocking framework. It's integrated with\n[PHPSpec] and can be used with [PHPUnit].\n* [php-mock] is a library to help to mock PHP native functions.\n* [Infection] is a PHP implementation of [Mutation Testing] to help to measure the effectiveness of your tests.\n* [PHPUnit Polyfills] is a library that allows for creating PHPUnit cross-version compatible tests when a test suite needs to run against a range of PHPUnit versions.\n\n\n[Selenium]: https://www.selenium.dev/\n[integrated with PHPUnit]: https://github.com/giorgiosironi/phpunit-selenium/\n[Mockery]: https://github.com/padraic/mockery\n[PHPUnit]: https://phpunit.de/\n[PHPSpec]: https://phpspec.net/\n[Prophecy]: https://github.com/phpspec/prophecy\n[php-mock]: https://github.com/php-mock/php-mock\n[Infection]: https://github.com/infection/infection\n[Mutation Testing]: https://en.wikipedia.org/wiki/Mutation_testing\n[PHPUnit Polyfills]: https://github.com/Yoast/PHPUnit-Polyfills\n"
  },
  {
    "path": "_posts/12-01-01-Servers-and-Deployment.md",
    "content": "---\ntitle:  Servers and Deployment\nanchor: servers_and_deployment\n---\n\n# Servers and Deployment {#servers_and_deployment_title}\n\nPHP applications can be deployed and run on production web servers in a number of ways.\n"
  },
  {
    "path": "_posts/12-02-01-Platform-as-a-Service.md",
    "content": "---\ntitle:   Platform as a Service (PaaS)\nisChild: true\nanchor:  platform_as_a_service\n---\n\n## Platform as a Service (PaaS) {#platform_as_a_service_title}\n\nPaaS provides the system and network architecture necessary to run PHP applications on the web. This means little to no\nconfiguration for launching PHP applications or PHP frameworks.\n\nRecently PaaS has become a popular method for deploying, hosting, and scaling PHP applications of all sizes. You can\nfind a list of [PHP PaaS \"Platform as a Service\" providers](#php_paas_providers) in our [resources section](#resources)."
  },
  {
    "path": "_posts/12-03-01-Virtual-or-Dedicated-Servers.md",
    "content": "---\ntitle:   Virtual or Dedicated Servers\nisChild: true\nanchor:  virtual_or_dedicated_servers\n---\n\n## Virtual or Dedicated Servers {#virtual_or_dedicated_servers_title}\n\nIf you are comfortable with systems administration, or are interested in learning it, virtual or dedicated servers give\nyou complete control of your application's production environment.\n\n### nginx and PHP-FPM\n\nPHP, via PHP's built-in FastCGI Process Manager (FPM), pairs really nicely with [nginx], which is a lightweight,\nhigh-performance web server. It uses less memory than Apache and can better handle more concurrent requests. This is\nespecially important on virtual servers that don't have much memory to spare.\n\n* [Read more on nginx][nginx]\n* [Read more on PHP-FPM][phpfpm]\n* [Read more on setting up nginx and PHP-FPM securely][secure-nginx-phpfpm]\n\n### Apache and PHP\n\nPHP and Apache have a long history together. Apache is wildly configurable and has many available\n[modules][apache-modules] to extend functionality. It is a popular choice for shared servers and an easy setup for PHP\nframeworks and open source apps like WordPress. Unfortunately, Apache uses more resources than nginx by default and\ncannot handle as many visitors at the same time.\n\nApache has several possible configurations for running PHP. The most common and easiest to setup is the [prefork MPM]\nwith `mod_php`. While it isn't the most memory efficient, it is the simplest to get working and to use. This is probably\nthe best choice if you don't want to dig too deeply into the server administration aspects. Note that if you use\n`mod_php` you MUST use the prefork MPM.\n\nAlternatively, if you want to squeeze more performance and stability out of Apache then you can take advantage of the\nsame FPM system as nginx and run the [worker MPM] or [event MPM] with mod_fastcgi or mod_fcgid. This configuration will\nbe significantly more memory efficient and much faster but it is more work to set up.\n\nIf you are running Apache 2.4 or later, you can use [mod_proxy_fcgi] to get great performance that is easy to setup.\n\n* [Read more on Apache][apache]\n* [Read more on Multi-Processing Modules][apache-MPM]\n* [Read more on mod_fastcgi][mod_fastcgi]\n* [Read more on mod_fcgid][mod_fcgid]\n* [Read more on mod_proxy_fcgi][mod_proxy_fcgi]\n* [Read more on setting up Apache and PHP-FPM with mod_proxy_fcgi][tutorial-mod_proxy_fcgi]\n\n\n[nginx]: https://nginx.org/\n[phpfpm]: https://www.php.net/install.fpm\n[secure-nginx-phpfpm]: https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/\n[apache-modules]: https://httpd.apache.org/docs/2.4/mod/\n[prefork MPM]: https://httpd.apache.org/docs/2.4/mod/prefork.html\n[worker MPM]: https://httpd.apache.org/docs/2.4/mod/worker.html\n[event MPM]: https://httpd.apache.org/docs/2.4/mod/event.html\n[apache]: https://httpd.apache.org/\n[apache-MPM]: https://httpd.apache.org/docs/2.4/mod/mpm_common.html\n[mod_fastcgi]: https://blogs.oracle.com/opal/post/php-fpm-fastcgi-process-manager-with-apache-2\n[mod_fcgid]: https://httpd.apache.org/mod_fcgid/\n[mod_proxy_fcgi]: https://httpd.apache.org/docs/current/mod/mod_proxy_fcgi.html\n[tutorial-mod_proxy_fcgi]: https://serversforhackers.com/video/apache-and-php-fpm\n"
  },
  {
    "path": "_posts/12-04-01-Shared-Servers.md",
    "content": "---\nisChild: true\nanchor:  shared_servers\n---\n\n## Shared Servers {#shared_servers_title}\n\nPHP has shared servers to thank for its popularity. It is hard to find a host without PHP installed, but be sure it's\nthe latest version. Shared servers allow you and other developers to deploy websites to a single machine. The upside to\nthis is that it has become a cheap commodity. The downside is that you never know what kind of a ruckus your\nneighboring tenants are going to create; loading down the server or opening up security holes are the main concerns. If\nyour project's budget can afford to avoid shared servers, you should.\n\nMake sure your shared servers are offering the latest versions of PHP.\n"
  },
  {
    "path": "_posts/12-05-01-Building-your-Application.md",
    "content": "---\nisChild: true\nanchor:  building_and_deploying_your_application\n---\n\n## Building and Deploying your Application {#building_and_deploying_your_application_title}\n\nIf you find yourself doing manual database schema changes or running your tests manually before updating your files\n(manually), think twice! With every additional manual task needed to deploy a new version of your app, the chances for\npotentially fatal mistakes increase. Whether you're dealing with a simple update, a comprehensive build process or even\na continuous integration strategy, [build automation][buildautomation] is your friend.\n\nAmong the tasks you might want to automate are:\n\n* Dependency management\n* Compilation, minification of your assets\n* Running tests\n* Creation of documentation\n* Packaging\n* Deployment\n\n\n### Deployment Tools\n\nDeployment tools can be described as a collection of scripts that handle common tasks of software deployment. The deployment tool is not a part of your software, it acts on your software from 'outside'.\n\nThere are many open source tools available to help you with build automation and deployment, some are written in PHP others aren't. This shouldn't hold you back from using them, if they're better suited for the specific job. Here are a few examples:\n\n[Phing] can control your packaging, deployment or testing process from within a XML build file. Phing (which is based on [Apache Ant]) provides a rich set of tasks usually needed to install or update a web application and can be extended with additional custom tasks, written in PHP. It's a solid and robust tool and has been around for a long time, however the tool could be perceived as a bit old fashioned because of the way it deals with configuration (XML files).\n\n[Capistrano] is a system for *intermediate-to-advanced programmers* to execute commands in a structured, repeatable way on one or more remote machines. It is pre-configured for deploying Ruby on Rails applications, however you can successfully deploy PHP systems with it. Successful use of Capistrano depends on a working knowledge of Ruby and Rake.\n\n[Ansistrano] is a couple of Ansible roles to easily manage the deployment process (deploy and rollback) for scripting applications such as PHP, Python and Ruby. It's an Ansible port for [Capistrano]. It's been used by quite a lot of PHP companies already.\n\n[Deployer] is a deployment tool written in PHP. It's simple and functional. Features include running tasks in parallel, atomic deployment and keeping consistency between servers. Recipes of common tasks for Symfony, Laravel, Zend Framework and Yii are available. Younes Rafie's article [Easy Deployment of PHP Applications with Deployer][phpdeploy_deployer] is a great tutorial for deploying your application with the tool.\n\n[Magallanes] is another tool written in PHP with simple configuration done in YAML files. It has support for multiple servers and environments, atomic deployment, and has some built in tasks that you can leverage for common tools and frameworks.\n\n#### Further reading:\n\n* [Automate your project with Apache Ant][apache_ant_tutorial]\n* [Deploying PHP Applications][deploying_php_applications] - paid book on best practices and tools for PHP deployment.\n\n### Server Provisioning\n\nManaging and configuring servers can be a daunting task when faced with many servers. There are tools for dealing with this so you can automate your infrastructure to make sure you have the right servers and that they're configured properly. They often integrate with the larger cloud hosting providers (Amazon Web Services, Heroku, DigitalOcean, etc) for managing instances, which makes scaling an application a lot easier.\n\n[Ansible] is a tool that manages your infrastructure through YAML files. It's simple to get started with and can manage complex and large scale applications. There is an API for managing cloud instances and it can manage them through a dynamic inventory using certain tools.\n\n[Puppet] is a tool that has its own language and file types for managing servers and configurations. It can be used in a master/client setup or it can be used in a \"master-less\" mode. In the master/client mode the clients will poll the central master(s) for new configuration on set intervals and update themselves if necessary. In the master-less mode you can push changes to your nodes.\n\n[Chef] is a powerful Ruby based system integration framework that you can build your whole server environment or virtual boxes with. It integrates well with Amazon Web Services through their service called OpsWorks.\n\n#### Further reading:\n\n* [An Ansible Tutorial][an_ansible_tutorial]\n* [Ansible for DevOps][ansible_for_devops] - paid book on everything Ansible\n* [Ansible for AWS][ansible_for_aws] - paid book on integrating Ansible and Amazon Web Services\n* [Three part blog series about deploying a LAMP application with Chef, Vagrant, and EC2][chef_vagrant_and_ec2]\n* [Chef Cookbook which installs and configures PHP and the PEAR package management system][Chef_cookbook]\n* [Chef video tutorial series][Chef_tutorial]\n\n### Continuous Integration\n\n> Continuous Integration is a software development practice where members of a team integrate their work frequently,\n> usually each person integrates at least daily — leading to multiple integrations per day. Many teams find that this\n> approach leads to significantly reduced integration problems and allows a team to develop cohesive software more\n> rapidly.\n\n*-- Martin Fowler*\n\nThere are different ways to implement continuous integration for PHP. [Travis CI] has done a great job of\nmaking continuous integration a reality even for small projects. Travis CI is a hosted continuous integration service.\nIt can be integrated with GitHub and offers support for many languages including PHP.\nGitHub has continuous integration workflows with [GitHub Actions][github_actions].\n\n#### Further reading:\n\n* [Continuous Integration with Jenkins][Jenkins]\n* [Continuous Integration with PHPCI][PHPCI]\n* [Continuous Integration with PHP Censor][PHP Censor]\n* [Continuous Integration with Teamcity][Teamcity]\n\n[buildautomation]: https://wikipedia.org/wiki/Build_automation\n[Phing]: https://www.phing.info/\n[Apache Ant]: https://ant.apache.org/\n[Capistrano]: https://capistranorb.com/\n[Ansistrano]: https://ansistrano.com\n[phpdeploy_deployer]: https://www.sitepoint.com/deploying-php-applications-with-deployer/\n[Chef]: https://www.chef.io/\n[chef_vagrant_and_ec2]: https://web.archive.org/web/20190307220000/http://www.jasongrimes.org/2012/06/managing-lamp-environments-with-chef-vagrant-and-ec2-1-of-3/\n[Chef_cookbook]: https://github.com/sous-chefs/php\n[Chef_tutorial]: https://www.youtube.com/playlist?list=PL11cZfNdwNyNYcpntVe6js-prb80LBZuc\n[apache_ant_tutorial]: https://code.tutsplus.com/tutorials/automate-your-projects-with-apache-ant--net-18595\n[Travis CI]: https://www.travis-ci.com/\n[Jenkins]: https://jenkins.io/\n[PHPCI]: https://github.com/dancryer/phpci\n[PHP Censor]: https://github.com/php-censor/php-censor\n[Teamcity]: https://www.jetbrains.com/teamcity/\n[Deployer]: https://deployer.org/\n[Magallanes]: https://www.magephp.com/\n[deploying_php_applications]: https://deployingphpapplications.com/\n[Ansible]: https://www.ansible.com/\n[Puppet]: https://puppet.com/\n[ansible_for_devops]: https://leanpub.com/ansible-for-devops\n[ansible_for_aws]: https://leanpub.com/ansible-for-aws\n[an_ansible_tutorial]: https://serversforhackers.com/an-ansible-tutorial\n[github_actions]: https://docs.github.com/en/actions\n"
  },
  {
    "path": "_posts/13-01-01-Virtualization.md",
    "content": "---\nanchor: virtualization\n---\n\n# Virtualization {#virtualization_title}\n\nRunning your application on different environments in development and production can lead to strange bugs popping up\nwhen you go live. It's also tricky to keep different development environments up to date with the same version for all\nlibraries used when working with a team of developers.\n\nIf you are developing on Windows and deploying to Linux (or anything non-Windows) or are developing in a team, you\nshould consider using a virtual machine. This sounds tricky, but besides the widely known virtualization environments\nlike VMware or VirtualBox, there are additional tools that may help you setting up a virtual environment in a few easy\nsteps.\n"
  },
  {
    "path": "_posts/13-02-01-Vagrant.md",
    "content": "---\nisChild: true\nanchor:  vagrant\n---\n\n## Vagrant {#vagrant_title}\n\n[Vagrant] helps you build your virtual boxes on top of the known virtual environments and will configure these\nenvironments based on a single configuration file. These boxes can be set up manually, or you can use \"provisioning\"\nsoftware such as [Puppet] or [Chef] to do this for you. Provisioning the base box is a great way to ensure that\nmultiple boxes are set up in an identical fashion and removes the need for you to maintain complicated \"set up\"\ncommand lists. You can also \"destroy\" your base box and recreate it without many manual steps, making it easy to create\na \"fresh\" installation.\n\nVagrant creates folders for sharing your code between your host and your virtual machine, which means that you can\ncreate and edit your files on your host machine and then run the code inside your virtual machine.\n\n\n[Vagrant]: https://www.vagrantup.com/\n[Puppet]: https://puppet.com/\n[Chef]: https://www.chef.io/\n"
  },
  {
    "path": "_posts/13-03-01-Docker.md",
    "content": "---\nisChild: true\nanchor:  docker\n---\n\n## Docker {#docker_title}\n\n[Docker] - a lightweight alternative to a full virtual machine - is so called because it's all about \"containers\".  A container is a building block which, in the simplest case, does one specific job, e.g. running a web server.  An \"image\" is the package you use to build the container - Docker has a repository full of them.\n\nA typical LAMP application might have three containers: a web server, a PHP-FPM process and MySQL. As with shared folders in Vagrant, you can leave your application files where they are and tell Docker where to find them.\n\nYou can generate containers from the command line (see example below) or, for ease of maintenance, build a `docker-compose.yml` file for your project specifying which to create and how they communicate with one another.\n\nDocker may help if you're developing multiple websites and want the separation that comes from installing each on its own virtual machine, but don't have the necessary disk space or the time to keep everything up to date.  It's efficient: the installation and downloads are quicker, you only need to store one copy of each image however often it's used, containers need less RAM and share the same OS kernel, so you can have more servers running simultaneously, and it takes a matter of seconds to stop and start them, no need to wait for a full server boot.\n\n### Example: Running your PHP Applications in Docker\n\nAfter [installing docker][docker-install] on your machine, you can start a web server with one command.\nThe following will download a fully functional Apache installation with the latest PHP version, map `/path/to/your/php/files` to the document root, which you can view at `http://localhost:8080`:\n\n{% highlight console %}\ndocker run -d --name my-php-webserver -p 8080:80 -v /path/to/your/php/files:/var/www/html/ php:apache\n{% endhighlight %}\n\nThis will initialize and launch your container. `-d` makes it run in the background. To stop and start it, simply run `docker stop my-php-webserver` and `docker start my-php-webserver` (the other parameters are not needed again).\n\n### Learn more about Docker\n\nThe command above shows a quick way to run a basic server.  There's much more you can do (and thousands of pre-built images in the [Docker Hub][docker-hub]). Take time to learn the terminology and read the [Docker User Guide][docker-doc] to get the most from it, and don't run random code you've downloaded without checking it's safe – unofficial images may not have the latest security patches. If in doubt, stick to the [official repositiories][docker-hub-official].\n\nThe [PHPDocker.io] site will auto-generate all the files you need for a fully-featured LAMP/LEMP stack, including your choice of PHP version and extensions.\n\n* [Docker Website][Docker]\n* [Docker Installation][docker-install]\n* [Docker User Guide][docker-doc]\n* [Docker Hub][docker-hub]\n* [Docker Hub - official images][docker-hub-official]\n\n[Docker]: https://www.docker.com/\n[docker-hub]: https://hub.docker.com/\n[docker-hub-official]: https://hub.docker.com/explore/\n[docker-install]: https://docs.docker.com/get-docker/\n[docker-doc]: https://docs.docker.com/\n[PHPDocker.io]: https://phpdocker.io/\n"
  },
  {
    "path": "_posts/14-01-01-Caching.md",
    "content": "---\nanchor: caching\n---\n\n# Caching {#caching_title}\n\nPHP is pretty quick by itself, but bottlenecks can arise when you make remote connections, load files, etc. \nThankfully, there are various tools available to speed up certain parts of your application, or reduce the number of times these various time-consuming tasks need to run.\n"
  },
  {
    "path": "_posts/14-02-01-Opcode-Cache.md",
    "content": "---\nisChild: true\nanchor:  opcode_cache\n---\n\n## Opcode Cache {#opcode_cache_title}\n\nWhen a PHP file is executed, it must first be compiled into [opcodes](https://php-legacy-docs.zend.com/manual/php4/en/internals2.opcodes) (machine language instructions for the CPU). If the source code is unchanged, the opcodes will be the same, so this compilation step becomes a waste of CPU resources.\n\nAn opcode cache prevents redundant compilation by storing opcodes in memory and reusing them on successive calls. It will typically check signature or modification time of the file first, in case there have been any changes.\n\nIt's likely an opcode cache will make a significant speed improvement to your application.  Since PHP 5.5 there is one built in - [Zend OPcache][opcache-book]. Depending on your PHP package/distribution, it's usually turned on by default - check [opcache.enable](https://www.php.net/manual/opcache.configuration.php#ini.opcache.enable) and the output of `phpinfo()` to make sure. For earlier versions there's a PECL extension.\n\nRead more about opcode caches:\n\n* [Zend OPcache][opcache-book] (bundled with PHP since 5.5)\n* Zend OPcache (formerly known as Zend Optimizer+) is now [open source][Zend Optimizer+]\n* [WinCache] (extension for MS Windows Server)\n* [list of PHP accelerators on Wikipedia][PHP_accelerators]\n* [PHP Preloading] - PHP >= 7.4\n\n\n[opcache-book]: https://www.php.net/book.opcache\n[Zend Optimizer+]: https://github.com/zendtech/ZendOptimizerPlus\n[WinCache]: https://www.iis.net/downloads/microsoft/wincache-extension\n[PHP_accelerators]: https://wikipedia.org/wiki/List_of_PHP_accelerators\n[PHP Preloading]: https://www.php.net/opcache.preloading\n"
  },
  {
    "path": "_posts/14-03-01-Object-Caching.md",
    "content": "---\nisChild: true\nanchor:  object_caching\n---\n\n## Object Caching {#object_caching_title}\n\nThere are times when it can be beneficial to cache individual objects in your code, such as with data that is expensive\nto get or database calls where the result is unlikely to change. You can use object caching software to hold these\npieces of data in memory for extremely fast access later on. If you save these items to a data store after you retrieve\nthem, then pull them directly from the cache for following requests, you can gain a significant improvement in\nperformance as well as reduce the load on your database servers.\n\nMany of the popular bytecode caching solutions let you cache custom data as well, so there's even more reason to take\nadvantage of them. APCu and WinCache both provide APIs to save data from your PHP code to their memory cache.\n\nThe most commonly used memory object caching systems are APCu and memcached. APCu is an excellent choice for object\ncaching, it includes a simple API for adding your own data to its memory cache and is very easy to setup and use. The\none real limitation of APCu is that it is tied to the server it's installed on. Memcached on the other hand is\ninstalled as a separate service and can be accessed across the network, meaning that you can store objects in a\nhyper-fast data store in a central location and many different systems can pull from it.\n\nNote that whether the cache is shared across PHP processes depends on how PHP is used. When running PHP via PHP-FPM,\nthe cache is shared across all processes of all pools. When running PHP as a (Fast-)CGI application inside your\nwebserver, the cache is not shared, i.e every PHP process will have its own APCu data. When running PHP on the command\nline, the cache is not shared and will only exist for the duration of the command, so you have to be mindful of your\nsituation and goals. You might want to consider using memcached instead, as it's not tied to the PHP processes.\n\nIn a networked configuration APCu will usually outperform memcached in terms of access speed, but memcached will be\nable to scale up faster and further. If you do not expect to have multiple servers running your application, or do not\nneed the extra features that memcached offers then APCu is probably your best choice for object caching.\n\nExample logic using APCu:\n\n{% highlight php %}\n<?php\n// check if there is data saved as 'expensive_data' in cache\n$data = apcu_fetch('expensive_data');\nif ($data === false) {\n    // data is not in cache; save result of expensive call for later use\n    apcu_add('expensive_data', $data = get_expensive_data());\n}\n\nprint_r($data);\n{% endhighlight %}\n\n### Learn more about popular object caching systems:\n\n* [APCu](https://github.com/krakjoe/apcu)\n* [APCu Documentation](https://www.php.net/apcu)\n* [Memcached](https://memcached.org/)\n* [Redis](https://redis.io/)\n* [WinCache Functions](https://www.php.net/ref.wincache)\n"
  },
  {
    "path": "_posts/15-01-01-Documenting.md",
    "content": "---\nanchor: documenting\ntitle:  Documenting your Code\n---\n\n# Documenting your Code {#documenting_title}\n"
  },
  {
    "path": "_posts/15-02-01-PHPDoc.md",
    "content": "---\nisChild: true\ntitle:   PHPDoc\nanchor:  phpdoc\n---\n\n## PHPDoc {#phpdoc_title}\n\nPHPDoc is an informal standard for commenting PHP code. There are a *lot* of different [tags] available. The full list\nof tags and examples can be found at the [PHPDoc manual].\n\nBelow is an example of how you might document a class with a few methods;\n\n{% highlight php %}\n<?php\n/**\n * @author A Name <a.name@example.com>\n * @link https://docs.phpdoc.org/\n */\nclass DateTimeHelper\n{\n    /**\n     * @param mixed $anything Anything that we can convert to a \\DateTime object\n     *\n     * @throws \\InvalidArgumentException\n     *\n     * @return \\DateTime\n     */\n    public function dateTimeFromAnything($anything)\n    {\n        $type = gettype($anything);\n\n        switch ($type) {\n            // Some code that tries to return a \\DateTime object\n        }\n\n        throw new \\InvalidArgumentException(\n            \"Failed Converting param of type '{$type}' to DateTime object\"\n        );\n    }\n\n    /**\n     * @param mixed $date Anything that we can convert to a \\DateTime object\n     *\n     * @return void\n     */\n    public function printISO8601Date($date)\n    {\n        echo $this->dateTimeFromAnything($date)->format('c');\n    }\n\n    /**\n     * @param mixed $date Anything that we can convert to a \\DateTime object\n     */\n    public function printRFC2822Date($date)\n    {\n        echo $this->dateTimeFromAnything($date)->format('r');\n    }\n}\n{% endhighlight %}\n\nThe documentation for the class as a whole has the [@author] tag and a [@link] tag. The [@author] tag is used to\ndocument the author of the code and can be repeated for documenting several authors. The [@link] tag is used to link to a website indicating a relationship between the website and the code.\n\nInside the class, the first method has a [@param] tag documenting the type, name and description of the parameter\nbeing passed to the method. Additionally it has the [@return] and [@throws] tags for documenting the return type, and any exceptions that could be thrown respectively.\n\nThe second and third methods are very similar and have a single [@param] tag as did the first method. The important\ndifference between the second and third methods' doc block is the inclusion/exclusion of the [@return] tag.\n`@return void` explicitly informs us that there is no return; historically omitting the `@return void` statement also results in the same (no return) action.\n\n\n[tags]: https://docs.phpdoc.org/guide/references/phpdoc/tags/\n[PHPDoc manual]: https://docs.phpdoc.org/\n[@author]: https://docs.phpdoc.org/guide/references/phpdoc/tags/author.html\n[@link]: https://docs.phpdoc.org/guide/references/phpdoc/tags/link.html\n[@param]: https://docs.phpdoc.org/guide/references/phpdoc/tags/param.html\n[@return]: https://docs.phpdoc.org/guide/references/phpdoc/tags/return.html\n[@throws]: https://docs.phpdoc.org/guide/references/phpdoc/tags/throws.html\n"
  },
  {
    "path": "_posts/16-01-01-Resources.md",
    "content": "---\nanchor: resources\n---\n\n# Resources {#resources_title}\n"
  },
  {
    "path": "_posts/16-02-01-From-the-Source.md",
    "content": "---\ntitle:   From the Source\nisChild: true\nanchor:  from_the_source\n---\n\n## From the Source {#from_the_source_title}\n\n* [PHP Website](https://www.php.net/)\n* [PHP Documentation](https://www.php.net/docs.php)\n"
  },
  {
    "path": "_posts/16-03-01-People-to-Follow.md",
    "content": "---\ntitle:   People to Follow\nisChild: true\nanchor:  people_to_follow\n---\n\n## People to Follow {#people_to_follow_title}\n\nIt's difficult to find interesting and knowledgeable PHP\ncommunity members when you are first starting out. You can\nfind an abbreviated list of PHP community members to get you started at:\n\n* <https://www.ogprogrammer.com/2017/06/28/how-to-get-connected-with-the-php-community/>\n* <https://x.com/CalEvans/lists/phpeople>\n"
  },
  {
    "path": "_posts/16-05-01-PHP-PaaS-Providers.md",
    "content": "---\ntitle: PHP PaaS Providers\nisChild: true\nanchor:  php_paas_providers\n---\n\n## PHP PaaS Providers {#php_paas_providers_title}\n\n* [Amezmo](https://www.amezmo.com)\n* [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)\n* [Bref Cloud](https://bref.sh/cloud)\n* [Clever Cloud](https://clever-cloud.com)\n* [Cloudways](https://www.cloudways.com/)\n* [DigitalOcean App Platform](https://www.digitalocean.com/products/app-platform)\n* [Divio](https://www.divio.com/)\n* [Engine Yard Cloud](https://www.engineyard.com/)\n* [fortrabbit](https://www.fortrabbit.com/)\n* [Google App Engine](https://cloud.google.com/appengine/docs/php/)\n* [Heroku](https://devcenter.heroku.com/categories/php-support)\n* [IBM Cloud](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prep#prep_php)\n* [Lumen](https://www.lumen.com/)\n* [Microsoft Azure](https://azure.microsoft.com/)\n* [Pivotal Web Services](https://network.pivotal.io/)\n* [Platform.sh](https://platform.sh/)\n* [Red Hat OpenShift](https://www.openshift.com/)\n* [Virtuozzo](https://www.virtuozzo.com/application-platform-partners/)\n"
  },
  {
    "path": "_posts/16-06-01-Frameworks.md",
    "content": "---\nisChild: true\nanchor:  frameworks\n---\n\n## Frameworks {#frameworks_title}\n\nRather than re-invent the wheel, many PHP developers use frameworks to build out web applications. Frameworks abstract\naway many of the low-level concerns and provide helpful, easy-to-use interfaces to complete common tasks.\n\nYou do not need to use a framework for every project. Sometimes plain PHP is the right way to go, but if you do need a\nframework then there are three main types available:\n\n* Micro Frameworks\n* Full-Stack Frameworks\n* Component Frameworks\n\nMicro-frameworks are essentially a wrapper to route a HTTP request to a callback, controller, method, etc as quickly as\npossible, and sometimes come with a few extra libraries to assist development such as basic database wrappers and the\nlike. They are prominently used to build remote HTTP services.\n\nMany frameworks add a considerable number of features on top of what is available in a micro-framework; these are\ncalled Full-Stack Frameworks. These often come bundled with ORMs, Authentication packages, etc.\n\nComponent-based frameworks are collections of specialized and single-purpose libraries. Disparate component-based\nframeworks can be used together to make a micro- or full-stack framework.\n"
  },
  {
    "path": "_posts/16-07-01-Components.md",
    "content": "---\nisChild: true\nanchor:  components\n---\n\n## Components {#components_title}\n\nAs mentioned above \"Components\" are another approach to the common goal of creating, distributing and implementing\nshared code. Various component repositories exist, the main two of which are:\n\n* [Packagist]\n* [PEAR]\n\nBoth of these repositories have command line tools associated with them to help the installation and upgrade processes,\nand have been explained in more detail in the [Dependency Management] section.\n\nThere are also component-based frameworks and component-vendors that offer no framework at all. These projects provide\nanother source of packages which ideally have little to no dependencies on other packages, or specific frameworks.\n\nFor example, you can use the [FuelPHP Validation package], without needing to use the FuelPHP framework itself.\n\n* [Aura]\n* CakePHP Components\n    * [Collection]\n    * [Database]\n    * [Datasource]\n    * [Event]\n    * [I18n]\n    * [ORM]   \n* [FuelPHP]\n* [Hoa Project]\n* [Symfony Components]\n* [The League of Extraordinary Packages]\n* Laravel's Illuminate Components\n    * [IoC Container]\n    * [Eloquent ORM]\n    * [Queue]\n\n_Laravel's [Illuminate components] will become better decoupled from the Laravel framework. For now, only the\ncomponents best decoupled from the Laravel framework are listed above._\n\n\n[Packagist]: /#composer_and_packagist\n[PEAR]: /#pear\n[Dependency Management]: /#dependency_management\n[FuelPHP Validation package]: https://github.com/fuelphp/validation\n[Aura]: https://auraphp.com/framework/\n[FuelPHP]: https://github.com/fuelphp\n[Hoa Project]: https://github.com/hoaproject\n[Symfony Components]: https://symfony.com/components\n[The League of Extraordinary Packages]: https://thephpleague.com/\n[IoC Container]: https://github.com/illuminate/container\n[Eloquent ORM]: https://github.com/illuminate/database\n[Queue]: https://github.com/illuminate/queue\n[Illuminate components]: https://github.com/illuminate\n[Collection]: https://github.com/cakephp/collection\n[Database]: https://github.com/cakephp/database\n[Datasource]: https://github.com/cakephp/datasource\n[Event]: https://github.com/cakephp/event\n[I18n]: https://github.com/cakephp/i18n\n[ORM]: https://github.com/cakephp/orm\n"
  },
  {
    "path": "_posts/16-08-01-Sites.md",
    "content": "---\nisChild: true\nanchor:  other_resources\ntitle:   Other Useful Resources\n---\n\n## Other Useful Resources {#other_resources_title}\n\n### Cheatsheets\n\n* [PHP Cheatsheets](https://phpcheatsheets.com/) - for variable comparisons, arithmetics and variable testing in various PHP versions.\n* [Modern PHP Cheatsheet](https://github.com/smknstd/modern-php-cheatsheet) - documents modern (PHP 7.0+) idioms in a unified document.\n* [OWASP Security Cheatsheets](https://owasp.org/www-project-cheat-sheets/) - provides a concise collection of high value information on specific application security topics. \n\n### More best practices\n\n* [PHP Best Practices](https://phpbestpractices.org/)\n* [Why You Should Be Using Supported PHP Versions](https://kinsta.com/blog/php-versions/)\n\n### News around the PHP and web development communities\n\nYou can subscribe to weekly newsletters to keep yourself informed on new libraries, latest news, events and general\nannouncements, as well as additional resources being published every now and then:\n\n* [PHP Weekly](https://www.phpweekly.com)\n* [JavaScript Weekly](https://javascriptweekly.com/)\n* [Frontend Focus](https://frontendfoc.us/)\n* [Mobile Web Weekly](https://mobiledevweekly.com/)\n\nThere are also Weeklies on other platforms you might be interested in; here's [a list of some](https://github.com/jondot/awesome-weekly).\n\n### PHP universe\n\n* [PHP Developer blog](https://blog.phpdeveloper.org/)\n"
  },
  {
    "path": "_posts/16-09-01-Videos.md",
    "content": "---\nisChild: true\nanchor:  videos\ntitle:   Video Tutorials\n---\n\n## Video Tutorials {#videos}\n\n### YouTube Channels\n\n* [Learn PHP The Right Way Series](https://github.com/ggelashvili/learnphptherightway-outline)\n* [PHP Academy](https://www.youtube.com/user/phpacademy)\n* [The New Boston](https://www.youtube.com/user/thenewboston)\n* [Sherif Ramadan](https://www.youtube.com/user/businessgeek)\n* [Level Up Tuts](https://www.youtube.com/user/LevelUpTuts)\n\n### Paid Videos\n\n* [Standards and Best practices](https://teamtreehouse.com/library/php-standards-and-best-practices)\n* [PHP Training on Pluralsight](https://www.pluralsight.com/search?q=php)\n* [PHP Training on LinkedIn.com](https://www.linkedin.com/learning/search?trk=lynda_redirect_learning&sortBy=RELEVANCE&softwareNames=PHP)\n* [PHP Training on Tutsplus](https://code.tutsplus.com/categories/php/courses)\n* [Laracasts](https://laracasts.com/)\n* [SymfonyCasts](https://symfonycasts.com/)\n"
  },
  {
    "path": "_posts/16-10-01-Books.md",
    "content": "---\nisChild: true\nanchor:  books\n---\n\n## Books {#books_title}\n\nThere are many PHP books; sadly some are now quite old and no longer accurate. In particular, avoid books on \"PHP 6\", a version that will now never exist. The next major release of PHP after 5.6 was \"PHP 7\", [partly because of this](https://wiki.php.net/rfc/php6).\n\nThis section aims to be a living document for recommended books on PHP development in general. If you would like your\nbook to be added, send a PR and it will be reviewed for relevancy.\n\n### Free Books\n\n* [PHP Pandas](https://daylerees.com/php-pandas/) - Aims to teach everyone how to be a web developer.\n* [PHP The Right Way](https://leanpub.com/phptherightway/) - This website is available as a book completely for free.\n* [Using Libsodium in PHP Projects](https://paragonie.com/book/pecl-libsodium) - Guide to using Libsodium PHP extension\nfor modern, secure, and fast cryptography.\n\n### Paid Books\n\n* [PHP & MySQL](https://phpandmysql.com/) - PHP book with excellent illustrations that covers all the fundamentals of PHP and MySQL with practical examples.\n* [Build APIs You Won't Hate](https://apisyouwonthate.com/) - Everyone and their dog wants an API,\nso you should probably learn how to build them.\n* [Modern PHP](https://www.oreilly.com/library/view/modern-php/9781491905173/) - Covers modern PHP features, best practices, testing, tuning, deployment and setting up a dev environment.\n* [Building Secure PHP Apps](https://leanpub.com/buildingsecurephpapps) - Learn the security basics that a senior\ndeveloper usually acquires over years of experience, all condensed down into one quick and easy handbook.\n* [Modernizing Legacy Applications In PHP](https://leanpub.com/mlaphp) - Get your code under control in a series of\nsmall, specific steps.\n* [Securing PHP: Core Concepts](https://leanpub.com/securingphp-coreconcepts) - A guide to some of the most common\nsecurity terms and provides some examples of them in every day PHP.\n* [Scaling PHP](https://www.scalingphpbook.com/) - Stop playing sysadmin and get back to coding.\n* [Signaling PHP](https://leanpub.com/signalingphp) - PCNLT signals are a great help when writing PHP scripts that\nrun from the command line.\n* [Minimum Viable Tests](https://leanpub.com/minimumviabletests) - Long-time PHP testing evangelist Chris Hartjes goes over what he feels is the minimum you need to know to get started.\n* [Domain-Driven Design in PHP](https://leanpub.com/ddd-in-php) - See real examples written in PHP showcasing Domain-Driven Design Architectural Styles (Hexagonal Architecture, CQRS or Event Sourcing), Tactical Design Patterns, and Bounded Context Integration.\n"
  },
  {
    "path": "_posts/17-01-01-Community.md",
    "content": "---\nanchor: community\n---\n\n# Community {#community_title}\n\nThe PHP community is as diverse as it is large, and its members are ready and willing to support new PHP programmers.\nConsider joining your local PHP user group (PUG) or attending larger PHP conferences to learn more about the best\npractices shown here. You can hang out on IRC in the #phpc channel on [irc.libera.chat][php-irc] and follow the\n@phpc, on [Discord][php-discord], on [X][phpc-x] or [Mastodon][phpc-mastodon]. Get out there, meet new developers, learn new topics, and above all, make new\nfriends! Other community resources include [StackOverflow][php-so].\n\n[Read the Official PHP Events Calendar][php-calendar]\n\n\n[php-irc]: https://web.libera.chat/#phpc\n[php-discord]: https://phpc.chat/\n[phpc-x]: https://x.com/phpc\n[phpc-mastodon]: https://phpc.social/\n[php-so]: https://stackoverflow.com/questions/tagged/php\n[php-calendar]: https://www.php.net/cal.php\n"
  },
  {
    "path": "_posts/17-02-01-User-Groups.md",
    "content": "---\nisChild: true\nanchor:  user_groups\n---\n\n## PHP User Groups {#user_groups_title}\n\nIf you live in a larger city, odds are there's a PHP user group nearby. You can easily find your local PUG at\n[PHP.ug][php-ug]. Alternate sources might be [Meetup.com][meetup] or a search for ```php user group near me```\nusing your favorite search engine (i.e. [Google][google]). If you live in a smaller town, there may not be a\nlocal PUG; if that's the case, start one!\n\nSpecial mention should be made of two global user groups: [NomadPHP] and [PHPWomen]. [NomadPHP] offers twice monthly\nonline user group meetings with presentations by some of the top speakers in the PHP community.\n[PHPWomen] is a non-exclusive user group originally targeted towards the women in the PHP world. Membership is open to\neveryone who supports a more diverse community. PHPWomen provide a network for support, mentorship and education, and\ngenerally promote the creating of a \"female friendly\" and professional atmosphere.\n\n[Read about User Groups on the PHP Wiki][php-wiki]\n\n[google]: https://www.google.com/search?q=php+user+group+near+me\n[meetup]: https://www.meetup.com/find/\n[php-ug]: https://php.ug/\n[NomadPHP]: https://nomadphp.com/\n[PHPWomen]: https://x.com/PHPWomen\n[php-wiki]: https://wiki.php.net/usergroups\n"
  },
  {
    "path": "_posts/17-03-01-Conferences.md",
    "content": "---\nisChild: true\nanchor:  conferences\n---\n\n## PHP Conferences {#conferences_title}\n\nThe PHP community also hosts larger regional and national conferences in many countries around the world. Well-known\nmembers of the PHP community usually speak at these larger events, so it's a great opportunity to learn directly from\nindustry leaders.\n\n[Find a PHP Conference][php-conf]\n\n\n[php-conf]: https://www.php.net/conferences/index.php\n"
  },
  {
    "path": "_posts/17-04-01-Elephpants.md",
    "content": "---\nisChild: true\nanchor:  elephpants\n---\n\n## ElePHPants {#elephpants_title}\n\n[ElePHPant][elephpant] is that beautiful mascot of the PHP project with an elephant in its design. It was originally designed for the PHP project in 1998 by [Vincent Pontier][vincent-pontier] - spiritual father of thousands of elePHPants around the world - and ten years later adorable plush elephant toys came to birth as well. Now elePHPants are present at many PHP conferences and with many PHP developers at their computers for fun and inspiration.\n\n[Interview with Vincent Pontier][vincent-pontier-interview]\n\n\n[elephpant]: https://www.php.net/elephpant.php\n[vincent-pontier-interview]: https://7php.com/elephpant/\n[vincent-pontier]: http://www.elroubio.net/\n"
  },
  {
    "path": "banners.md",
    "content": "---\nlayout: page\ntitle: Website Banners\ndescription: \"Spread the word! Use these banner to let new PHP programmers know about PHP: The Right Way\"\nsitemap: true\n---\n\n# Web Banners\n\nSpread the word with _PHP: The Right Way_ banner images! Show new PHP developers where to find good information.\n\n## Button 1 (120x90)\n\n<p><img src=\"/images/banners/btn1-120x90.png\" alt=\"PHP: The Right Way\"/></p>\n\n{% highlight html %}\n<a href=\"https://www.phptherightway.com\">\n    <img src=\"https://www.phptherightway.com/images/banners/btn1-120x90.png\" alt=\"PHP: The Right Way\"/>\n</a>\n{% endhighlight %}\n\n## Button 2 (120x60)\n\n<p><img src=\"/images/banners/btn2-120x60.png\" alt=\"PHP: The Right Way\"/></p>\n\n{% highlight html %}\n<a href=\"https://www.phptherightway.com\">\n    <img src=\"https://www.phptherightway.com/images/banners/btn2-120x60.png\" alt=\"PHP: The Right Way\"/>\n</a>\n{% endhighlight %}\n\n## Leaderboard (728x90)\n\n<p><img src=\"/images/banners/leaderboard-728x90.png\" alt=\"PHP: The Right Way\"/></p>\n\n{% highlight html %}\n<a href=\"https://www.phptherightway.com\">\n    <img src=\"https://www.phptherightway.com/images/banners/leaderboard-728x90.png\" alt=\"PHP: The Right Way\"/>\n</a>\n{% endhighlight %}\n\n## Large Rectangle (386x280)\n\n<p><img src=\"/images/banners/lg-rect-386x280.png\" alt=\"PHP: The Right Way\"/></p>\n\n{% highlight html %}\n<a href=\"https://www.phptherightway.com\">\n    <img src=\"https://www.phptherightway.com/images/banners/lg-rect-386x280.png\" alt=\"PHP: The Right Way\"/>\n</a>\n{% endhighlight %}\n\n## Medium Rectangle (300x250)\n\n<p><img src=\"/images/banners/med-rect-300x250.png\" alt=\"PHP: The Right Way\"/></p>\n\n{% highlight html %}\n<a href=\"https://www.phptherightway.com\">\n    <img src=\"https://www.phptherightway.com/images/banners/med-rect-300x250.png\" alt=\"PHP: The Right Way\"/>\n</a>\n{% endhighlight %}\n\n## Rectangle (180x150)\n\n<p><img src=\"/images/banners/rect-180x150.png\" alt=\"PHP: The Right Way\"/></p>\n\n{% highlight html %}\n<a href=\"https://www.phptherightway.com\">\n    <img src=\"https://www.phptherightway.com/images/banners/rect-180x150.png\" alt=\"PHP: The Right Way\"/>\n</a>\n{% endhighlight %}\n\n## Square Button (125x125)\n\n<p><img src=\"/images/banners/sq-btn-125x125.png\" alt=\"PHP: The Right Way\"/></p>\n\n{% highlight html %}\n<a href=\"https://www.phptherightway.com\">\n    <img src=\"https://www.phptherightway.com/images/banners/sq-btn-125x125.png\" alt=\"PHP: The Right Way\"/>\n</a>\n{% endhighlight %}\n\n## Vertical Rectangle (240x400)\n\n<p><img src=\"/images/banners/vert-rect-240x400.png\" alt=\"PHP: The Right Way\"/></p>\n\n{% highlight html %}\n<a href=\"https://www.phptherightway.com\">\n    <img src=\"https://www.phptherightway.com/images/banners/vert-rect-240x400.png\" alt=\"PHP: The Right Way\"/>\n</a>\n{% endhighlight %}\n"
  },
  {
    "path": "css/all.css",
    "content": "*{box-sizing:border-box}body{font-size:24px;line-height:32px;text-rendering:optimizeLegibility}h1,h2,h3,h4{font-family:georgia,serif}h1,.alpha{position:relative;font-size:48px;font-weight:normal;line-height:50px;text-align:center}h2,.beta{font-size:32px;font-weight:normal;line-height:36px}h3,.gamma{font-size:24px;font-weight:bold;line-height:30px}blockquote{border-left:3px solid #ccc;padding-left:20px;color:#777;font-style:italic;word-wrap:break-word}a{color:#4f5b93}a:hover{color:#8892bf}.back-to-top{text-align:center}.back-to-top a{background:#4f5b93;border-radius:3px;display:inline-block;height:40px;padding:0 20px;transition:all .1s ease;color:white;font-family:verdana,sans-serif;font-size:13px;line-height:40px;text-decoration:none;text-transform:uppercase}.back-to-top a:hover{background:#8892bf}img{max-width:100%}pre,code{color:#444;font-family:\"Source Code Pro\",Consolas,\"Andale Mono WT\",\"Andale Mono\",\"Lucida Console\",\"Lucida Sans Typewriter\",\"DejaVu Sans Mono\",\"Bitstream Vera Sans Mono\",\"Liberation Mono\",\"Nimbus Mono L\",Monaco,\"Courier New\",Courier,monospace;font-size:90%}a pre,a code{color:inherit}pre{background:#f7f7f7;border:1px solid #eee;border-radius:3px;display:block;overflow:auto;padding:20px;width:100%}@media (max-width:767px){body{font-size:18px;line-height:24px}h1,.alpha{font-size:36px;line-height:38px}h2,.beta{font-size:24px;line-height:28px}h3,.gamma{font-size:18px;line-height:23px}blockquote{margin-left:0}ul,ol{padding-left:1em}pre{padding:5px 10px}}@media (max-width:360px){body{font-size:16px;line-height:21px}h1,.alpha{font-size:28px;line-height:30px}h2,.beta{font-size:20px;line-height:23px}h3,.gamma{font-size:16px;line-height:20px}}.site-header{padding-top:40px;margin-bottom:40px;text-align:center}.site-header h1{margin:0;font-size:72px;line-height:60px}.site-header h1 em{display:block;font-size:34px;font-style:normal}.site-header h1 a{color:#333;text-decoration:none}.site-header h1 a:hover{color:#8892bf}.site-header .build-date{margin-bottom:10px;color:#999;font-family:verdana,sans-serif;font-size:11px;text-transform:uppercase}.site-header .btn-share{background:#8892bf;border-radius:3px;display:inline-block;height:30px;padding:0 20px;vertical-align:baseline;color:white;font-family:verdana,sans-serif;font-size:12px;line-height:30px;text-decoration:none;text-transform:uppercase}.site-header .fork-me{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJUAAACVCAMAAABmfEh9AAAAMFBMVEXr6+wSFiH////U1NT09PSRk5hucHb5+flMT1f8/Py+v8EtMDpXWWE8P0hgY2rg4OD5mIG8AAAFoElEQVR4AbSb0W4sKQxEyxfMdAyG///b1bCt3MSZ1CKth4coj0fVVp0GevDnc318POqj9cvlv1efl9taC6j18fj4+JO7AlWtrY9LDtblboVg5VKh9XkdpTUIVjIVsJqcPUSSVi7VowJ4pjWOHuKViUWodljlcOR9XN1KCVhpVOERPrHGOBz5gJVJFcN6Yp2NfHiIiVQxrI0l1xFWXlqE6vMZltOCGCGtbKqIdVgQI6SVRMXS6m9teUJFsI6dGNLKpgpYMg5Hvoe0cqhCPzz4yGemRagSRj6klUsV0zp2Ykgrg+r/j7zPK6SVSxXTmr/Lp2miEwMVTYs5cQKa5URCFdPiI9+AAg0FEdJKpootP14l1cTQ8p0YqXhaEcpEuvbvqg5ppVPF2RrfoSoKNMeJnIr31vDvM9XE4Ektz6m4E/3zaTn2PE1pLdmJnIo78aa5FuryKJ8R08qm4k70hTaXSsSKs5VNxZ24a6GsN+x8OBV34jIRhYpHJ8aWT6WKacXXwFKGYokv28l9gYstn00V0/IvWL4A8/1XxKD8aCSTird8G3vk1bpVFeFOzKTiTtxQEpLaKzoxmYqPfMG8oXps+ejEZKqANfu4PhF8Q1UsLOdOTKfiThSDVW3TU5zIqc5bXh+q6In7RE5F0vIvI9+bmEUi7sQ8KpJWh95TluFETnXuxG5+14RmOJFTnRdEv6FQWsZpIKc6d+INpYYZsKITk6m4E0W8YEqrZZ6nlURFnNgXpvhaBRqxRkgrnYqcnbYmvjAES4Q7MZkqphWceD3jumrIijgxj4qcQTTsuLy3IdyJqVQxrYjl9wYDsAMnplLFtOLID0AHDvaJyVSk5duUAisN7acTQ1r5VMSJAu2G1eUFVkgrnYq8NK/SxebBDVk+FXHiRPGzG7J8KuLEoXc07YpYwYnZVAc3ZApUPbghS6EiTgxQNhR+cEOWTMVuyC5Yl4kmMcL4dppPRZzY6i76rhi85fOpyA1Zg46FpoBFKYaWz6cip4EK1KbV2kKPaY2QVjYVaXlvXauJtHodODGXijhRGqyLFHSJKzoxn4rtqkVkHyHF5cGJyVQxrXhd0A2fTa+DOzFSJaYVjkZ03VAGANq5EyNVXlrhq5F2Q6HoMH5DFqmS0/IfTrRqz5isMCfmU3EnNvyLMyd1Yj4Vc6Ksv5WlSpyYT8X2ibC//xbixHwq4kSpRaQXF3Fpkzoxn4o4cZkCTSZUuBPzqUjL68KGWq6m3In5VMSJNqVhecMWkDpxYjYV2fn4TkqswrooCndipMpMa351omN5N+hU0ScfcWI6FTmxmS62rXhDOXFiOhVp+WvZhsK+ZVn+qxPzqchm31FcFGvtAVv+uxPzqUha0/bj87UsjFb4aiSfijqx7Ygc4Ddk+VTciebPP4CJk31iPhV34iara+5p/7Xl86m4E3dSu7mM/LogUr3fid3Wbq4u+55T24u03kZFnOjSlu3jNxGF/fx1wduo+FcjBbK9+ITq8tOJ76LiX1Jabe2GelUQ76QiTuyGuqFg80VBvJeKONE21KsTm+G9vJWKOFE21OeJTTgaeTMVSasBl0jI6nYip8qfrW9O1AY0+bneTMW/GrEKqLxYPZ+KpBWPRmb7p307SEEoBoIoqBAlIOj9byt/9rUT3yaeoGhhGkmL/2VY9ZdOvBcqdGKtQifWKnRircILWa3CaiRX+cr3KndiqvIvn1TlJWWqcidaVV/5QIUl5baqTytXuROtKjqxVqETaxU6sVahE1uVNzaxCp0Yqny33jtVeUmZqnzlU5WvfKpyWqnKaaUqr0ZSlVcjqcqrkVqFTsxVeCFrVE7rM51oVZTWsLZVRVrjur5Eq4K0xnXtcaEKWbf1fEFVsca1HlBFrHEtvKWGrIFBlbHGheVA6ZoPVK2rV/18dX9UR3VUR3VUX8Uz94M6xyeLAAAAAElFTkSuQmCC);background-position:top right;background-repeat:no-repeat;background-size:contain;height:100px;width:100px;position:absolute;top:0;right:0;z-index:100;width:120px}.site-navigation,.site-content,.site-footer{margin:0 auto;max-width:840px;width:92%}.site-navigation{-webkit-columns:3;-moz-columns:3;columns:3;-webkit-column-gap:40px;-moz-column-gap:40px;column-gap:40px}.site-navigation input[type=\"checkbox\"],.site-navigation label{display:none}.site-navigation ul{list-style:none;margin:0;padding:0}.site-navigation ul li{margin-bottom:20px;font-size:22px;line-height:23px}.site-navigation ul li a{display:block;color:#444;font-weight:700;text-decoration:none}.site-navigation ul li a:hover{color:#8892bf}.site-navigation ul li ul{padding-top:8px}.site-navigation ul li li{margin-bottom:6px;font-size:18px}.site-navigation ul li li a{border:none;color:#777;font-weight:normal}.site-navigation li{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}@media (max-width:820px){.site-navigation{-webkit-columns:2;-moz-columns:2;columns:2}}@media (max-width:560px){.site-navigation{-webkit-columns:1;-moz-columns:1;columns:1}}@media (max-width:375px){.site-navigation{background:rgba(255,255,255,0.95);-webkit-columns:1;-moz-columns:1;columns:1;max-height:100vh;position:fixed;bottom:0;left:0;z-index:100}.site-navigation label{background:#4f5b93;box-sizing:border-box;display:block;height:40px;padding:0 10px;width:100vh;position:absolute;bottom:0;left:0;color:white;font-family:verdana,sans-serif;font-size:13px;line-height:40px;text-transform:uppercase;z-index:2}.site-navigation>ul{background:rgba(255,255,255,0.96);border-top:3px solid #8892bf;box-shadow:rgba(0,0,0,0.25) 0 -5px 10px;box-sizing:border-box;padding:20px;overflow:auto;-webkit-overflow-scrolling:touch;position:absolute;left:0;bottom:40px;height:50vh;width:100vh;-webkit-transform:translate(0, 100vh);-ms-transform:translate(0, 100vh);transform:translate(0, 100vh);transition:all .2s ease;z-index:1}.site-navigation input[type=\"checkbox\"]:checked~ul{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);transform:translate(0, 0)}}.site-content h1{padding-top:40px;position:relative}.site-content h1:after{border:1px solid #ddd;border-bottom:none;content:\"\";display:block;height:8px;position:absolute;left:0;top:0;width:100%}.site-content.chapters{counter-reset:chapter}.site-content.chapters h1{counter-increment:chapter;padding-top:60px}.site-content.chapters h1:before{display:inline-block;content:\"Chapter \" counter(chapter) \".\";position:absolute;top:30px;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);color:#999;font-size:12px;letter-spacing:1px;line-height:20px;text-transform:uppercase;text-align:center}.site-content #welcome ul{-webkit-columns:3;-moz-columns:3;columns:3;-webkit-column-gap:30px;-moz-column-gap:30px;column-gap:30px;list-style-position:inside}.site-content .back-to-top{margin-bottom:60px}@media (max-width:870px){.site-content #welcome ul{-webkit-columns:2;-moz-columns:2;columns:2}}@media (max-width:600px){.site-content #welcome ul{-webkit-columns:1;-moz-columns:1;columns:1}}.site-footer{border-top:1px solid #ccc;margin:60px auto 0 auto;padding:40px 20px;font-family:verdana,sans-serif;font-size:16px;text-align:center}.site-footer .cc-badge{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAABUFvrSAAAAw1BMVEX///8AAAAAAACrsar///8oKSjR1NAODg4jHyDLz8pAPz/f399wcHBQUFBgYGDJzcjEyMN5fHkwMDC9wry4vbeAgIDw8PDBxcDO0c3M0MyUmJPGysW6v7q/v7+fn5/T1tKvtK61urSxt7C/w76zuLKhpKDk5OSRk5F2c3RQUVAbGxuts6yEhoR9fnxDREMgICDW1dXJyMirq6qvr68wLS3Pz8+Rj4+Pj4+LioqEgYJaV1i6ubmbl5meoJ1dXl06NjcZGRmWw6QEAAAAAnRSTlMMANomgjQAAAMCSURBVHjatZYJc6JAEIWznWFmOAQDguAdjUqMd0yi5vz/v2q7GTmkNusWW3kxNfJkPts3TMPVFfyIfiH3ttHwRs1623F0PYp03XHa9ebI6zRu74aDwcPDdQUBXCG3440Qq4ec91GchzqhM/J1FSEYuVguYudLASixnBM6JVPJNxqgtJts2mWHwMh1Ij6dQabZlEeKfDccDlo4xbAsA6e11KzLDoG9EXHvqVbb73Z9m+q+r4dEppLHAmomQ5k1EMmsi44CY74JV/gBU+ohWqtjzSMMY6iBjR4AfQAaTVLO87HkTDabiXIUuNnWieuaLFPgYs1cb1PJC6itUzCrwQ2mCe4bcr9EPEkdOmcsUa+Jo8B1J5wiF8s9J0/DpGQNCt9ogkbladKwwZ/DNnNMtpGfdizlMzkKjAXPQDyxMwUCZqpkMOjYBrBpNADnGDESZDxZ5w4L3uQec5A7chTYCecAPiupBzDHkr0OWHQIKBotwqCzidGI17kTSKlhzFJOyFFgvgSBQXRrhuGr4QUnCFhyzOIbMDLinZTH18y523UTsJmBdS7ARiCQjEcg2fTjBdfrzc6foqCsemwtUUbqvI43jG2lxHMyMACW6MLK7K56Lrjm46qXZNGnkE+LB5AvHjlHudtBvF3MUqcn5eGgybd88aI+AP4KlbMaSF0ERwj2ocZKlxs5k8OXeA6KzkGirICcfwI3ChvEKm6Q/bHkbLbbtXLKUQRPKx+joCGPorGttKXzxTutWrZ41mnxGrdjDcC1LTdvOZcddbndg2DZ5fZoJANbqcuNGtygWttMdvTLtxsE+1uFXp9vafO7LV0ZTE3o/S9NqBqXwLDQ+QeSC23IVG1zDtVFYLD0s0Yf+ALgk0cL+F8wLCL+Ubo18agFqdT+oDeZo/7RL53EzsGUxnvpZtoqzDm9WO6o49JXKaMIpjRCPk1v/1Me6sUc0rZZcE5/BaXtpAQGd4Bozul5BbEDAwoqB6GcrOLcLFesZOw99Yjl7Ql7oeIUXjynBP4h/djT5m+nuF33PcPucwAAAABJRU5ErkJggg==);background-position:top left;background-repeat:no-repeat;background-size:contain;display:inline-block;height:31px;width:88px}.site-footer h2{font-size:24px;font-weight:bold;line-height:30px;margin-bottom:10px}.site-footer ul{list-style:none;margin:0 0 20px 0;padding:0}.site-footer .license{color:#777;font-size:13px}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFsbC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsRUFBRSxxQkFBcUIsQ0FBQyxLQUFLLGVBQWUsaUJBQWlCLGlDQUFpQyxDQUFDLFlBQVkseUJBQXlCLENBQUMsVUFBVSxrQkFBa0IsZUFBZSxtQkFBbUIsaUJBQWlCLGlCQUFpQixDQUFDLFNBQVMsZUFBZSxtQkFBbUIsZ0JBQWdCLENBQUMsVUFBVSxlQUFlLGlCQUFpQixnQkFBZ0IsQ0FBQyxXQUFXLDJCQUEyQixrQkFBa0IsV0FBVyxrQkFBa0Isb0JBQW9CLENBQUMsRUFBRSxhQUFhLENBQUMsUUFBUSxhQUFhLENBQUMsYUFBYSxpQkFBaUIsQ0FBQyxlQUFlLG1CQUFtQixrQkFBa0IscUJBQXFCLFlBQVksZUFBZSx3QkFBd0IsWUFBWSwrQkFBK0IsZUFBZSxpQkFBaUIscUJBQXFCLHdCQUF3QixDQUFDLHFCQUFxQixrQkFBa0IsQ0FBQyxJQUFJLGNBQWMsQ0FBQyxTQUFTLFdBQVcsdU9BQXVPLGFBQWEsQ0FBQyxhQUFhLGFBQWEsQ0FBQyxJQUFJLG1CQUFtQixzQkFBc0Isa0JBQWtCLGNBQWMsY0FBYyxhQUFhLFVBQVUsQ0FBQyx5QkFBeUIsS0FBSyxlQUFlLGdCQUFnQixDQUFDLFVBQVUsZUFBZSxnQkFBZ0IsQ0FBQyxTQUFTLGVBQWUsZ0JBQWdCLENBQUMsVUFBVSxlQUFlLGdCQUFnQixDQUFDLFdBQVcsYUFBYSxDQUFDLE1BQU0sZ0JBQWdCLENBQUMsSUFBSSxnQkFBZ0IsQ0FBQyxDQUFDLHlCQUF5QixLQUFLLGVBQWUsZ0JBQWdCLENBQUMsVUFBVSxlQUFlLGdCQUFnQixDQUFDLFNBQVMsZUFBZSxnQkFBZ0IsQ0FBQyxVQUFVLGVBQWUsZ0JBQWdCLENBQUMsQ0FBQyxhQUFhLGlCQUFpQixtQkFBbUIsaUJBQWlCLENBQUMsZ0JBQWdCLFNBQVMsZUFBZSxnQkFBZ0IsQ0FBQyxtQkFBbUIsY0FBYyxlQUFlLGlCQUFpQixDQUFDLGtCQUFrQixXQUFXLG9CQUFvQixDQUFDLHdCQUF3QixhQUFhLENBQUMseUJBQXlCLG1CQUFtQixXQUFXLCtCQUErQixlQUFlLHdCQUF3QixDQUFDLHdCQUF3QixtQkFBbUIsa0JBQWtCLHFCQUFxQixZQUFZLGVBQWUsd0JBQXdCLFlBQVksK0JBQStCLGVBQWUsaUJBQWlCLHFCQUFxQix3QkFBd0IsQ0FBQyxzQkFBc0IseWtFQUF5a0UsOEJBQThCLDRCQUE0Qix3QkFBd0IsYUFBYSxZQUFZLGtCQUFrQixNQUFNLFFBQVEsWUFBWSxXQUFXLENBQUMsNENBQTRDLGNBQWMsZ0JBQWdCLFNBQVMsQ0FBQyxpQkFBaUIsa0JBQVUsQUFBVixlQUFVLEFBQVYsVUFBVSx3QkFBZSxBQUFmLHFCQUFlLEFBQWYsZUFBZSxDQUFDLCtEQUErRCxZQUFZLENBQUMsb0JBQW9CLGdCQUFnQixTQUFTLFNBQVMsQ0FBQyx1QkFBdUIsbUJBQW1CLGVBQWUsZ0JBQWdCLENBQUMseUJBQXlCLGNBQWMsV0FBVyxnQkFBZ0Isb0JBQW9CLENBQUMsK0JBQStCLGFBQWEsQ0FBQywwQkFBMEIsZUFBZSxDQUFDLDBCQUEwQixrQkFBa0IsY0FBYyxDQUFDLDRCQUE0QixZQUFZLFdBQVcsa0JBQWtCLENBQUMsb0JBQW9CLGtDQUFrQixBQUFsQix3QkFBa0IsQUFBbEIsa0JBQWtCLENBQUMseUJBQXlCLGlCQUFpQixrQkFBUyxBQUFULGVBQVMsQUFBVCxTQUFTLENBQUMsQ0FBQyx5QkFBeUIsaUJBQWlCLGtCQUFTLEFBQVQsZUFBUyxBQUFULFNBQVMsQ0FBQyxDQUFDLHlCQUF5QixpQkFBaUIsa0NBQWtDLGtCQUFVLEFBQVYsZUFBVSxBQUFWLFVBQVUsaUJBQWlCLGVBQWUsU0FBUyxPQUFPLFdBQVcsQ0FBQyx1QkFBdUIsbUJBQW1CLHNCQUFzQixjQUFjLFlBQVksZUFBZSxZQUFZLGtCQUFrQixTQUFTLE9BQU8sWUFBWSwrQkFBK0IsZUFBZSxpQkFBaUIseUJBQXlCLFNBQVMsQ0FBQyxvQkFBb0Isa0NBQWtDLDZCQUE2Qix3Q0FBd0Msc0JBQXNCLGFBQWEsY0FBYyxpQ0FBaUMsa0JBQWtCLE9BQU8sWUFBWSxZQUFZLFlBQVksc0NBQThCLEFBQTlCLGtDQUE4QixBQUE5Qiw4QkFBOEIsd0JBQXdCLFNBQVMsQ0FBQyxtREFBbUQsa0NBQXlCLEFBQXpCLDhCQUF5QixBQUF6Qix5QkFBeUIsQ0FBQyxDQUFDLGlCQUFpQixpQkFBaUIsaUJBQWlCLENBQUMsdUJBQXVCLHNCQUFzQixtQkFBbUIsV0FBVyxjQUFjLFdBQVcsa0JBQWtCLE9BQU8sTUFBTSxVQUFVLENBQUMsdUJBQXVCLHFCQUFxQixDQUFDLDBCQUEwQiwwQkFBMEIsZ0JBQWdCLENBQUMsaUNBQWlDLHFCQUFxQix3Q0FBd0Msa0JBQWtCLFNBQVMsU0FBUyxtQ0FBMkIsQUFBM0IsK0JBQTJCLEFBQTNCLDJCQUEyQixXQUFXLGVBQWUsbUJBQW1CLGlCQUFpQix5QkFBeUIsaUJBQWlCLENBQUMsMEJBQTBCLGtCQUFVLEFBQVYsZUFBVSxBQUFWLFVBQVUsd0JBQWdCLEFBQWhCLHFCQUFnQixBQUFoQixnQkFBZ0IsMEJBQTBCLENBQUMsMkJBQTJCLGtCQUFrQixDQUFDLHlCQUF5QiwwQkFBMEIsa0JBQVMsQUFBVCxlQUFTLEFBQVQsU0FBUyxDQUFDLENBQUMseUJBQXlCLDBCQUEwQixrQkFBUyxBQUFULGVBQVMsQUFBVCxTQUFTLENBQUMsQ0FBQyxhQUFhLDBCQUEwQix3QkFBd0Isa0JBQWtCLCtCQUErQixlQUFlLGlCQUFpQixDQUFDLHVCQUF1QixxNkNBQXE2Qyw2QkFBNkIsNEJBQTRCLHdCQUF3QixxQkFBcUIsWUFBWSxVQUFVLENBQUMsZ0JBQWdCLGVBQWUsaUJBQWlCLGlCQUFpQixrQkFBa0IsQ0FBQyxnQkFBZ0IsZ0JBQWdCLGtCQUFrQixTQUFTLENBQUMsc0JBQXNCLFdBQVcsY0FBYyxDQUFDIiwiZmlsZSI6ImFsbC5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIqe2JveC1zaXppbmc6Ym9yZGVyLWJveH1ib2R5e2ZvbnQtc2l6ZToyNHB4O2xpbmUtaGVpZ2h0OjMycHg7dGV4dC1yZW5kZXJpbmc6b3B0aW1pemVMZWdpYmlsaXR5fWgxLGgyLGgzLGg0e2ZvbnQtZmFtaWx5Omdlb3JnaWEsc2VyaWZ9aDEsLmFscGhhe3Bvc2l0aW9uOnJlbGF0aXZlO2ZvbnQtc2l6ZTo0OHB4O2ZvbnQtd2VpZ2h0Om5vcm1hbDtsaW5lLWhlaWdodDo1MHB4O3RleHQtYWxpZ246Y2VudGVyfWgyLC5iZXRhe2ZvbnQtc2l6ZTozMnB4O2ZvbnQtd2VpZ2h0Om5vcm1hbDtsaW5lLWhlaWdodDozNnB4fWgzLC5nYW1tYXtmb250LXNpemU6MjRweDtmb250LXdlaWdodDpib2xkO2xpbmUtaGVpZ2h0OjMwcHh9YmxvY2txdW90ZXtib3JkZXItbGVmdDozcHggc29saWQgI2NjYztwYWRkaW5nLWxlZnQ6MjBweDtjb2xvcjojNzc3O2ZvbnQtc3R5bGU6aXRhbGljO3dvcmQtd3JhcDpicmVhay13b3JkfWF7Y29sb3I6IzRmNWI5M31hOmhvdmVye2NvbG9yOiM4ODkyYmZ9LmJhY2stdG8tdG9we3RleHQtYWxpZ246Y2VudGVyfS5iYWNrLXRvLXRvcCBhe2JhY2tncm91bmQ6IzRmNWI5Mztib3JkZXItcmFkaXVzOjNweDtkaXNwbGF5OmlubGluZS1ibG9jaztoZWlnaHQ6NDBweDtwYWRkaW5nOjAgMjBweDt0cmFuc2l0aW9uOmFsbCAuMXMgZWFzZTtjb2xvcjp3aGl0ZTtmb250LWZhbWlseTp2ZXJkYW5hLHNhbnMtc2VyaWY7Zm9udC1zaXplOjEzcHg7bGluZS1oZWlnaHQ6NDBweDt0ZXh0LWRlY29yYXRpb246bm9uZTt0ZXh0LXRyYW5zZm9ybTp1cHBlcmNhc2V9LmJhY2stdG8tdG9wIGE6aG92ZXJ7YmFja2dyb3VuZDojODg5MmJmfWltZ3ttYXgtd2lkdGg6MTAwJX1wcmUsY29kZXtjb2xvcjojNDQ0O2ZvbnQtZmFtaWx5OlwiU291cmNlIENvZGUgUHJvXCIsQ29uc29sYXMsXCJBbmRhbGUgTW9ubyBXVFwiLFwiQW5kYWxlIE1vbm9cIixcIkx1Y2lkYSBDb25zb2xlXCIsXCJMdWNpZGEgU2FucyBUeXBld3JpdGVyXCIsXCJEZWphVnUgU2FucyBNb25vXCIsXCJCaXRzdHJlYW0gVmVyYSBTYW5zIE1vbm9cIixcIkxpYmVyYXRpb24gTW9ub1wiLFwiTmltYnVzIE1vbm8gTFwiLE1vbmFjbyxcIkNvdXJpZXIgTmV3XCIsQ291cmllcixtb25vc3BhY2U7Zm9udC1zaXplOjkwJX1hIHByZSxhIGNvZGV7Y29sb3I6aW5oZXJpdH1wcmV7YmFja2dyb3VuZDojZjdmN2Y3O2JvcmRlcjoxcHggc29saWQgI2VlZTtib3JkZXItcmFkaXVzOjNweDtkaXNwbGF5OmJsb2NrO292ZXJmbG93OmF1dG87cGFkZGluZzoyMHB4O3dpZHRoOjEwMCV9QG1lZGlhIChtYXgtd2lkdGg6NzY3cHgpe2JvZHl7Zm9udC1zaXplOjE4cHg7bGluZS1oZWlnaHQ6MjRweH1oMSwuYWxwaGF7Zm9udC1zaXplOjM2cHg7bGluZS1oZWlnaHQ6MzhweH1oMiwuYmV0YXtmb250LXNpemU6MjRweDtsaW5lLWhlaWdodDoyOHB4fWgzLC5nYW1tYXtmb250LXNpemU6MThweDtsaW5lLWhlaWdodDoyM3B4fWJsb2NrcXVvdGV7bWFyZ2luLWxlZnQ6MH11bCxvbHtwYWRkaW5nLWxlZnQ6MWVtfXByZXtwYWRkaW5nOjVweCAxMHB4fX1AbWVkaWEgKG1heC13aWR0aDozNjBweCl7Ym9keXtmb250LXNpemU6MTZweDtsaW5lLWhlaWdodDoyMXB4fWgxLC5hbHBoYXtmb250LXNpemU6MjhweDtsaW5lLWhlaWdodDozMHB4fWgyLC5iZXRhe2ZvbnQtc2l6ZToyMHB4O2xpbmUtaGVpZ2h0OjIzcHh9aDMsLmdhbW1he2ZvbnQtc2l6ZToxNnB4O2xpbmUtaGVpZ2h0OjIwcHh9fS5zaXRlLWhlYWRlcntwYWRkaW5nLXRvcDo0MHB4O21hcmdpbi1ib3R0b206NDBweDt0ZXh0LWFsaWduOmNlbnRlcn0uc2l0ZS1oZWFkZXIgaDF7bWFyZ2luOjA7Zm9udC1zaXplOjcycHg7bGluZS1oZWlnaHQ6NjBweH0uc2l0ZS1oZWFkZXIgaDEgZW17ZGlzcGxheTpibG9jaztmb250LXNpemU6MzRweDtmb250LXN0eWxlOm5vcm1hbH0uc2l0ZS1oZWFkZXIgaDEgYXtjb2xvcjojMzMzO3RleHQtZGVjb3JhdGlvbjpub25lfS5zaXRlLWhlYWRlciBoMSBhOmhvdmVye2NvbG9yOiM4ODkyYmZ9LnNpdGUtaGVhZGVyIC5idWlsZC1kYXRle21hcmdpbi1ib3R0b206MTBweDtjb2xvcjojOTk5O2ZvbnQtZmFtaWx5OnZlcmRhbmEsc2Fucy1zZXJpZjtmb250LXNpemU6MTFweDt0ZXh0LXRyYW5zZm9ybTp1cHBlcmNhc2V9LnNpdGUtaGVhZGVyIC5idG4tc2hhcmV7YmFja2dyb3VuZDojODg5MmJmO2JvcmRlci1yYWRpdXM6M3B4O2Rpc3BsYXk6aW5saW5lLWJsb2NrO2hlaWdodDozMHB4O3BhZGRpbmc6MCAyMHB4O3ZlcnRpY2FsLWFsaWduOmJhc2VsaW5lO2NvbG9yOndoaXRlO2ZvbnQtZmFtaWx5OnZlcmRhbmEsc2Fucy1zZXJpZjtmb250LXNpemU6MTJweDtsaW5lLWhlaWdodDozMHB4O3RleHQtZGVjb3JhdGlvbjpub25lO3RleHQtdHJhbnNmb3JtOnVwcGVyY2FzZX0uc2l0ZS1oZWFkZXIgLmZvcmstbWV7YmFja2dyb3VuZC1pbWFnZTp1cmwoZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5TVWhFVWdBQUFKVUFBQUNWQ0FNQUFBQm1mRWg5QUFBQU1GQk1WRVhyNit3U0ZpSC8vLy9VMU5UMDlQU1JrNWh1Y0hiNStmbE1UMWY4L1B5K3Y4RXRNRHBYV1dFOFAwaGdZMnJnNE9ENW1JRzhBQUFGb0VsRVFWUjRBYlNiMFc0c0tReEV5eGZNZEF5Ry8vL2IxYkN0M01TWjFDS3RoNGNvajBmVlZwMEdldkRuYzMxOFBPcWo5Y3ZsdjFlZmw5dGFDNmoxOGZqNCtKTzdBbFd0clk5TER0Ymxib1ZnNVZLaDlYa2RwVFVJVmpJVnNKcWNQVVNTVmk3Vm93SjRwaldPSHVLVmlVV29kbGpsY09SOVhOMUtDVmhwVk9FUlBySEdPQno1Z0pWSkZjTjZZcDJOZkhpSWlWUXhySTBsMXhGV1hscUU2dk1abHRPQ0dDR3RiS3FJZFZnUUk2U1ZSTVhTNm05dGVVSkZzSTZkR05MS3BncFlNZzVIdm9lMGNxaENQeno0eUdlbVJhZ1NSajZrbFVzVjB6cDJZa2dyZytyL2o3elBLNlNWU3hYVG1yL0xwMm1pRXdNVlRZczVjUUthNVVSQ0ZkUGlJOStBQWcwRkVkSktwb290UDE0bDFjVFE4cDBZcVhoYUVjcEV1dmJ2cWc1cHBWUEYyUnJmb1NvS05NZUpuSXIzMXZEdk05WEU0RWt0ejZtNEUvM3phVG4yUEUxcExkbUpuSW83OGFhNUZ1cnlLSjhSMDhxbTRrNzBoVGFYU3NTS3M1Vk54WjI0YTZHc04reDhPQlYzNGpJUmhZcEhKOGFXVDZXS2FjWFh3RktHWW9rdjI4bDlnWXN0bjAwVjAvSXZXTDRBOC8xWHhLRDhhQ1NUaXJkOEczdmsxYnBWRmVGT3pLVGlUdHhRRXBMYUt6b3htWXFQZk1HOG9YcHMrZWpFWktxQU5mdTRQaEY4UTFVc0xPZE9US2ZpVGhTRFZXM1RVNXpJcWM1YlhoK3E2SW43UkU1RjB2SXZJOStibUVVaTdzUThLcEpXaDk1VGx1RkVUblh1eEc1KzE0Um1PSkZUblJkRXY2RlFXc1pwSUtjNmQrSU5wWVlac0tJVGs2bTRFMFc4WUVxclpaNm5sVVJGbk5nWHB2aGFCUnF4Umtncm5ZcWNuYlltdmpBRVM0UTdNWmtxcGhXY2VEM2p1bXJJaWpneGo0cWNRVFRzdUx5M0lkeUpxVlF4cllqbDl3WURzQU1ucGxMRnRPTElEMEFIRHZhSnlWU2s1ZHVVQWlzTjdhY1RRMXI1Vk1TSkF1MkcxZVVGVmtncm5ZcThOSy9TeGViQkRWaytGWEhpUlBHekc3SjhLdUxFb1hjMDdZcFl3WW5aVkFjM1pBcFVQYmdoUzZFaVRneFFOaFIrY0VPV1RNVnV5QzVZbDRrbU1jTDRkcHBQUlp6WTZpNzZyaGk4NWZPcHlBMVpnNDZGcG9CRktZYVd6NmNpcDRFSzFLYlYya0tQYVkyUVZqWVZhWGx2WGF1SnRIb2RPREdYaWpoUkdxeUxGSFNKS3pveG40cnRxa1ZrSHlIRjVjR0p5VlF4clhoZDBBMmZUYStET3pGU0phWVZqa1owM1ZBR0FOcTVFeU5WWGxyaHE1RjJRNkhvTUg1REZxbVMwL0lmVHJScXo1aXNNQ2ZtVTNFbk52eUxNeWQxWWo0VmM2S3N2NVdsU3B5WVQ4WDJpYkMvL3hiaXhId3E0a1NwUmFRWEYzRnBrem94bjRvNGNaa0NUU1pVdUJQenFVakw2OEtHV3E2bTNJbjVWTVNKTnFWaGVjTVdrRHB4WWpZVjJmbjRUa3Fzd3Jvb0NuZGlwTXBNYTM1MW9tTjVOK2hVMFNjZmNXSTZGVG14bVM2MnJYaERPWEZpT2hWcCtXdlpoc0srWlZuK3F4UHpxY2htMzFGY0ZHdnRBVnYrdXhQenFVaGEwL2JqODdVc2pGYjRhaVNmaWpxeDdZZ2M0RGRrK1ZUY2llYlBQNENKazMxaVBoVjM0aWFyYSs1cC83WGw4Nm00RTNkU3U3bU0vTG9nVXIzZmlkM1dicTR1KzU1VDI0dTAza1pGbk9qU2x1M2pOeEdGL2Z4MXdkdW8rRmNqQmJLOStJVHE4dE9KNzZMaVgxSmFiZTJHZWxVUTc2UWlUdXlHdXFGZzgwVkJ2SmVLT05FMjFLc1RtK0c5dkpXS09GRTIxT2VKVFRnYWVUTVZTYXNCbDBqSTZuWWlwOHFmclc5TzFBWTArYm5lVE1XL0dyRUtxTHhZUForS3BCV1BSbWI3cDMwN1NFRW9Cb0lvcUJBbElPajlieXQvOXJVVDN5YWVvR2hoR2ttTC8yVlk5WmRPdkJjcWRHS3RRaWZXS25SaXJjSUxXYTNDYWlSWCtjcjNLbmRpcXZJdm4xVGxKV1dxY2lkYVZWLzVRSVVsNWJhcVR5dFh1Uk90S2pxeFZxRVRheFU2c1ZhaEUxdVZOemF4Q3AwWXFueTMzanRWZVVtWnFuemxVNVd2ZktweVdxbkthYVVxcjBaU2xWY2pxY3Fya1ZxRlRzeFZlQ0ZyVkU3ck01MW9WWlRXc0xaVlJWcmp1cjVFcTRLMHhuWHRjYUVLV2JmMWZFRlZzY2ExSGxCRnJIRXR2S1dHcklGQmxiSEdoZVZBNlpvUFZLMnJWLzE4ZFg5VVIzVlVSM1ZVWDhVejk0TTZ4eWVMQUFBQUFFbEZUa1N1UW1DQyk7YmFja2dyb3VuZC1wb3NpdGlvbjp0b3AgcmlnaHQ7YmFja2dyb3VuZC1yZXBlYXQ6bm8tcmVwZWF0O2JhY2tncm91bmQtc2l6ZTpjb250YWluO2hlaWdodDoxMDBweDt3aWR0aDoxMDBweDtwb3NpdGlvbjphYnNvbHV0ZTt0b3A6MDtyaWdodDowO3otaW5kZXg6MTAwO3dpZHRoOjEyMHB4fS5zaXRlLW5hdmlnYXRpb24sLnNpdGUtY29udGVudCwuc2l0ZS1mb290ZXJ7bWFyZ2luOjAgYXV0bzttYXgtd2lkdGg6ODQwcHg7d2lkdGg6OTIlfS5zaXRlLW5hdmlnYXRpb257Y29sdW1uczozO2NvbHVtbi1nYXA6NDBweH0uc2l0ZS1uYXZpZ2F0aW9uIGlucHV0W3R5cGU9XCJjaGVja2JveFwiXSwuc2l0ZS1uYXZpZ2F0aW9uIGxhYmVse2Rpc3BsYXk6bm9uZX0uc2l0ZS1uYXZpZ2F0aW9uIHVse2xpc3Qtc3R5bGU6bm9uZTttYXJnaW46MDtwYWRkaW5nOjB9LnNpdGUtbmF2aWdhdGlvbiB1bCBsaXttYXJnaW4tYm90dG9tOjIwcHg7Zm9udC1zaXplOjIycHg7bGluZS1oZWlnaHQ6MjNweH0uc2l0ZS1uYXZpZ2F0aW9uIHVsIGxpIGF7ZGlzcGxheTpibG9jaztjb2xvcjojNDQ0O2ZvbnQtd2VpZ2h0OjcwMDt0ZXh0LWRlY29yYXRpb246bm9uZX0uc2l0ZS1uYXZpZ2F0aW9uIHVsIGxpIGE6aG92ZXJ7Y29sb3I6Izg4OTJiZn0uc2l0ZS1uYXZpZ2F0aW9uIHVsIGxpIHVse3BhZGRpbmctdG9wOjhweH0uc2l0ZS1uYXZpZ2F0aW9uIHVsIGxpIGxpe21hcmdpbi1ib3R0b206NnB4O2ZvbnQtc2l6ZToxOHB4fS5zaXRlLW5hdmlnYXRpb24gdWwgbGkgbGkgYXtib3JkZXI6bm9uZTtjb2xvcjojNzc3O2ZvbnQtd2VpZ2h0Om5vcm1hbH0uc2l0ZS1uYXZpZ2F0aW9uIGxpe2JyZWFrLWluc2lkZTphdm9pZH1AbWVkaWEgKG1heC13aWR0aDo4MjBweCl7LnNpdGUtbmF2aWdhdGlvbntjb2x1bW5zOjJ9fUBtZWRpYSAobWF4LXdpZHRoOjU2MHB4KXsuc2l0ZS1uYXZpZ2F0aW9ue2NvbHVtbnM6MX19QG1lZGlhIChtYXgtd2lkdGg6Mzc1cHgpey5zaXRlLW5hdmlnYXRpb257YmFja2dyb3VuZDpyZ2JhKDI1NSwyNTUsMjU1LDAuOTUpO2NvbHVtbnM6MTttYXgtaGVpZ2h0OjEwMHZoO3Bvc2l0aW9uOmZpeGVkO2JvdHRvbTowO2xlZnQ6MDt6LWluZGV4OjEwMH0uc2l0ZS1uYXZpZ2F0aW9uIGxhYmVse2JhY2tncm91bmQ6IzRmNWI5Mztib3gtc2l6aW5nOmJvcmRlci1ib3g7ZGlzcGxheTpibG9jaztoZWlnaHQ6NDBweDtwYWRkaW5nOjAgMTBweDt3aWR0aDoxMDB2aDtwb3NpdGlvbjphYnNvbHV0ZTtib3R0b206MDtsZWZ0OjA7Y29sb3I6d2hpdGU7Zm9udC1mYW1pbHk6dmVyZGFuYSxzYW5zLXNlcmlmO2ZvbnQtc2l6ZToxM3B4O2xpbmUtaGVpZ2h0OjQwcHg7dGV4dC10cmFuc2Zvcm06dXBwZXJjYXNlO3otaW5kZXg6Mn0uc2l0ZS1uYXZpZ2F0aW9uPnVse2JhY2tncm91bmQ6cmdiYSgyNTUsMjU1LDI1NSwwLjk2KTtib3JkZXItdG9wOjNweCBzb2xpZCAjODg5MmJmO2JveC1zaGFkb3c6cmdiYSgwLDAsMCwwLjI1KSAwIC01cHggMTBweDtib3gtc2l6aW5nOmJvcmRlci1ib3g7cGFkZGluZzoyMHB4O292ZXJmbG93OmF1dG87LXdlYmtpdC1vdmVyZmxvdy1zY3JvbGxpbmc6dG91Y2g7cG9zaXRpb246YWJzb2x1dGU7bGVmdDowO2JvdHRvbTo0MHB4O2hlaWdodDo1MHZoO3dpZHRoOjEwMHZoO3RyYW5zZm9ybTp0cmFuc2xhdGUoMCwgMTAwdmgpO3RyYW5zaXRpb246YWxsIC4ycyBlYXNlO3otaW5kZXg6MX0uc2l0ZS1uYXZpZ2F0aW9uIGlucHV0W3R5cGU9XCJjaGVja2JveFwiXTpjaGVja2VkfnVse3RyYW5zZm9ybTp0cmFuc2xhdGUoMCwgMCl9fS5zaXRlLWNvbnRlbnQgaDF7cGFkZGluZy10b3A6NDBweDtwb3NpdGlvbjpyZWxhdGl2ZX0uc2l0ZS1jb250ZW50IGgxOmFmdGVye2JvcmRlcjoxcHggc29saWQgI2RkZDtib3JkZXItYm90dG9tOm5vbmU7Y29udGVudDpcIlwiO2Rpc3BsYXk6YmxvY2s7aGVpZ2h0OjhweDtwb3NpdGlvbjphYnNvbHV0ZTtsZWZ0OjA7dG9wOjA7d2lkdGg6MTAwJX0uc2l0ZS1jb250ZW50LmNoYXB0ZXJze2NvdW50ZXItcmVzZXQ6Y2hhcHRlcn0uc2l0ZS1jb250ZW50LmNoYXB0ZXJzIGgxe2NvdW50ZXItaW5jcmVtZW50OmNoYXB0ZXI7cGFkZGluZy10b3A6NjBweH0uc2l0ZS1jb250ZW50LmNoYXB0ZXJzIGgxOmJlZm9yZXtkaXNwbGF5OmlubGluZS1ibG9jaztjb250ZW50OlwiQ2hhcHRlciBcIiBjb3VudGVyKGNoYXB0ZXIpIFwiLlwiO3Bvc2l0aW9uOmFic29sdXRlO3RvcDozMHB4O2xlZnQ6NTAlO3RyYW5zZm9ybTp0cmFuc2xhdGVYKC01MCUpO2NvbG9yOiM5OTk7Zm9udC1zaXplOjEycHg7bGV0dGVyLXNwYWNpbmc6MXB4O2xpbmUtaGVpZ2h0OjIwcHg7dGV4dC10cmFuc2Zvcm06dXBwZXJjYXNlO3RleHQtYWxpZ246Y2VudGVyfS5zaXRlLWNvbnRlbnQgI3dlbGNvbWUgdWx7Y29sdW1uczozO2NvbHVtbi1nYXA6MzBweDtsaXN0LXN0eWxlLXBvc2l0aW9uOmluc2lkZX0uc2l0ZS1jb250ZW50IC5iYWNrLXRvLXRvcHttYXJnaW4tYm90dG9tOjYwcHh9QG1lZGlhIChtYXgtd2lkdGg6ODcwcHgpey5zaXRlLWNvbnRlbnQgI3dlbGNvbWUgdWx7Y29sdW1uczoyfX1AbWVkaWEgKG1heC13aWR0aDo2MDBweCl7LnNpdGUtY29udGVudCAjd2VsY29tZSB1bHtjb2x1bW5zOjF9fS5zaXRlLWZvb3Rlcntib3JkZXItdG9wOjFweCBzb2xpZCAjY2NjO21hcmdpbjo2MHB4IGF1dG8gMCBhdXRvO3BhZGRpbmc6NDBweCAyMHB4O2ZvbnQtZmFtaWx5OnZlcmRhbmEsc2Fucy1zZXJpZjtmb250LXNpemU6MTZweDt0ZXh0LWFsaWduOmNlbnRlcn0uc2l0ZS1mb290ZXIgLmNjLWJhZGdle2JhY2tncm91bmQtaW1hZ2U6dXJsKGRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBRmdBQUFBZkNBTUFBQUJVRnZyU0FBQUF3MUJNVkVYLy8vOEFBQUFBQUFDcnNhci8vLzhvS1NqUjFOQU9EZzRqSHlETHo4cEFQei9mMzk5d2NIQlFVRkJnWUdESnpjakV5TU41Zkhrd01EQzl3cnk0dmJlQWdJRHc4UERCeGNETzBjM00wTXlVbUpQR3lzVzZ2N3EvdjcrZm41L1QxdEt2dEs2MXVyU3h0N0Mvdzc2enVMS2hwS0RrNU9TUms1RjJjM1JRVVZBYkd4dXRzNnlFaG9SOWZueERSRU1nSUNEVzFkWEp5TWlycTZxdnI2OHdMUzNQejgrUmo0K1BqNCtMaW9xRWdZSmFWMWk2dWJtYmw1bWVvSjFkWGwwNk5qY1pHUm1XdzZRRUFBQUFBblJTVGxNTUFOb21nalFBQUFNQ1NVUkJWSGphdFpZSmM2SkFFSVd6bldGbU9BUURndUFkalVxTWQweWk1dnovdjJxN0dUbWtOdXNXVzNreE5mSmtQdHMzVE1QVkZmeUlmaUgzdHRId1JzMTYyM0YwUFlwMDNYSGE5ZWJJNnpSdTc0YUR3Y1BEZFFVQlhDRzM0NDBRcTRlYzkxR2NoenFoTS9KMUZTRVl1Vmd1WXVkTEFTaXhuQk02SlZQSk54cWd0SnRzMm1XSHdNaDFJajZkUWFiWmxFZUtmRGNjRGxvNHhiQXNBNmUxMUt6TERvRzlFWEh2cVZiYjczWjltK3ErcjRkRXBwTEhBbW9tUTVrMUVNbXNpNDRDWTc0SlYvZ0JVK29oV3F0anpTTU1ZNmlCalI0QWZRQWFUVkxPODdIa1REYWJpWElVdU5uV2lldWFMRlBnWXMxY2IxUEpDNml0VXpDcndRMm1DZTRiY3I5RVBFa2RPbWNzVWErSm84QjFKNXdpRjhzOUowL0RwR1FOQ3Q5b2drYmxhZEt3d1ovRE5uTk10cEdmZGl6bE16a0tqQVhQUUR5eE13VUNacXBrTU9qWUJyQnBOQURuR0RFU1pEeFo1dzRMM3VRZWM1QTdjaFRZQ2VjQVBpdXBCekRIa3IwT1dIUUlLQm90d3FDemlkR0kxN2tUU0tsaHpGSk95RkZndmdTQlFYUnJodUdyNFFVbkNGaHl6T0liTURMaW5aVEgxOHk1MjNVVHNKbUJkUzdBUmlDUWpFY2cyZlRqQmRmcnpjNmZvcUNzZW13dFVVYnF2STQzakcybHhITXlNQUNXNk1MSzdLNTZMcmptNDZxWFpOR25rRStMQjVBdkhqbEh1ZHRCdkYzTVVxY241ZUdneWJkODhhSStBUDRLbGJNYVNGMEVSd2oyb2NaS2x4czVrOE9YZUE2S3prR2lySUNjZndJM0NodkVLbTZRL2JIa2JMYmJ0WExLVVFSUEt4K2pvQ0dQb3JHdHRLWHp4VHV0V3JaNDFtbnhHcmRqRGNDMUxUZHZPWmNkZGJuZGcyRFo1ZlpvSkFOYnFjdU5HdHlnV3R0TWR2VEx0eHNFKzF1RlhwOXZhZk83TFYwWlRFM28vUzlOcUJxWHdMRFErUWVTQzIzSVZHMXpEdFZGWUxEMHMwWWYrQUxnazBjTCtGOHdMQ0wrVWJvMThhZ0ZxZFQrb0RlWm8vN1JMNTNFenNHVXhudnBadG9xekRtOVdPNm80OUpYS2FNSXBqUkNQazF2LzFNZTZzVWMwclpaY0U1L0JhWHRwQVFHZDRCb3p1bDVCYkVEQXdvcUI2R2NyT0xjTEZlc1pPdzk5WWpsN1FsN29lSVVYanluQlA0aC9kalQ1bStudUYzM1BjUHVjd0FBQUFCSlJVNUVya0pnZ2c9PSk7YmFja2dyb3VuZC1wb3NpdGlvbjp0b3AgbGVmdDtiYWNrZ3JvdW5kLXJlcGVhdDpuby1yZXBlYXQ7YmFja2dyb3VuZC1zaXplOmNvbnRhaW47ZGlzcGxheTppbmxpbmUtYmxvY2s7aGVpZ2h0OjMxcHg7d2lkdGg6ODhweH0uc2l0ZS1mb290ZXIgaDJ7Zm9udC1zaXplOjI0cHg7Zm9udC13ZWlnaHQ6Ym9sZDtsaW5lLWhlaWdodDozMHB4O21hcmdpbi1ib3R0b206MTBweH0uc2l0ZS1mb290ZXIgdWx7bGlzdC1zdHlsZTpub25lO21hcmdpbjowIDAgMjBweCAwO3BhZGRpbmc6MH0uc2l0ZS1mb290ZXIgLmxpY2Vuc2V7Y29sb3I6Izc3Nztmb250LXNpemU6MTNweH0iXX0= */"
  },
  {
    "path": "index.html",
    "content": "---\nlayout: default\nsitemap: true\n---\n\n{% capture welcome_content %}{% include welcome.md %}{% endcapture %}\n<section class=\"chapter\" id=\"welcome\">\n    {{ welcome_content|markdownify }}\n</section>\n\n{% capture backtotop %}[Back to Top](#top){:.top}{% endcapture %}\n{% for post in site.posts reversed %}\n{% if post.isChild != true and loop.first != true %}<div class=\"back-to-top\">{{ backtotop|markdownify }}</div>{% endif %}\n<section class=\"chapter\" id=\"{{ post.anchor }}\">\n    {{ post.content }}\n</section>\n{% endfor %}\n"
  },
  {
    "path": "less/all.less",
    "content": "/******************************************************************************\n * Variables\n *****************************************************************************/\n\n@serif: georgia, serif;\n@sans: verdana, sans-serif;\n@phpPurple: #8892BF;\n@phpPurpleDark: #4F5B93;\n\n/******************************************************************************\n * Basics\n *****************************************************************************/\n\n*{\n    box-sizing: border-box;\n}\n\nbody{\n    font-size: 24px;\n    line-height: 32px;\n    text-rendering: optimizeLegibility;\n    word-wrap: break-word;\n}\n\nh1, h2, h3, h4{\n    font-family: @serif;\n}\n\nh1, .alpha{\n    position: relative;\n    font-size: 48px;\n    font-weight: normal;\n    line-height: 50px;\n    text-align: center;\n}\n\nh2, .beta{\n    font-size: 32px;\n    font-weight: normal;\n    line-height: 36px;\n}\n\nh3, .gamma{\n    font-size: 24px;\n    font-weight: bold;\n    line-height: 30px;\n}\n\nblockquote{\n    border-left: 3px solid #CCC;\n    padding-left: 20px;\n    color: #777;\n    font-style: italic;\n    word-wrap: break-word;\n}\n\na{\n    color: @phpPurpleDark;\n\n    &:hover{\n        color: @phpPurple;\n    }\n}\n\n.back-to-top{\n    text-align: center;\n\n    a{\n        background: @phpPurpleDark;\n        border-radius: 3px;\n        display: inline-block;\n        height: 40px;\n        padding: 0 20px;\n        transition: all 0.1s ease;\n        color: white;\n        font-family: @sans;\n        font-size: 13px;\n        line-height: 40px;\n        text-decoration: none;\n        text-transform: uppercase;\n\n        &:hover{\n            background: @phpPurple;\n        }\n    }\n}\n\nimg{\n    max-width: 100%;\n}\n\npre, code{\n    color: #444;\n    font-family: \"Source Code Pro\", Consolas, \"Andale Mono WT\", \"Andale Mono\", \"Lucida Console\", \"Lucida Sans Typewriter\", \"DejaVu Sans Mono\", \"Bitstream Vera Sans Mono\", \"Liberation Mono\", \"Nimbus Mono L\", Monaco, \"Courier New\", Courier, monospace;\n    font-size: 90%;\n}\na{\n    pre, code{\n        color: inherit;\n    }\n}\n\npre{\n    background: #f7f7f7;\n    border: 1px solid #EEE;\n    border-radius: 3px;\n    display: block;\n    overflow: auto;\n    padding: 20px;\n    width: 100%;\n}\n\n@media (max-width: 767px) {\n    body{\n        font-size: 18px;\n        line-height: 24px;\n    }\n    h1, .alpha{\n        font-size: 36px;\n        line-height: 38px;\n    }\n\n    h2, .beta{\n        font-size: 24px;\n        line-height: 28px;\n    }\n\n    h3, .gamma{\n        font-size: 18px;\n        line-height: 23px;\n    }\n\n    blockquote{\n        margin-left: 0;\n    }\n\n    ul, ol{\n        padding-left: 1em;\n    }\n\n    pre{\n        padding: 5px 10px;\n        white-space: pre-wrap;\n        white-space: -moz-pre-wrap;\n        white-space: -pre-wrap;\n        white-space: -o-pre-wrap;\n        word-wrap: break-word;\n    }\n}\n\n@media (max-width: 360px) {\n    body{\n        font-size: 16px;\n        line-height: 21px;\n    }\n\n    h1, .alpha{\n        font-size: 28px;\n        line-height: 30px;\n    }\n\n    h2, .beta{\n        font-size: 20px;\n        line-height: 23px;\n    }\n\n    h3, .gamma{\n        font-size: 16px;\n        line-height: 20px;\n    }\n}\n\n/******************************************************************************\n * Header\n *****************************************************************************/\n\n.site-header{\n    padding-top: 40px;\n    margin-bottom: 40px;\n    text-align: center;\n\n    h1{\n        margin: 0;\n        font-size: 72px;\n        line-height: 60px;\n\n        em{\n            display: block;\n            font-size: 34px;\n            font-style: normal;\n        }\n\n        a{\n            color: #333;\n            text-decoration: none;\n\n            &:hover{\n                color: @phpPurple;\n            }\n        }\n    }\n\n    .build-date{\n        margin-bottom: 10px;\n        color: #999;\n        font-family: @sans;\n        font-size: 11px;\n        text-transform: uppercase;\n    }\n\n    .btn-share{\n        background: @phpPurple;\n        border-radius: 3px;\n        display: inline-block;\n        height: 30px;\n        padding: 0 20px;\n        vertical-align: baseline;\n        color: white;\n        font-family: @sans;\n        font-size: 12px;\n        line-height: 30px;\n        text-decoration: none;\n        text-transform: uppercase;\n    }\n\n    .fork-me{\n        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJUAAACVCAMAAABmfEh9AAAAMFBMVEXr6+wSFiH////U1NT09PSRk5hucHb5+flMT1f8/Py+v8EtMDpXWWE8P0hgY2rg4OD5mIG8AAAFoElEQVR4AbSb0W4sKQxEyxfMdAyG///b1bCt3MSZ1CKth4coj0fVVp0GevDnc318POqj9cvlv1efl9taC6j18fj4+JO7AlWtrY9LDtblboVg5VKh9XkdpTUIVjIVsJqcPUSSVi7VowJ4pjWOHuKViUWodljlcOR9XN1KCVhpVOERPrHGOBz5gJVJFcN6Yp2NfHiIiVQxrI0l1xFWXlqE6vMZltOCGCGtbKqIdVgQI6SVRMXS6m9teUJFsI6dGNLKpgpYMg5Hvoe0cqhCPzz4yGemRagSRj6klUsV0zp2Ykgrg+r/j7zPK6SVSxXTmr/Lp2miEwMVTYs5cQKa5URCFdPiI9+AAg0FEdJKpootP14l1cTQ8p0YqXhaEcpEuvbvqg5ppVPF2RrfoSoKNMeJnIr31vDvM9XE4Ektz6m4E/3zaTn2PE1pLdmJnIo78aa5FuryKJ8R08qm4k70hTaXSsSKs5VNxZ24a6GsN+x8OBV34jIRhYpHJ8aWT6WKacXXwFKGYokv28l9gYstn00V0/IvWL4A8/1XxKD8aCSTird8G3vk1bpVFeFOzKTiTtxQEpLaKzoxmYqPfMG8oXps+ejEZKqANfu4PhF8Q1UsLOdOTKfiThSDVW3TU5zIqc5bXh+q6In7RE5F0vIvI9+bmEUi7sQ8KpJWh95TluFETnXuxG5+14RmOJFTnRdEv6FQWsZpIKc6d+INpYYZsKITk6m4E0W8YEqrZZ6nlURFnNgXpvhaBRqxRkgrnYqcnbYmvjAES4Q7MZkqphWceD3jumrIijgxj4qcQTTsuLy3IdyJqVQxrYjl9wYDsAMnplLFtOLID0AHDvaJyVSk5duUAisN7acTQ1r5VMSJAu2G1eUFVkgrnYq8NK/SxebBDVk+FXHiRPGzG7J8KuLEoXc07YpYwYnZVAc3ZApUPbghS6EiTgxQNhR+cEOWTMVuyC5Yl4kmMcL4dppPRZzY6i76rhi85fOpyA1Zg46FpoBFKYaWz6cip4EK1KbV2kKPaY2QVjYVaXlvXauJtHodODGXijhRGqyLFHSJKzoxn4rtqkVkHyHF5cGJyVQxrXhd0A2fTa+DOzFSJaYVjkZ03VAGANq5EyNVXlrhq5F2Q6HoMH5DFqmS0/IfTrRqz5isMCfmU3EnNvyLMyd1Yj4Vc6Ksv5WlSpyYT8X2ibC//xbixHwq4kSpRaQXF3Fpkzoxn4o4cZkCTSZUuBPzqUjL68KGWq6m3In5VMSJNqVhecMWkDpxYjYV2fn4TkqswrooCndipMpMa351omN5N+hU0ScfcWI6FTmxmS62rXhDOXFiOhVp+WvZhsK+ZVn+qxPzqchm31FcFGvtAVv+uxPzqUha0/bj87UsjFb4aiSfijqx7Ygc4Ddk+VTciebPP4CJk31iPhV34iara+5p/7Xl86m4E3dSu7mM/LogUr3fid3Wbq4u+55T24u03kZFnOjSlu3jNxGF/fx1wduo+FcjBbK9+ITq8tOJ76LiX1Jabe2GelUQ76QiTuyGuqFg80VBvJeKONE21KsTm+G9vJWKOFE21OeJTTgaeTMVSasBl0jI6nYip8qfrW9O1AY0+bneTMW/GrEKqLxYPZ+KpBWPRmb7p307SEEoBoIoqBAlIOj9byt/9rUT3yaeoGhhGkmL/2VY9ZdOvBcqdGKtQifWKnRircILWa3CaiRX+cr3KndiqvIvn1TlJWWqcidaVV/5QIUl5baqTytXuROtKjqxVqETaxU6sVahE1uVNzaxCp0Yqny33jtVeUmZqnzlU5WvfKpyWqnKaaUqr0ZSlVcjqcqrkVqFTsxVeCFrVE7rM51oVZTWsLZVRVrjur5Eq4K0xnXtcaEKWbf1fEFVsca1HlBFrHEtvKWGrIFBlbHGheVA6ZoPVK2rV/18dX9UR3VUR3VUX8Uz94M6xyeLAAAAAElFTkSuQmCC);\n        background-position: top right;\n        background-repeat: no-repeat;\n        background-size: contain;\n        height: 100px;\n        width: 100px;\n        position: absolute;\n        top: 0;\n        right: 0;\n        z-index: 100;\n        width: 120px;\n    }\n}\n\n/******************************************************************************\n * Navigation\n *****************************************************************************/\n\n.site-navigation,\n.site-content,\n.site-footer{\n    margin: 0 auto;\n    max-width: 840px;\n    width: 92%;\n}\n\n.site-navigation{\n    columns: 3;\n    column-gap: 40px;\n\n    input[type=\"checkbox\"],\n    label{\n        display: none;\n    }\n\n    ul{\n        list-style: none;\n        margin: 0;\n        padding: 0;\n\n        li{\n            margin-bottom: 20px;\n            font-size: 22px;\n            line-height: 23px;\n\n            a{\n                display: block;\n                color: #444;\n                font-weight: 700;\n                text-decoration: none;\n\n                &:hover{\n                    color: @phpPurple;\n                }\n            }\n\n            ul{\n                padding-top: 8px;\n            }\n\n            li{\n                margin-bottom: 6px;\n                font-size: 18px;\n\n                a{\n                    border: none;\n                    color: #777;\n                    font-weight: normal;\n                }\n            }\n        }\n    }\n    li{\n        break-inside: avoid;\n    }\n}\n\n@media (max-width: 820px) {\n    .site-navigation{\n        columns: 2;\n    }\n}\n\n@media (max-width: 560px) {\n    .site-navigation{\n        columns: 1;\n    }\n}\n\n@media (max-width: 375px) {\n    .site-navigation{\n        background: fade(white, 95%);\n        columns: 1;\n        max-height: 100vh;\n        position: fixed;\n        bottom: 0;\n        left: 0;\n        z-index: 100;\n\n        label{\n            background: @phpPurpleDark;\n            box-sizing: border-box;\n            display: block;\n            height: 40px;\n            padding: 0 10px;\n            width: 100vh;\n            position: absolute;\n            bottom: 0;\n            left: 0;\n            color: white;\n            font-family: @sans;\n            font-size: 13px;\n            line-height: 40px;\n            text-transform: uppercase;\n            z-index: 2;\n        }\n\n        > ul{\n            background: fade(white, 96%);\n            border-top: 3px solid @phpPurple;\n            box-shadow: fade(black, 25%) 0 -5px 10px;\n            box-sizing: border-box;\n            padding: 20px;\n            overflow: auto;\n            -webkit-overflow-scrolling: touch;\n            position: absolute;\n            left: 0;\n            bottom: 40px;\n            height: 50vh;\n            width: 100vh;\n            transform: translate(0,100vh);\n            transition: all 0.2s ease;\n            z-index: 1;\n        }\n\n        input[type=\"checkbox\"]:checked ~ ul {\n            transform: translate(0,0);\n        }\n    }\n}\n\n/******************************************************************************\n * Content\n *****************************************************************************/\n\n.site-content{\n    h1{\n        padding-top: 40px;\n        position: relative;\n\n        &:after{\n            border: 1px solid #DDD;\n            border-bottom: none;\n            content: \"\";\n            display: block;\n            height: 8px;\n            position: absolute;\n            left: 0;\n            top: 0;\n            width: 100%;\n        }\n    }\n\n    &.chapters{\n        counter-reset: chapter;\n\n        h1{\n            counter-increment: chapter;\n            padding-top: 60px;\n\n            &:before{\n                display: inline-block;\n                content: \"Chapter \" counter(chapter) \".\";\n                position: absolute;\n                top: 30px;\n                left: 50%;\n                transform: translateX(-50%);\n                color: #999;\n                font-size: 12px;\n                letter-spacing: 1px;\n                line-height: 20px;\n                text-transform: uppercase;\n                text-align: center;\n            }\n        }\n    }\n\n    #welcome{\n        ul{\n            columns: 3;\n            column-gap: 30px;\n            list-style-position: inside;\n        }\n    }\n\n    .back-to-top{\n        margin-bottom: 60px;\n    }\n}\n\n@media (max-width: 870px) {\n    .site-content #welcome ul{\n        columns: 2;\n    }\n}\n\n@media (max-width: 600px) {\n    .site-content #welcome ul{\n        columns: 1;\n    }\n}\n\n/******************************************************************************\n * Footer\n *****************************************************************************/\n\n.site-footer{\n    border-top: 1px solid #CCC;\n    margin: 60px auto 0 auto;\n    padding: 40px 20px;\n    font-family: @sans;\n    font-size: 16px;\n    text-align: center;\n\n    .cc-badge{\n        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAABUFvrSAAAAw1BMVEX///8AAAAAAACrsar///8oKSjR1NAODg4jHyDLz8pAPz/f399wcHBQUFBgYGDJzcjEyMN5fHkwMDC9wry4vbeAgIDw8PDBxcDO0c3M0MyUmJPGysW6v7q/v7+fn5/T1tKvtK61urSxt7C/w76zuLKhpKDk5OSRk5F2c3RQUVAbGxuts6yEhoR9fnxDREMgICDW1dXJyMirq6qvr68wLS3Pz8+Rj4+Pj4+LioqEgYJaV1i6ubmbl5meoJ1dXl06NjcZGRmWw6QEAAAAAnRSTlMMANomgjQAAAMCSURBVHjatZYJc6JAEIWznWFmOAQDguAdjUqMd0yi5vz/v2q7GTmkNusWW3kxNfJkPts3TMPVFfyIfiH3ttHwRs1623F0PYp03XHa9ebI6zRu74aDwcPDdQUBXCG3440Qq4ec91GchzqhM/J1FSEYuVguYudLASixnBM6JVPJNxqgtJts2mWHwMh1Ij6dQabZlEeKfDccDlo4xbAsA6e11KzLDoG9EXHvqVbb73Z9m+q+r4dEppLHAmomQ5k1EMmsi44CY74JV/gBU+ohWqtjzSMMY6iBjR4AfQAaTVLO87HkTDabiXIUuNnWieuaLFPgYs1cb1PJC6itUzCrwQ2mCe4bcr9EPEkdOmcsUa+Jo8B1J5wiF8s9J0/DpGQNCt9ogkbladKwwZ/DNnNMtpGfdizlMzkKjAXPQDyxMwUCZqpkMOjYBrBpNADnGDESZDxZ5w4L3uQec5A7chTYCecAPiupBzDHkr0OWHQIKBotwqCzidGI17kTSKlhzFJOyFFgvgSBQXRrhuGr4QUnCFhyzOIbMDLinZTH18y523UTsJmBdS7ARiCQjEcg2fTjBdfrzc6foqCsemwtUUbqvI43jG2lxHMyMACW6MLK7K56Lrjm46qXZNGnkE+LB5AvHjlHudtBvF3MUqcn5eGgybd88aI+AP4KlbMaSF0ERwj2ocZKlxs5k8OXeA6KzkGirICcfwI3ChvEKm6Q/bHkbLbbtXLKUQRPKx+joCGPorGttKXzxTutWrZ41mnxGrdjDcC1LTdvOZcddbndg2DZ5fZoJANbqcuNGtygWttMdvTLtxsE+1uFXp9vafO7LV0ZTE3o/S9NqBqXwLDQ+QeSC23IVG1zDtVFYLD0s0Yf+ALgk0cL+F8wLCL+Ubo18agFqdT+oDeZo/7RL53EzsGUxnvpZtoqzDm9WO6o49JXKaMIpjRCPk1v/1Me6sUc0rZZcE5/BaXtpAQGd4Bozul5BbEDAwoqB6GcrOLcLFesZOw99Yjl7Ql7oeIUXjynBP4h/djT5m+nuF33PcPucwAAAABJRU5ErkJggg==);\n        background-position: top left;\n        background-repeat: no-repeat;\n        background-size: contain;\n        display: inline-block;\n        height: 31px;\n        width: 88px;\n    }\n\n    h2{\n        .gamma;\n        margin-bottom: 10px;\n    }\n\n    ul{\n        list-style: none;\n        margin: 0 0 20px 0;\n        padding: 0;\n    }\n\n    .license{\n        color: #777;\n        font-size: 13px;\n    }\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"php-the-right-way\",\n  \"version\": \"2.0.0\",\n  \"devDependencies\": {\n    \"grunt\": \"~0.4.5\",\n    \"grunt-contrib-less\": \"~1.0.1\",\n    \"grunt-contrib-watch\": \"~0.6.1\",\n    \"grunt-postcss\": \"^0.6.0\",\n    \"autoprefixer\": \"^6.0.3\"\n  }\n}\n"
  },
  {
    "path": "pages/Design-Patterns.md",
    "content": "---\nlayout: page\ntitle:  Design Patterns\nsitemap: true\n---\n\n# Design Patterns\n\nThere are numerous ways to structure the code and project for your web application, and you can put as much or as little thought as you like into architecting. But it is usually a good idea to follow common patterns because it will\nmake your code easier to manage and easier for others to understand.\n\n* [Architectural pattern on Wikipedia](https://en.wikipedia.org/wiki/Architectural_pattern)\n* [Software design pattern on Wikipedia](https://en.wikipedia.org/wiki/Software_design_pattern)\n* [Collection of implementation examples](https://designpatternsphp.readthedocs.io/en/latest/)\n\n## Factory\n\nOne of the most commonly used design patterns is the factory pattern. In this pattern, a class simply creates the\nobject you want to use. Consider the following example of the factory pattern:\n\n{% highlight php %}\n<?php\nclass Automobile\n{\n    private $vehicleMake;\n    private $vehicleModel;\n\n    public function __construct($make, $model)\n    {\n        $this->vehicleMake = $make;\n        $this->vehicleModel = $model;\n    }\n\n    public function getMakeAndModel()\n    {\n        return $this->vehicleMake . ' ' . $this->vehicleModel;\n    }\n}\n\nclass AutomobileFactory\n{\n    public static function create($make, $model)\n    {\n        return new Automobile($make, $model);\n    }\n}\n\n// have the factory create the Automobile object\n$veyron = AutomobileFactory::create('Bugatti', 'Veyron');\n\nprint_r($veyron->getMakeAndModel()); // outputs \"Bugatti Veyron\"\n{% endhighlight %}\n\nThis code uses a factory to create the Automobile object. There are two possible benefits to building your code this\nway; the first is that if you need to change, rename, or replace the Automobile class later on you can do so and you\nwill only have to modify the code in the factory, instead of every place in your project that uses the Automobile class.\nThe second possible benefit is that, if creating the object is a complicated job, you can do all of the work in the\nfactory instead of repeating it every time you want to create a new instance.\n\nUsing the factory pattern isn't always necessary (or wise). The example code used here is so simple that a factory\nwould simply be adding unneeded complexity. However if you are making a fairly large or complex project you may save\nyourself a lot of trouble down the road by using factories.\n\n* [Factory pattern on Wikipedia](https://en.wikipedia.org/wiki/Factory_pattern)\n\n## Singleton\n\nWhen designing web applications, it often makes sense conceptually and architecturally to allow access to one and only\none instance of a particular class. The singleton pattern enables us to do this.\n\n**TODO: NEED NEW SINGLETON CODE EXAMPLE**\n\nThe code above implements the singleton pattern using a [*static* variable](https://www.php.net/language.variables.scope#language.variables.scope.static) and the static creation method `getInstance()`.\nNote the following:\n\n* The constructor [`__construct()`](https://www.php.net/language.oop5.decon#object.construct) is declared as protected to\nprevent creating a new instance outside of the class via the `new` operator.\n* The magic method [`__clone()`](https://www.php.net/language.oop5.cloning#object.clone) is declared as private to prevent\ncloning of an instance of the class via the [`clone`](https://www.php.net/language.oop5.cloning) operator.\n* The magic method [`__wakeup()`](https://www.php.net/language.oop5.magic#object.wakeup) is declared as private to prevent\nunserializing of an instance of the class via the global function [`unserialize()`](https://www.php.net/function.unserialize)\n.\n* A new instance is created via [late static binding](https://www.php.net/language.oop5.late-static-bindings) in the static\ncreation method `getInstance()` with the keyword `static`. This allows the subclassing of the class `Singleton` in the\nexample.\n\nThe singleton pattern is useful when we need to make sure we only have a single instance of a class for the entire\nrequest lifecycle in a web application. This typically occurs when we have global objects (such as a Configuration\nclass) or a shared resource (such as an event queue).\n\nYou should be wary when using the singleton pattern, as by its very nature it introduces global state into your\napplication, reducing testability. In most cases, dependency injection can (and should) be used in place of a singleton\nclass. Using dependency injection means that we do not introduce unnecessary coupling into the design of our\napplication, as the object using the shared or global resource requires no knowledge of a concretely defined class.\n\n* [Singleton pattern on Wikipedia](https://en.wikipedia.org/wiki/Singleton_pattern)\n\n## Strategy\n\nWith the strategy pattern you encapsulate specific families of algorithms allowing the client class responsible for\ninstantiating a particular algorithm to have no knowledge of the actual implementation. There are several variations on\nthe strategy pattern, the simplest of which is outlined below:\n\nThis first code snippet outlines a family of algorithms; you may want a serialized array, some JSON or maybe just an\narray of data:\n\n{% highlight php %}\n<?php\n\ninterface OutputInterface\n{\n    public function load();\n}\n\nclass SerializedArrayOutput implements OutputInterface\n{\n    public function load()\n    {\n        return serialize($arrayOfData);\n    }\n}\n\nclass JsonStringOutput implements OutputInterface\n{\n    public function load()\n    {\n        return json_encode($arrayOfData);\n    }\n}\n\nclass ArrayOutput implements OutputInterface\n{\n    public function load()\n    {\n        return $arrayOfData;\n    }\n}\n{% endhighlight %}\n\nBy encapsulating the above algorithms you are making it nice and clear in your code that other developers can easily\nadd new output types without affecting the client code.\n\nYou will see how each concrete 'output' class implements an OutputInterface - this serves two purposes, primarily it\nprovides a simple contract which must be obeyed by any new concrete implementations. Secondly by implementing a common\ninterface you will see in the next section that you can now utilise [Type Hinting](https://www.php.net/language.oop5.typehinting) to ensure that the client which is utilising these behaviours is of the correct type,\nin this case 'OutputInterface'.\n\nThe next snippet of code outlines how a calling client class might use one of these algorithms and even better set the\nbehaviour required at runtime:\n\n{% highlight php %}\n<?php\nclass SomeClient\n{\n    private $output;\n\n    public function setOutput(OutputInterface $outputType)\n    {\n        $this->output = $outputType;\n    }\n\n    public function loadOutput()\n    {\n        return $this->output->load();\n    }\n}\n{% endhighlight %}\n\nThe calling client class above has a private property which must be set at runtime and be of type 'OutputInterface'.\nOnce this property is set a call to loadOutput() will call the load() method in the concrete class of the output type\nthat has been set.\n\n{% highlight php %}\n<?php\n$client = new SomeClient();\n\n// Want an array?\n$client->setOutput(new ArrayOutput());\n$data = $client->loadOutput();\n\n// Want some JSON?\n$client->setOutput(new JsonStringOutput());\n$data = $client->loadOutput();\n\n{% endhighlight %}\n\n* [Strategy pattern on Wikipedia](https://en.wikipedia.org/wiki/Strategy_pattern)\n\n## Front Controller\n\nThe front controller pattern is where you have a single entrance point for your web application (e.g. index.php) that\nhandles all of the requests. This code is responsible for loading all of the dependencies, processing the request and\nsending the response to the browser. The front controller pattern can be beneficial because it encourages modular code\nand gives you a central place to hook in code that should be run for every request (such as input sanitization).\n\n* [Front Controller pattern on Wikipedia](https://en.wikipedia.org/wiki/Front_Controller_pattern)\n\n## Model-View-Controller\n\nThe model-view-controller (MVC) pattern and its relatives HMVC and MVVM let you break up code into logical objects\nthat serve very specific purposes. Models serve as a data access layer where data is fetched and returned in formats\nusable throughout your application. Controllers handle the request, process the data returned from models and load\nviews to send in the response. And views are display templates (markup, xml, etc) that are sent in the response to the\nweb browser.\n\nMVC is the most common architectural pattern used in the popular [PHP frameworks](https://github.com/codeguy/php-the-right-way/wiki/Frameworks).\n\nLearn more about MVC and its relatives:\n\n* [MVC](https://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller)\n* [HMVC](https://en.wikipedia.org/wiki/Hierarchical_model%E2%80%93view%E2%80%93controller)\n* [MVVM](https://en.wikipedia.org/wiki/Model_View_ViewModel)\n"
  },
  {
    "path": "pages/Functional-Programming.md",
    "content": "---\nlayout: page\ntitle:  Functional Programming in PHP\nsitemap: true\n---\n\n# Functional Programming in PHP\n\nPHP supports first-class functions, meaning that a function can be assigned to a variable. Both user-defined and\nbuilt-in functions can be referenced by a variable and invoked dynamically. Functions can be passed as arguments to\nother functions and a function can return other functions (a feature called higher-order functions).\n\nRecursion, a feature that allows a function to call itself, is supported by the language, but most of the PHP code\nfocus is on iteration.\n\nAnonymous functions (with support for closures) have been present since PHP 5.3 (2009).\n\nPHP 5.4 added the ability to bind closures to an object's scope and also improved support for callables such that they\ncan be used interchangeably with anonymous functions in almost all cases.\n\nThe most common usage of higher-order functions is when implementing a strategy pattern. The built-in `array_filter()`\nfunction asks both for the input array (data) and a function (a strategy or a callback) used as a filter function on\neach array item.\n\n{% highlight php %}\n<?php\n$input = array(1, 2, 3, 4, 5, 6);\n\n// Creates a new anonymous function and assigns it to a variable\n$filter_even = function($item) {\n    return ($item % 2) == 0;\n};\n\n// Built-in array_filter accepts both the data and the function\n$output = array_filter($input, $filter_even);\n\n// The function doesn't need to be assigned to a variable. This is valid too:\n$output = array_filter($input, function($item) {\n    return ($item % 2) == 0;\n});\n\nprint_r($output);\n{% endhighlight %}\n\nA closure is an anonymous function that can access variables imported from the outside scope without using any global\nvariables. Theoretically, a closure is a function with some arguments closed (e.g. fixed) by the environment when it is\ndefined. Closures can work around variable scope restrictions in a clean way.\n\nIn the next example we use closures to define a function returning a single filter function for `array_filter()`, out\nof a family of filter functions.\n\n{% highlight php %}\n<?php\n/**\n * Creates an anonymous filter function accepting items > $min\n *\n * Returns a single filter out of a family of \"greater than n\" filters\n */\nfunction criteria_greater_than($min)\n{\n    return function($item) use ($min) {\n        return $item > $min;\n    };\n}\n\n$input = array(1, 2, 3, 4, 5, 6);\n\n// Use array_filter on a input with a selected filter function\n$output = array_filter($input, criteria_greater_than(3));\n\nprint_r($output); // items > 3\n{% endhighlight %}\n\nEach filter function in the family accepts only elements greater than some minimum value. The single filter returned by\n`criteria_greater_than` is a closure with `$min` argument closed by the value in the scope (given as an argument when\n`criteria_greater_than` is called).\n\nEarly binding is used by default for importing `$min` variable into the created function. For true closures with late\nbinding one should use a reference when importing. Imagine a templating or input validation library, where a closure is\ndefined to capture variables in scope and access them later when the anonymous function is evaluated.\n\n* [Read about Anonymous functions][anonymous-functions]\n* [More details in the Closures RFC][closures-rfc]\n* [Read about dynamically invoking functions with `call_user_func_array()`][call-user-func-array]\n\n\n[anonymous-functions]: https://www.php.net/functions.anonymous\n[closures-rfc]: https://wiki.php.net/rfc/closures\n[call-user-func-array]: https://www.php.net/function.call-user-func-array\n"
  },
  {
    "path": "pages/The-Basics.md",
    "content": "---\nlayout: page\ntitle:  The Basics\nsitemap: true\n---\n\n# The Basics\n\n## Comparison operators\n\nComparison operators are an often overlooked aspect of PHP, which can lead to many unexpected outcomes. One such\nproblem stems from strict comparisons (the comparison of booleans as integers).\n\n{% highlight php %}\n<?php\n$a = 5;   // 5 as an integer\n\nvar_dump($a == 5);       // compare value; return true\nvar_dump($a == '5');     // compare value (ignore type); return true\nvar_dump($a === 5);      // compare type/value (integer vs. integer); return true\nvar_dump($a === '5');    // compare type/value (integer vs. string); return false\n\n//Equality comparisons\nif (strpos('testing', 'test')) {    // 'test' is found at position 0, which is interpreted as the boolean 'false'\n    // code...\n}\n\n// vs. strict comparisons\nif (strpos('testing', 'test') !== false) {    // true, as strict comparison was made (0 !== false)\n    // code...\n}\n{% endhighlight %}\n\n* [Comparison operators](https://www.php.net/language.operators.comparison)\n* [Comparison table](https://www.php.net/types.comparisons)\n* [Comparison cheatsheet](https://phpcheatsheets.com/index.php?page=compare)\n\n## Conditional statements\n\n### If statements\n\nWhile using 'if/else' statements within a function or class method, there is a common misconception that 'else' must be used\nin conjunction to declare potential outcomes. However if the outcome is to define the return value, 'else' is not\nnecessary as 'return' will end the function, causing 'else' to become moot.\n\n{% highlight php %}\n<?php\nfunction test($a)\n{\n    if ($a) {\n        return true;\n    } else {\n        return false;\n    }\n}\n\n// vs.\n\nfunction test($a)\n{\n    if ($a) {\n        return true;\n    }\n    return false;    // else is not necessary\n}\n\n// or even shorter:\n\nfunction test($a)\n{\n    return (bool) $a;\n}\n\n{% endhighlight %}\n\n* [If statements](https://www.php.net/control-structures.if)\n\n### Switch statements\n\nSwitch statements are a great way to avoid typing endless if's and elseif's, but there are a few things to be aware of:\n\n- Switch statements only compare values, and not the type (equivalent to '==')\n- They iterate case by case until a match is found. If no match is found, then the default is used (if defined)\n- Without a 'break', they will continue to implement each case until reaching a break/return\n- Within a function, using 'return' alleviates the need for 'break' as it ends the function\n\n{% highlight php %}\n<?php\n$answer = test(2);    // the code from both 'case 2' and 'case 3' will be implemented\n\nfunction test($a)\n{\n    switch ($a) {\n        case 1:\n            // code...\n            break;             // break is used to end the switch statement\n        case 2:\n            // code...         // with no break, comparison will continue to 'case 3'\n        case 3:\n            // code...\n            return $result;    // within a function, 'return' will end the function\n        default:\n            // code...\n            return $error;\n    }\n}\n{% endhighlight %}\n\n* [Switch statements](https://www.php.net/control-structures.switch)\n* [PHP switch](http://phpswitch.com/)\n\n## Global namespace\n\nWhen using namespaces, you may find that internal functions are hidden by functions you wrote. To fix this, refer to\nthe global function by using a backslash before the function name.\n\n{% highlight php %}\n<?php\nnamespace phptherightway;\n\nfunction fopen()\n{\n    $file = \\fopen();    // Our function name is the same as an internal function.\n                         // Execute the function from the global space by adding '\\'.\n}\n\nfunction array()\n{\n    $iterator = new \\ArrayIterator();    // ArrayIterator is an internal class. Using its name without a backslash\n                                         // will attempt to resolve it within your namespace.\n}\n{% endhighlight %}\n\n* [Global space](https://www.php.net/language.namespaces.global)\n* [Global rules](https://www.php.net/userlandnaming.rules)\n\n## Strings\n\n### Concatenation\n\n- If your line extends beyond the recommended line length (120 characters), consider concatenating your line\n- For readability it is best to use concatenation operators over concatenating assignment operators\n- While within the original scope of the variable, indent when concatenation uses a new line\n\n\n{% highlight php %}\n<?php\n$a  = 'Multi-line example';    // concatenating assignment operator (.=)\n$a .= \"\\n\";\n$a .= 'of what not to do';\n\n// vs\n\n$a = 'Multi-line example'      // concatenation operator (.)\n    . \"\\n\"                     // indenting new lines\n    . 'of what to do';\n{% endhighlight %}\n\n* [String Operators](https://www.php.net/language.operators.string)\n\n### String types\n\nStrings are a series of characters, which should sound fairly simple. That said, there are a few different types of\nstrings and they offer slightly different syntax, with slightly different behaviors.\n\n#### Single quotes\n\nSingle quotes are used to denote a \"literal string\". Literal strings do not attempt to parse special characters or\nvariables.\n\nIf using single quotes, you could enter a variable name into a string like so: `'some $thing'`, and you would see the\nexact output of `some $thing`. If using double quotes, that would try to evaluate the `$thing` variable name and show\nerrors if no variable was found.\n\n\n{% highlight php %}\n<?php\necho 'This is my string, look at how pretty it is.';    // no need to parse a simple string\n\n/**\n * Output:\n *\n * This is my string, look at how pretty it is.\n */\n{% endhighlight %}\n\n* [Single quote](https://www.php.net/language.types.string#language.types.string.syntax.single)\n\n#### Double quotes\n\nDouble quotes are the Swiss Army Knife of strings. They will not only parse variables as mentioned above, but all sorts\nof special characters, like `\\n` for newline, `\\t` for a tab, etc.\n\n{% highlight php %}\n<?php\necho 'phptherightway is ' . $adjective . '.'     // a single quotes example that uses multiple concatenating for\n    . \"\\n\"                                       // variables and escaped string\n    . 'I love learning' . $code . '!';\n\n// vs\n\necho \"phptherightway is $adjective.\\n I love learning $code!\"  // Instead of multiple concatenating, double quotes\n                                                               // enables us to use a parsable string\n{% endhighlight %}\n\nDouble quotes can contain variables; this is called \"interpolation\".\n\n{% highlight php %}\n<?php\n$juice = 'plum';\necho \"I like $juice juice\";    // Output: I like plum juice\n{% endhighlight %}\n\nWhen using interpolation, it is often the case that the variable will be touching another character. This will result\nin some confusion as to what is the name of the variable, and what is a literal character.\n\nTo fix this problem, wrap the variable within a pair of curly brackets.\n\n{% highlight php %}\n<?php\n$juice = 'plum';\necho \"I drank some juice made of $juices\";    // $juice cannot be parsed\n\n// vs\n\n$juice = 'plum';\necho \"I drank some juice made of {$juice}s\";    // $juice will be parsed\n\n/**\n * Complex variables will also be parsed within curly brackets\n */\n\n$juice = array('apple', 'orange', 'plum');\necho \"I drank some juice made of {$juice[1]}s\";   // $juice[1] will be parsed\n{% endhighlight %}\n\n* [Double quotes](https://www.php.net/language.types.string#language.types.string.syntax.double)\n\n#### Nowdoc syntax\n\nNowdoc syntax was introduced in 5.3 and internally behaves the same way as single quotes except it is suited toward the\nuse of multi-line strings without the need for concatenating.\n\n{% highlight php %}\n<?php\n$str = <<<'EOD'             // initialized by <<<\nExample of string\nspanning multiple lines\nusing nowdoc syntax.\n$a does not parse.\nEOD;                        // closing 'EOD' must be on its own line, and to the left most point\n\n/**\n * Output:\n *\n * Example of string\n * spanning multiple lines\n * using nowdoc syntax.\n * $a does not parse.\n */\n{% endhighlight %}\n\n* [Nowdoc syntax](https://www.php.net/language.types.string#language.types.string.syntax.nowdoc)\n\n#### Heredoc syntax\n\nHeredoc syntax internally behaves the same way as double quotes except it is suited toward the use of multi-line\nstrings without the need for concatenating.\n\n{% highlight php %}\n<?php\n$a = 'Variables';\n\n$str = <<<EOD               // initialized by <<<\nExample of string\nspanning multiple lines\nusing heredoc syntax.\n$a are parsed.\nEOD;                        // closing 'EOD' must be on its own line, and to the left most point\n\n/**\n * Output:\n *\n * Example of string\n * spanning multiple lines\n * using heredoc syntax.\n * Variables are parsed.\n */\n{% endhighlight %}\n\n* [Heredoc syntax](https://www.php.net/language.types.string#language.types.string.syntax.heredoc)\n\n> It should be noted that multiline strings can also be formed by continuing them across multilines in a statement. _e.g._\n\n{% highlight php %}\n$str = \"\nExample of string\nspanning multiple lines\nusing statement syntax.\n$a are parsed.\n\";\n\n/**\n * Output:\n *\n * Example of string\n * spanning multiple lines\n * using statement syntax.\n * Variables are parsed.\n */\n{% endhighlight %}\n\n### Which is quicker?\n\nThere is a myth floating around that single quote strings are fractionally quicker than double quote strings. This is\nfundamentally not true.\n\nIf you are defining a single string and not trying to concatenate values or anything complicated, then either a single\nor double quoted string will be entirely identical. Neither are quicker.\n\nIf you are concatenating multiple strings of any type, or interpolate values into a double quoted string, then the\nresults can vary. If you are working with a small number of values, concatenation is minutely faster. With a lot of\nvalues, interpolating is minutely faster.\n\nRegardless of what you are doing with strings, none of the types will ever have any noticeable impact on your\napplication. Trying to rewrite code to use one or the other is always an exercise in futility, so avoid this\nmicro-optimization unless you really understand the meaning and impact of the differences.\n\n* [Disproving the Single Quotes Performance Myth](https://www.npopov.com/2012/01/09/Disproving-the-Single-Quotes-Performance-Myth.html)\n\n\n## Ternary operators\n\nTernary operators are a great way to condense code, but are often used in excess. While ternary operators can be\nstacked/nested, it is advised to use one per line for readability.\n\n{% highlight php %}\n<?php\n$a = 5;\necho ($a == 5) ? 'yay' : 'nay';\n{% endhighlight %}\n\nIn comparison, here is an example that sacrifices all forms of readability for the sake of reducing the line count.\n\n{% highlight php %}\n<?php\necho ($a) ? ($a == 5) ? 'yay' : 'nay' : ($b == 10) ? 'excessive' : ':(';    // excess nesting, sacrificing readability\n{% endhighlight %}\n\nTo 'return' a value with ternary operators use the correct syntax.\n\n{% highlight php %}\n<?php\n$a = 5;\necho ($a == 5) ? return true : return false;    // this example will output an error\n\n// vs\n\n$a = 5;\nreturn ($a == 5) ? 'yay' : 'nope';    // this example will return 'yay'\n\n{% endhighlight %}\n\nIt should be noted that you do not need to use a ternary operator for returning a boolean value. An example of this\nwould be:\n\n{% highlight php %}\n<?php\n$a = 3;\nreturn ($a == 3) ? true : false; // Will return true if $a == 3 or false\n\n// vs\n\n$a = 3;\nreturn $a == 3; // Will return true if $a == 3 or false\n\n{% endhighlight %}\n\nThis can also be said for all operations(===, !==, !=, == etc).\n\n#### Utilising brackets with ternary operators for form and function\n\nWhen utilising a ternary operator, brackets can play their part to improve code readability and also to include unions\nwithin blocks of statements. An example of when there is no requirement to use bracketing is:\n\n{% highlight php %}\n<?php\n$a = 3;\nreturn ($a == 3) ? \"yay\" : \"nope\"; // return yay if $a == 3 or nope\n\n// vs\n\n$a = 3;\nreturn $a == 3 ? \"yay\" : \"nope\"; // return yay if $a == 3 or nope\n{% endhighlight %}\n\nBracketing also affords us the capability of creating unions within a statement block where the block will be checked\nas a whole. Such as this example below which will return true if both ($a == 3 and $b == 4) are true and $c == 5 is\nalso true.\n\n{% highlight php %}\n<?php\nreturn ($a == 3 && $b == 4) && $c == 5;\n{% endhighlight %}\n\nAnother example is the snippet below which will return true if ($a != 3 AND $b != 4) OR $c == 5.\n\n{% highlight php %}\n<?php\nreturn ($a != 3 && $b != 4) || $c == 5;\n{% endhighlight %}\n\nSince PHP 5.3, it is possible to leave out the middle part of the ternary operator.\nExpression \"expr1 ?: expr3\" returns expr1 if expr1 evaluates to TRUE, and expr3 otherwise.\n\n* [Ternary operators](https://www.php.net/language.operators.comparison)\n"
  },
  {
    "path": "pages/example.md",
    "content": "---\nlayout: page\ntitle: Example Stand-Alone Page\n---\n\n# Page Title\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\ntempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. Duis aute irure dolor in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\ntempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. Duis aute irure dolor in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\ntempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. Duis aute irure dolor in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n"
  },
  {
    "path": "scripts/fastclick.js",
    "content": "/** Shrinkwrap URL:\n *      /v2/bundles/js?modules=fastclick%401.0.6%2Co-autoinit%401.0.1&shrinkwrap=\n */\n!function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return t[o].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p=\"\",e(0)}([function(t,e,n){\"use strict\";n(1),window.Origami={fastclick:n(2),\"o-autoinit\":n(4)}},function(t,e){t.exports={name:\"__MAIN__\",dependencies:{fastclick:\"fastclick#*\",\"o-autoinit\":\"o-autoinit#^1.0.0\"}}},function(t,e,n){t.exports=n(3)},function(t,e){\"use strict\";var n=!1;!function(){function e(t,n){function o(t,e){return function(){return t.apply(e,arguments)}}var r;if(n=n||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=n.touchBoundary||10,this.layer=t,this.tapDelay=n.tapDelay||200,this.tapTimeout=n.tapTimeout||700,!e.notNeeded(t)){for(var a=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],c=this,s=0,u=a.length;u>s;s++)c[a[s]]=o(c[a[s]],c);i&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,o){var i=Node.prototype.removeEventListener;\"click\"===e?i.call(t,e,n.hijacked||n,o):i.call(t,e,n,o)},t.addEventListener=function(e,n,o){var i=Node.prototype.addEventListener;\"click\"===e?i.call(t,e,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),o):i.call(t,e,n,o)}),\"function\"==typeof t.onclick&&(r=t.onclick,t.addEventListener(\"click\",function(t){r(t)},!1),t.onclick=null)}}var o=navigator.userAgent.indexOf(\"Windows Phone\")>=0,i=navigator.userAgent.indexOf(\"Android\")>0&&!o,r=/iP(ad|hone|od)/.test(navigator.userAgent)&&!o,a=r&&/OS 4_\\d(_\\d)?/.test(navigator.userAgent),c=r&&/OS [6-7]_\\d/.test(navigator.userAgent),s=navigator.userAgent.indexOf(\"BB10\")>0;e.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case\"button\":case\"select\":case\"textarea\":if(t.disabled)return!0;break;case\"input\":if(r&&\"file\"===t.type||t.disabled)return!0;break;case\"label\":case\"iframe\":case\"video\":return!0}return/\\bneedsclick\\b/.test(t.className)},e.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case\"textarea\":return!0;case\"select\":return!i;case\"input\":switch(t.type){case\"button\":case\"checkbox\":case\"file\":case\"image\":case\"radio\":case\"submit\":return!1}return!t.disabled&&!t.readOnly;default:return/\\bneedsfocus\\b/.test(t.className)}},e.prototype.sendClick=function(t,e){var n,o;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),o=e.changedTouches[0],n=document.createEvent(\"MouseEvents\"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},e.prototype.determineEventType=function(t){return i&&\"select\"===t.tagName.toLowerCase()?\"mousedown\":\"click\"},e.prototype.focus=function(t){var e;r&&t.setSelectionRange&&0!==t.type.indexOf(\"date\")&&\"time\"!==t.type&&\"month\"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},e.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},e.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},e.prototype.onTouchStart=function(t){var e,n,o;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],r){if(o=window.getSelection(),o.rangeCount&&!o.isCollapsed)return!0;if(!a){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTime<this.tapDelay&&t.preventDefault(),!0},e.prototype.touchHasMoved=function(t){var e=t.changedTouches[0],n=this.touchBoundary;return Math.abs(e.pageX-this.touchStartX)>n||Math.abs(e.pageY-this.touchStartY)>n?!0:!1},e.prototype.onTouchMove=function(t){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},e.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector(\"button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea\")},e.prototype.onTouchEnd=function(t){var e,n,o,s,u,l=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(t.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,c&&(u=t.changedTouches[0],l=document.elementFromPoint(u.pageX-window.pageXOffset,u.pageY-window.pageYOffset)||l,l.fastClickScrollParent=this.targetElement.fastClickScrollParent),o=l.tagName.toLowerCase(),\"label\"===o){if(e=this.findControl(l)){if(this.focus(l),i)return!1;l=e}}else if(this.needsFocus(l))return t.timeStamp-n>100||r&&window.top!==window&&\"input\"===o?(this.targetElement=null,!1):(this.focus(l),this.sendClick(l,t),r&&\"select\"===o||(this.targetElement=null,t.preventDefault()),!1);return r&&!a&&(s=l.fastClickScrollParent,s&&s.fastClickLastScrollTop!==s.scrollTop)?!0:(this.needsClick(l)||(t.preventDefault(),this.sendClick(l,t)),!1)},e.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},e.prototype.onMouse=function(t){return this.targetElement?t.forwardedTouchEvent?!0:t.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1):!0:!0},e.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):\"submit\"===t.target.type&&0===t.detail?!0:(e=this.onMouse(t),e||(this.targetElement=null),e)},e.prototype.destroy=function(){var t=this.layer;i&&(t.removeEventListener(\"mouseover\",this.onMouse,!0),t.removeEventListener(\"mousedown\",this.onMouse,!0),t.removeEventListener(\"mouseup\",this.onMouse,!0)),t.removeEventListener(\"click\",this.onClick,!0),t.removeEventListener(\"touchstart\",this.onTouchStart,!1),t.removeEventListener(\"touchmove\",this.onTouchMove,!1),t.removeEventListener(\"touchend\",this.onTouchEnd,!1),t.removeEventListener(\"touchcancel\",this.onTouchCancel,!1)},e.notNeeded=function(t){var e,n,o,r;if(\"undefined\"==typeof window.ontouchstart)return!0;if(n=+(/Chrome\\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!i)return!0;if(e=document.querySelector(\"meta[name=viewport]\")){if(-1!==e.content.indexOf(\"user-scalable=no\"))return!0;if(n>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(s&&(o=navigator.userAgent.match(/Version\\/([0-9]*)\\.([0-9]*)/),o[1]>=10&&o[2]>=3&&(e=document.querySelector(\"meta[name=viewport]\")))){if(-1!==e.content.indexOf(\"user-scalable=no\"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return\"none\"===t.style.msTouchAction||\"manipulation\"===t.style.touchAction?!0:(r=+(/Firefox\\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],r>=27&&(e=document.querySelector(\"meta[name=viewport]\"),e&&(-1!==e.content.indexOf(\"user-scalable=no\")||document.documentElement.scrollWidth<=window.outerWidth))?!0:\"none\"===t.style.touchAction||\"manipulation\"===t.style.touchAction?!0:!1)},e.attach=function(t,n){return new e(t,n)},\"function\"==typeof n&&\"object\"==typeof n.amd&&n.amd?n(function(){return e}):\"undefined\"!=typeof t&&t.exports?(t.exports=e.attach,t.exports.FastClick=e):window.FastClick=e}()},function(t,e,n){t.exports=n(5)},function(t,e){\"use strict\";function n(t){t in o||(o[t]=!0,document.dispatchEvent(new CustomEvent(\"o.\"+t)))}var o={};window.addEventListener(\"load\",n.bind(null,\"load\")),window.addEventListener(\"load\",n.bind(null,\"DOMContentLoaded\")),document.addEventListener(\"DOMContentLoaded\",n.bind(null,\"DOMContentLoaded\")),\"complete\"===document.readyState?(n(\"load\"),n(\"DOMContentLoaded\")):\"interactive\"===document.readyState&&n(\"DOMContentLoaded\")}]);\n"
  },
  {
    "path": "scripts/setup.js",
    "content": "(function ($) {\n    // Attach FastClick\n    var attachFastClick = Origami.fastclick;\n    attachFastClick(document.body);\n\n    // Mobile TOC menu\n    var $window = $(window),\n        $nav = $('.site-navigation');\n    $nav.click(function (e) {\n        var $target = $(e.target);\n        if ($target.is($nav) && $window.width() <= 375) {\n            $nav.toggleClass('open');\n        }\n        if ($target.is('a')) {\n            $nav.removeClass('open');\n        }\n    });\n})(jQuery);\n"
  },
  {
    "path": "styles/all.css",
    "content": "/* ==========================================================================\n   NMC Bootstrap\n\n   This LESS file imports all other LESS files. You should compile\n   and minify this file before site launch.\n   ========================================================================== */\n/* Import NMC bootstrap */\n/**\n * html5doctor.com Reset Stylesheet\n * v1.6.1\n * Last Updated: 2010-09-17\n * Author: Richard Clark - http://richclarkdesign.com\n * Twitter: @rich_clark\n */\nhtml,\nbody,\ndiv,\nspan,\nobject,\niframe,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np,\nblockquote,\npre,\nabbr,\naddress,\ncite,\ncode,\ndel,\ndfn,\nem,\nimg,\nins,\nkbd,\nq,\nsamp,\nsmall,\nstrong,\nsub,\nsup,\nvar,\nb,\ni,\ndl,\ndt,\ndd,\nol,\nul,\nli,\nfieldset,\nform,\nlabel,\nlegend,\ntable,\ncaption,\ntbody,\ntfoot,\nthead,\ntr,\nth,\ntd,\narticle,\naside,\ncanvas,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmenu,\nnav,\nsection,\nsummary,\ntime,\nmark,\naudio,\nvideo {\n  margin: 0;\n  padding: 0;\n  border: 0;\n  outline: 0;\n  font-size: 100%;\n  vertical-align: baseline;\n  background: transparent;\n}\nbody {\n  line-height: 1;\n}\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmenu,\nnav,\nsection {\n  display: block;\n}\nnav ul {\n  list-style: none;\n}\nblockquote,\nq {\n  quotes: none;\n}\nblockquote:before,\nblockquote:after,\nq:before,\nq:after {\n  content: '';\n  content: none;\n}\na {\n  margin: 0;\n  padding: 0;\n  font-size: 100%;\n  vertical-align: baseline;\n  background: transparent;\n}\n/* change colours to suit your needs */\nins {\n  background-color: #ff9;\n  color: #000;\n  text-decoration: none;\n}\n/* change colours to suit your needs */\nmark {\n  background-color: #ff9;\n  color: #000;\n  font-style: italic;\n  font-weight: bold;\n}\ndel {\n  text-decoration: line-through;\n}\nabbr[title],\ndfn[title] {\n  border-bottom: 1px dotted;\n  cursor: help;\n}\ntable {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\n/* change border colour to suit your needs */\nhr {\n  display: block;\n  height: 1px;\n  border: 0;\n  border-top: 1px solid #cccccc;\n  margin: 1em 0;\n  padding: 0;\n}\ninput,\nselect {\n  vertical-align: middle;\n}\n/*---------------------------------------------------\n    LESS Prefixer\n  ---------------------------------------------------\n    \n    All of the CSS3 fun, none of the prefixes!\n\n    As a rule, you can use the CSS properties you\n    would expect just by adding a '.':\n\n    box-shadow => .box-shadow(@args)\n\n    Also, when shorthand is available, arguments are\n    not parameterized. Learn CSS, not LESS Prefixer.\n\n    -------------------------------------------------\n    TABLE OF CONTENTS\n    (*) denotes a syntax-sugar helper\n    -------------------------------------------------\n\n        .animation(@args)\n            .animation-delay(@delay)\n            .animation-direction(@direction)\n            .animation-duration(@duration)\n            .animation-iteration-count(@count)\n            .animation-name(@name)\n            .animation-play-state(@state)\n            .animation-timing-function(@function)\n        .background-size(@args)\n        .border-radius(@args)\n        .box-shadow(@args)\n            .inner-shadow(@args) *\n        .box-sizing(@args)\n            .border-box() *\n            .content-box() *\n        .columns(@args)\n            .column-count(@count)\n            .column-gap(@gap)\n            .column-rule(@args)\n            .column-width(@width)\n        .gradient(@default,@start,@stop) *\n            .linear-gradient-top(@default,@color1,@stop1,@color2,@stop2,[@color3,@stop3,@color4,@stop4])*\n            .linear-gradient-left(@default,@color1,@stop1,@color2,@stop2,[@color3,@stop3,@color4,@stop4])*\n        .opacity(@factor)\n        .transform(@args)\n            .rotate(@deg)\n            .scale(@factor)\n            .translate(@x,@y)\n            .translate3d(@x,@y,@z)\n            .translateHardware(@x,@y) *\n        .text-shadow(@args)\n        .transition(@args)\n            .transition-delay(@delay)\n            .transition-duration(@duration)\n            .transition-property(@property)\n            .transition-timing-function(@function)\n\n\n\n    Credit to LESS Elements for the motivation and\n    to CSS3Please.com for implementation.\n\n    Copyright (c) 2012 Joel Sutherland\n    MIT Licensed:\n    http://www.opensource.org/licenses/mit-license.php\n\n-----------------------------------------------------*/\n/* Animation */\n/* Background Size */\n/* Border Radius */\n/* Box Shadows */\n/* Box Sizing */\n/* Columns */\n/* Gradients */\n/* Opacity */\n/* Text Shadow */\n/* Transforms */\n/* Transitions */\n/**\n * Spacing\n *\n * This LESS file defines margins and paddings for block-level\n * elements. Helper classes are included for use elsewhere\n * in site styles.\n */\n/* Settings */\n/* ==========================================================================\n   Spacing\n   ========================================================================== */\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n/* ==========================================================================\n   Grid\n   ========================================================================== */\n/* ==========================================================================\n   Buttons\n   ========================================================================== */\n/* ==========================================================================\n   Site Variables\n   ========================================================================== */\n/* ==========================================================================\n   Spacing\n   ========================================================================== */\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n/* ==========================================================================\n   Grid\n   ========================================================================== */\n/* ==========================================================================\n   Buttons\n   ========================================================================== */\n/*\n@baseline: @baseline;\n*/\n/**\n * Spacing\n * p, m, lh = padding, margin, line-height\n * a, t, r, b, l, h, v = all, top, right, bottom, left, horizontal, vertical\n * n, h, s, d = none(0px), half(@baseline / 2), single(@baseline), double(@baseline * 2), none(0px)\n */\n.ptn,\n.pvn,\n.pan {\n  padding-top: 0px !important;\n}\n.pth,\n.pvh,\n.pah {\n  padding-top: 10px !important;\n}\n.pts,\n.pvs,\n.pas {\n  padding-top: 20px !important;\n}\n.ptd,\n.pvd,\n.pad {\n  padding-top: 40px !important;\n}\n.prn,\n.phn,\n.pan {\n  padding-right: 0px !important;\n}\n.prh,\n.phh,\n.pah {\n  padding-right: 10px !important;\n}\n.prs,\n.phs,\n.pas {\n  padding-right: 20px !important;\n}\n.prd,\n.phd,\n.pad {\n  padding-right: 40px !important;\n}\n.pbn,\n.pvn,\n.pan {\n  padding-bottom: 0px !important;\n}\n.pbh,\n.pvh,\n.pah {\n  padding-bottom: 10px !important;\n}\n.pbs,\n.pvs,\n.pas {\n  padding-bottom: 20px !important;\n}\n.pbd,\n.pvd,\n.pad {\n  padding-bottom: 40px !important;\n}\n.pln,\n.phn,\n.pan {\n  padding-left: 0px !important;\n}\n.plh,\n.phh,\n.pah {\n  padding-left: 10px !important;\n}\n.pls,\n.phs,\n.pas {\n  padding-left: 20px !important;\n}\n.pld,\n.phd,\n.pad {\n  padding-left: 40px !important;\n}\n.mtn,\n.mvn,\n.man {\n  margin-top: 0px !important;\n}\n.mth,\n.mvh,\n.mah {\n  margin-top: 10px !important;\n}\n.mts,\n.mvs,\n.mas {\n  margin-top: 20px !important;\n}\n.mtd,\n.mvd,\n.mad {\n  margin-top: 40px !important;\n}\n.mrn,\n.mhn,\n.man {\n  margin-right: 0px !important;\n}\n.mrh,\n.mhh,\n.mah {\n  margin-right: 10px !important;\n}\n.mrs,\n.mhs,\n.mas {\n  margin-right: 20px !important;\n}\n.mrd,\n.mhd,\n.mad {\n  margin-right: 40px !important;\n}\n.mbn,\n.mvn,\n.man {\n  margin-bottom: 0px !important;\n}\n.mbh,\n.mvh,\n.mah {\n  margin-bottom: 10px !important;\n}\n.mbs,\n.mvs,\n.mas {\n  margin-bottom: 20px !important;\n}\n.mbd,\n.mvd,\n.mad {\n  margin-bottom: 40px !important;\n}\n.mln,\n.mhn,\n.man {\n  margin-left: 0px !important;\n}\n.mlh,\n.mhh,\n.mah {\n  margin-left: 10px !important;\n}\n.mls,\n.mhs,\n.mas {\n  margin-left: 20px !important;\n}\n.mld,\n.mhd,\n.mad {\n  margin-left: 40px !important;\n}\n.lhh {\n  line-height: 10px !important;\n}\n.lhs {\n  line-height: 20px !important;\n}\n.lhd {\n  line-height: 40px !important;\n}\n.lhn {\n  line-height: 0px !important;\n}\n/**\n * Name Here\n *\n * @version     1.0\n * @package     Name Here\n * @author      New Media Campaigns\n * @copyright   2012 New Media Campaigns\n * @link        http://www.newmediacampaigns.com\n *\n * Copyright (c) 2012 New Media Campaigns\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is furnished\n * to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n/**\n * Typography\n *\n * This LESS file defines the baseline, color, font-size, and other typographical\n * styles for text elements.\n */\n/* Settings */\n/* ==========================================================================\n   Spacing\n   ========================================================================== */\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n/* ==========================================================================\n   Grid\n   ========================================================================== */\n/* ==========================================================================\n   Buttons\n   ========================================================================== */\n/* ==========================================================================\n   Site Variables\n   ========================================================================== */\n/* ==========================================================================\n   Spacing\n   ========================================================================== */\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n/* ==========================================================================\n   Grid\n   ========================================================================== */\n/* ==========================================================================\n   Buttons\n   ========================================================================== */\n/*\n@baseline: @baseline;\n\n@body-color: @body-color;\n@body-font-family: @body-font-family;\n@body-font-size: @body-font-size;\n@body-accent-color: @body-accent-color;\n\n@header-color: @header-clor;\n@header-font-family: @header-font-family;\n@header-font-weight: @header-font-weight;\n*/\n/* Base */\nhtml,\nbody {\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  color: #666666;\n  font-size: 14px;\n  line-height: 20px !important;\n}\n/* Block-level */\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nul,\nol,\ndl,\np,\nblockquote,\ntable,\nform,\npre {\n  margin-bottom: 20px !important;\n}\n/* Headers */\n.all-headers {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n}\nh1,\n.alpha {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n  font-size: 35px;\n  line-height: 40px !important;\n}\nh2,\n.beta {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n  font-size: 24.5px;\n  line-height: 40px !important;\n}\nh3,\n.gamma {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n  font-size: 16.8px;\n  line-height: 40px !important;\n  margin-bottom: 0px !important;\n}\nh4,\n.delta {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n  font-size: 14px;\n  line-height: 40px !important;\n  margin-bottom: 0px !important;\n}\nh5,\n.epsilon {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n  font-size: 14px;\n  line-height: 20px !important;\n  margin-bottom: 0px !important;\n}\nh6,\n.zeta {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n  font-size: 14px;\n  line-height: 20px !important;\n  margin-bottom: 0px !important;\n}\n/* Headers (above scale) */\n.giga {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n  font-size: 84px;\n  line-height: 80px;\n}\n.mega {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n  font-size: 70px;\n  line-height: 60px;\n}\n.kilo {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n  font-size: 56px;\n  line-height: 60px;\n}\n/* Headers (below scale) */\n.milli {\n  color: #111111;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  font-weight: 700;\n  font-size: 11.200000000000001px;\n}\n/* Text */\na {\n  color: #000000;\n}\na:link {\n  text-decoration: underline;\n}\na:hover {\n  text-decoration: none;\n}\nsmall {\n  font-size: 80%;\n}\nsup,\nsub {\n  font-size: 80%;\n  line-height: 0px !important;\n}\nsup {\n  vertical-align: super;\n}\nsub {\n  vertical-align: sub;\n}\n.lead {\n  color: #333333;\n  font-size: 16px;\n}\nblockquote {\n  border-left: 5px solid rgba(0, 0, 0, 0.1);\n  margin-right: 20px !important;\n  margin-left: 20px !important;\n  padding-left: 20px !important;\n  color: #999999;\n  font-size: 16px;\n  font-style: italic;\n}\nblockquote :last-child {\n  margin-bottom: 0px !important;\n}\nblockquote small {\n  color: rgba(0, 0, 0, 0.5);\n  font-size: 14px;\n  font-style: normal;\n}\npre,\ncode,\nkbd {\n  background: #F8F8F8;\n  border: 1px solid #EAEAEA;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  margin: 0 2px;\n  padding: 0 5px;\n  font-family: Consolas, \"Courier New\", Courier, mono;\n  font-size: 12.6px;\n  color: #666666;\n  word-wrap: break-word;\n}\npre {\n  margin-right: 20px !important;\n  margin-left: 20px !important;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n}\npre code {\n  border: none;\n  margin-top: 0px !important;\n  margin-right: 0px !important;\n  margin-bottom: 0px !important;\n  margin-left: 0px !important;\n  padding-top: 0px !important;\n  padding-right: 0px !important;\n  padding-bottom: 0px !important;\n  padding-left: 0px !important;\n}\na code {\n  background: none;\n  border: none;\n  padding-top: 0px !important;\n  padding-right: 0px !important;\n  padding-bottom: 0px !important;\n  padding-left: 0px !important;\n  margin-top: 0px !important;\n  margin-right: 0px !important;\n  margin-bottom: 0px !important;\n  margin-left: 0px !important;\n}\nstrong {\n  font-weight: bold;\n}\nem {\n  font-style: italic;\n}\nol,\nul,\ndl {\n  margin-left: 20px !important;\n  padding-left: 20px !important;\n}\nol ol,\nul ol,\ndl ol,\nol ul,\nul ul,\ndl ul {\n  margin-bottom: 0px !important;\n}\ndt {\n  font-weight: bold;\n}\ndd {\n  margin-left: 20px !important;\n}\n.table {\n  border-collapse: collapse;\n  border-spacing: 0;\n  width: 100%;\n}\n.table th,\n.table td {\n  border-top: 1px solid rgba(0, 0, 0, 0.1);\n  padding: 8px;\n  text-align: left;\n}\n.table thead th {\n  vertical-align: bottom;\n  font-weight: bold;\n}\n.table thead tr:first-child th {\n  border-top: none;\n}\n.table-bordered {\n  border: 1px solid rgba(0, 0, 0, 0.1);\n  border-collapse: separate;\n  border-left: none;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n}\n.table-bordered th,\n.table-bordered td {\n  border-left: 1px solid rgba(0, 0, 0, 0.1);\n}\n.table-bordered thead:last-child tr:last-child th:first-child,\n.table-bordered tbody:last-child tr:last-child td:first-child {\n  -webkit-border-radius: 0 0 0 4px;\n  -moz-border-radius: 0 0 0 4px;\n  border-radius: 0 0 0 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n}\n.table-striped tbody tr:nth-child(odd) td {\n  background: rgba(0, 0, 0, 0.04);\n}\n/* ==========================================================================\n   Alerts\n   ========================================================================== */\n.alert {\n  background: #FCF8E3;\n  border: 1px solid #FBEED5;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  margin-bottom: 20px !important;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n  color: #C09853;\n}\n.alert-success {\n  background: #FCF8E3;\n  border: 1px solid #FBEED5;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  margin-bottom: 20px !important;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n  color: #C09853;\n  background-color: #DFF0D8;\n  border-color: #D6E9C6;\n  color: #468847;\n}\n.alert-error {\n  background: #FCF8E3;\n  border: 1px solid #FBEED5;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  margin-bottom: 20px !important;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n  color: #C09853;\n  background-color: #F2DEDE;\n  border-color: #EED3D7;\n  color: #B94A48;\n}\n.alert-info {\n  background: #FCF8E3;\n  border: 1px solid #FBEED5;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  margin-bottom: 20px !important;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n  color: #C09853;\n  background-color: #D9EDF7;\n  border-color: #BCE8F1;\n  color: #3A87AD;\n}\n/* ==========================================================================\n   Forms\n   ========================================================================== */\nlabel {\n  display: block;\n  font-weight: bold;\n}\nlabel .req {\n  color: #000000;\n  font-weight: bold;\n}\ninput.text,\ntextarea,\nselect,\n.radio-group,\n.checkbox-group {\n  margin-bottom: 20px !important;\n}\ninput.text,\ntextarea {\n  border: none;\n  margin: 0;\n  padding: 0;\n  -webkit-appearance: none;\n  background: #EEE;\n  border: 1px solid #CCC;\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  -webkit-box-shadow: inset rgba(0, 0, 0, 0.1) 0 1px 3px;\n  -moz-box-shadow: inset rgba(0, 0, 0, 0.1) 0 1px 3px;\n  box-shadow: inset rgba(0, 0, 0, 0.1) 0 1px 3px;\n  height: 30px;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n  width: 100%;\n}\ntextarea {\n  height: 120px;\n}\nselect {\n  min-width: 30%;\n}\n.checkbox-group label,\n.radio-group label {\n  font-weight: normal;\n}\n.error {\n  background-color: #F2DEDE !important;\n  border-color: red !important;\n  outline-color: red !important;\n  color: red !important;\n}\n/**\n * New Media Campaigns Idioms\n *\n * These are common patterns we use in all of our\n * projects. They are consolidated here to keep code DRY.\n *\n * Listing\n *    * .no-text, .text-replace\n *    * .no-list\n *    * .no-form\n *    * .fixed-width(@width)\n *    * .column-width(@width)\n *    * .column-left(@width)\n *    * .column-right(@width)\n *    * .full-size\n *    * .absolute-default\n *    * .absolute-fullsize\n *    * .clearfix\n */\n/*  Hides text when using image replacement */\n.no-text,\n.text-replace {\n  overflow: hidden;\n  text-indent: 100%;\n  white-space: nowrap;\n}\n/*  Removes bullets, margin, and padding from list */\n.no-list {\n  list-style: none;\n  margin: 0;\n  padding: 0;\n}\n/*  Removes webkit styling from form element */\n.no-form {\n  border: none;\n  margin: 0;\n  padding: 0;\n  -webkit-appearance: none;\n}\n/*  Center a fixed width container */\n/*  Adds left or right columns (e.g. content and sidebar) */\n/*  Set width and height of element to that of its parent */\n.full-size {\n  height: 100%;\n  width: 100%;\n}\n/*  Position element absolutely to 0,0 */\n.absolute-default {\n  position: absolute;\n  left: 0;\n  top: 0;\n}\n/*  Position element absolutely and set its width and height to that of its parent (useful for slideshows) */\n.absolute-fullsize {\n  position: absolute;\n  left: 0;\n  top: 0;\n  height: 100%;\n  width: 100%;\n}\n/*  The micro clearfix http://nicolasgallagher.com/micro-clearfix-hack/ */\n.clearfix {\n  *zoom: 1;\n}\n.clearfix:before,\n.clearfix:after {\n  content: \"\";\n  display: table;\n}\n.clearfix:after {\n  clear: both;\n}\n/**\n * Hybrid Grid Sytem\n *\n * Blend of the Semantic Grid System and Zurb Foundation with a little Twitter Bootstrap\n */\n/* Settings */\n/* ==========================================================================\n   Spacing\n   ========================================================================== */\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n/* ==========================================================================\n   Grid\n   ========================================================================== */\n/* ==========================================================================\n   Buttons\n   ========================================================================== */\n/* ==========================================================================\n   Site Variables\n   ========================================================================== */\n/* ==========================================================================\n   Spacing\n   ========================================================================== */\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n/* ==========================================================================\n   Grid\n   ========================================================================== */\n/* ==========================================================================\n   Buttons\n   ========================================================================== */\n/*\n@fixed-column-width: 40px;\n@fixed-gutter-width: 20px;\n@fixed-columns: 12;\n\n@fluid-column-width: 4.3%;\n@fluid-gutter-width: 4.4%;\n@fluid-columns: 12;\n\n@mobile-break-width: 480px;\n@mobile-column-width: 8.6%;\n@mobile-gutter-width: 8.8%;\n@mobile-columns: 6;\n*/\n/* Grid */\n.grid-fixed,\n.grid-fluid {\n  *zoom: 1;\n}\n.grid-fixed:before,\n.grid-fluid:before,\n.grid-fixed:after,\n.grid-fluid:after {\n  content: \"\";\n  display: table;\n}\n.grid-fixed:after,\n.grid-fluid:after {\n  clear: both;\n}\n.grid-fixed .row,\n.grid-fluid .row {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  display: block;\n  width: 100%;\n  margin: 0 auto;\n  *zoom: 1;\n}\n.grid-fixed .row:before,\n.grid-fluid .row:before,\n.grid-fixed .row:after,\n.grid-fluid .row:after {\n  content: \"\";\n  display: table;\n}\n.grid-fixed .row:after,\n.grid-fluid .row:after {\n  clear: both;\n}\n.grid-fixed .row .center,\n.grid-fluid .row .center,\n.grid-fixed .row .center:last-child,\n.grid-fluid .row .center:last-child {\n  float: none;\n  display: block;\n  margin: 0 auto;\n}\n.grid-fixed {\n  width: 940px;\n  /* This is duplicated in both classes. Unavoidable. */\n\n}\n.grid-fixed .col12 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 940px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col12:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col12:last-child {\n  float: right;\n}\n.grid-fixed .col11 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 860px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col11:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col11:last-child {\n  float: right;\n}\n.grid-fixed .col10 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 780px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col10:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col10:last-child {\n  float: right;\n}\n.grid-fixed .col9 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 700px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col9:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col9:last-child {\n  float: right;\n}\n.grid-fixed .col8 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 620px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col8:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col8:last-child {\n  float: right;\n}\n.grid-fixed .col7 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 540px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col7:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col7:last-child {\n  float: right;\n}\n.grid-fixed .col6 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 460px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col6:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col6:last-child {\n  float: right;\n}\n.grid-fixed .col5 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 380px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col5:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col5:last-child {\n  float: right;\n}\n.grid-fixed .col4 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 300px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col4:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col4:last-child {\n  float: right;\n}\n.grid-fixed .col3 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 220px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col3:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col3:last-child {\n  float: right;\n}\n.grid-fixed .col2 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 140px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col2:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col2:last-child {\n  float: right;\n}\n.grid-fixed .col1 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 60px;\n  margin-left: 20px;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fixed .col1:first-child {\n  margin-left: 0;\n}\n.grid-fixed .col1:last-child {\n  float: right;\n}\n.grid-fixed .offset11 {\n  margin-left: 900px;\n}\n.grid-fixed .offset10 {\n  margin-left: 820px;\n}\n.grid-fixed .offset9 {\n  margin-left: 740px;\n}\n.grid-fixed .offset8 {\n  margin-left: 660px;\n}\n.grid-fixed .offset7 {\n  margin-left: 580px;\n}\n.grid-fixed .offset6 {\n  margin-left: 500px;\n}\n.grid-fixed .offset5 {\n  margin-left: 420px;\n}\n.grid-fixed .offset4 {\n  margin-left: 340px;\n}\n.grid-fixed .offset3 {\n  margin-left: 260px;\n}\n.grid-fixed .offset2 {\n  margin-left: 180px;\n}\n.grid-fixed .offset1 {\n  margin-left: 100px;\n}\n.grid-fixed .push11 {\n  left: 880px;\n}\n.grid-fixed .push10 {\n  left: 800px;\n}\n.grid-fixed .push9 {\n  left: 720px;\n}\n.grid-fixed .push8 {\n  left: 640px;\n}\n.grid-fixed .push7 {\n  left: 560px;\n}\n.grid-fixed .push6 {\n  left: 480px;\n}\n.grid-fixed .push5 {\n  left: 400px;\n}\n.grid-fixed .push4 {\n  left: 320px;\n}\n.grid-fixed .push3 {\n  left: 240px;\n}\n.grid-fixed .push2 {\n  left: 160px;\n}\n.grid-fixed .push1 {\n  left: 80px;\n}\n.grid-fixed .pull11 {\n  right: 880px;\n}\n.grid-fixed .pull10 {\n  right: 800px;\n}\n.grid-fixed .pull9 {\n  right: 720px;\n}\n.grid-fixed .pull8 {\n  right: 640px;\n}\n.grid-fixed .pull7 {\n  right: 560px;\n}\n.grid-fixed .pull6 {\n  right: 480px;\n}\n.grid-fixed .pull5 {\n  right: 400px;\n}\n.grid-fixed .pull4 {\n  right: 320px;\n}\n.grid-fixed .pull3 {\n  right: 240px;\n}\n.grid-fixed .pull2 {\n  right: 160px;\n}\n.grid-fixed .pull1 {\n  right: 80px;\n}\n.grid-fluid {\n  width: 100%;\n  /* This is duplicated in both classes. Unavoidable. */\n\n}\n.grid-fluid .col12 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 100%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col12:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col12:last-child {\n  float: right;\n}\n.grid-fluid .col11 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 91.3%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col11:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col11:last-child {\n  float: right;\n}\n.grid-fluid .col10 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 82.6%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col10:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col10:last-child {\n  float: right;\n}\n.grid-fluid .col9 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 73.9%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col9:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col9:last-child {\n  float: right;\n}\n.grid-fluid .col8 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 65.2%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col8:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col8:last-child {\n  float: right;\n}\n.grid-fluid .col7 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 56.5%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col7:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col7:last-child {\n  float: right;\n}\n.grid-fluid .col6 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 47.8%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col6:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col6:last-child {\n  float: right;\n}\n.grid-fluid .col5 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 39.1%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col5:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col5:last-child {\n  float: right;\n}\n.grid-fluid .col4 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 30.4%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col4:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col4:last-child {\n  float: right;\n}\n.grid-fluid .col3 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 21.7%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col3:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col3:last-child {\n  float: right;\n}\n.grid-fluid .col2 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 13%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col2:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col2:last-child {\n  float: right;\n}\n.grid-fluid .col1 {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  width: 4.3%;\n  margin-left: 4.4%;\n  position: relative;\n  display: inline;\n  float: left;\n  min-height: 1px;\n}\n.grid-fluid .col1:first-child {\n  margin-left: 0;\n}\n.grid-fluid .col1:last-child {\n  float: right;\n}\n.grid-fluid .offset11 {\n  margin-left: 100.1%;\n}\n.grid-fluid .offset10 {\n  margin-left: 91.4%;\n}\n.grid-fluid .offset9 {\n  margin-left: 82.69999999999999%;\n}\n.grid-fluid .offset8 {\n  margin-left: 74%;\n}\n.grid-fluid .offset7 {\n  margin-left: 65.3%;\n}\n.grid-fluid .offset6 {\n  margin-left: 56.6%;\n}\n.grid-fluid .offset5 {\n  margin-left: 47.900000000000006%;\n}\n.grid-fluid .offset4 {\n  margin-left: 39.2%;\n}\n.grid-fluid .offset3 {\n  margin-left: 30.5%;\n}\n.grid-fluid .offset2 {\n  margin-left: 21.8%;\n}\n.grid-fluid .offset1 {\n  margin-left: 13.100000000000001%;\n}\n.grid-fluid .push11 {\n  left: 95.69999999999999%;\n}\n.grid-fluid .push10 {\n  left: 87%;\n}\n.grid-fluid .push9 {\n  left: 78.3%;\n}\n.grid-fluid .push8 {\n  left: 69.6%;\n}\n.grid-fluid .push7 {\n  left: 60.89999999999999%;\n}\n.grid-fluid .push6 {\n  left: 52.199999999999996%;\n}\n.grid-fluid .push5 {\n  left: 43.5%;\n}\n.grid-fluid .push4 {\n  left: 34.8%;\n}\n.grid-fluid .push3 {\n  left: 26.099999999999998%;\n}\n.grid-fluid .push2 {\n  left: 17.4%;\n}\n.grid-fluid .push1 {\n  left: 8.7%;\n}\n.grid-fluid .pull11 {\n  right: 95.69999999999999%;\n}\n.grid-fluid .pull10 {\n  right: 87%;\n}\n.grid-fluid .pull9 {\n  right: 78.3%;\n}\n.grid-fluid .pull8 {\n  right: 69.6%;\n}\n.grid-fluid .pull7 {\n  right: 60.89999999999999%;\n}\n.grid-fluid .pull6 {\n  right: 52.199999999999996%;\n}\n.grid-fluid .pull5 {\n  right: 43.5%;\n}\n.grid-fluid .pull4 {\n  right: 34.8%;\n}\n.grid-fluid .pull3 {\n  right: 26.099999999999998%;\n}\n.grid-fluid .pull2 {\n  right: 17.4%;\n}\n.grid-fluid .pull1 {\n  right: 8.7%;\n}\n@media all and (max-width: 480px) {\n  .grid-fixed .col12 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col11 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col10 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col9 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col8 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col7 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col6 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col5 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col4 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col3 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col2 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed .col1 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col12 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col11 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col10 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col9 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col8 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col7 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col6 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col5 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col4 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col3 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col2 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fluid .col1 {\n    width: 100%;\n    margin: 0;\n    left: 0;\n    right: 0;\n  }\n  .grid-fixed,\n  .grid-fluid {\n    width: 100%;\n  }\n  .grid-fixed .m-col4,\n  .grid-fluid .m-col4 {\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    width: 99.9998%;\n    margin-left: 6.6666%;\n    position: relative;\n    display: inline;\n    float: left;\n    min-height: 1px;\n  }\n  .grid-fixed .m-col4:first-child,\n  .grid-fluid .m-col4:first-child {\n    margin-left: 0;\n  }\n  .grid-fixed .m-col4:last-child,\n  .grid-fluid .m-col4:last-child {\n    float: right;\n  }\n  .grid-fixed .m-col3,\n  .grid-fluid .m-col3 {\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    width: 73.3332%;\n    margin-left: 6.6666%;\n    position: relative;\n    display: inline;\n    float: left;\n    min-height: 1px;\n  }\n  .grid-fixed .m-col3:first-child,\n  .grid-fluid .m-col3:first-child {\n    margin-left: 0;\n  }\n  .grid-fixed .m-col3:last-child,\n  .grid-fluid .m-col3:last-child {\n    float: right;\n  }\n  .grid-fixed .m-col2,\n  .grid-fluid .m-col2 {\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    width: 46.6666%;\n    margin-left: 6.6666%;\n    position: relative;\n    display: inline;\n    float: left;\n    min-height: 1px;\n  }\n  .grid-fixed .m-col2:first-child,\n  .grid-fluid .m-col2:first-child {\n    margin-left: 0;\n  }\n  .grid-fixed .m-col2:last-child,\n  .grid-fluid .m-col2:last-child {\n    float: right;\n  }\n  .grid-fixed .m-col1,\n  .grid-fluid .m-col1 {\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    width: 20%;\n    margin-left: 6.6666%;\n    position: relative;\n    display: inline;\n    float: left;\n    min-height: 1px;\n  }\n  .grid-fixed .m-col1:first-child,\n  .grid-fluid .m-col1:first-child {\n    margin-left: 0;\n  }\n  .grid-fixed .m-col1:last-child,\n  .grid-fluid .m-col1:last-child {\n    float: right;\n  }\n  .grid-fixed .m-offset3,\n  .grid-fluid .m-offset3 {\n    margin-left: 86.6664%;\n  }\n  .grid-fixed .m-offset2,\n  .grid-fluid .m-offset2 {\n    margin-left: 59.9998%;\n  }\n  .grid-fixed .m-offset1,\n  .grid-fluid .m-offset1 {\n    margin-left: 33.3332%;\n  }\n  .grid-fixed .m-push3,\n  .grid-fluid .m-push3 {\n    left: 79.9998%;\n  }\n  .grid-fixed .m-push2,\n  .grid-fluid .m-push2 {\n    left: 53.3332%;\n  }\n  .grid-fixed .m-push1,\n  .grid-fluid .m-push1 {\n    left: 26.6666%;\n  }\n  .grid-fixed .m-pull3,\n  .grid-fluid .m-pull3 {\n    right: 79.9998%;\n  }\n  .grid-fixed .m-pull2,\n  .grid-fluid .m-pull2 {\n    right: 53.3332%;\n  }\n  .grid-fixed .m-pull1,\n  .grid-fluid .m-pull1 {\n    right: 26.6666%;\n  }\n}\n/* Sizes */\n.btn-half {\n  height: 20px !important;\n  padding-bottom: 0 !important;\n  padding-top: 0 !important;\n  line-height: 18px;\n  font-size: 0.8em;\n}\n.btn-single {\n  height: 30px !important;\n  padding-bottom: 0 !important;\n  padding-top: 0 !important;\n  line-height: 27px;\n  font-size: 1em;\n}\n.btn-double {\n  height: 40px !important;\n  padding-bottom: 0 !important;\n  padding-top: 0 !important;\n  line-height: 36px;\n  font-size: 1.1em;\n}\n/* Shapes */\n/* Text */\n/* Color */\n/* Border */\n/* Minimal */\n/* Clean */\n/* Soft */\n/* Pill */\n/* Gloss */\n.btn-minimal {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background: #eeeeee;\n  border: 1px solid #c8c8c8;\n  -webkit-box-shadow: inset 0 0 1px 1px #ffffff;\n  -moz-box-shadow: inset 0 0 1px 1px #ffffff;\n  box-shadow: inset 0 0 1px 1px #ffffff;\n  color: #333;\n  text-shadow: 0 1px 0 #fff;\n}\n.btn-minimal:hover {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background: #e1e1e1;\n  border: 1px solid #bbbbbb;\n  -webkit-box-shadow: inset 0 0 1px 1px #ffffff;\n  -moz-box-shadow: inset 0 0 1px 1px #ffffff;\n  box-shadow: inset 0 0 1px 1px #ffffff;\n  color: #333;\n  text-shadow: 0 1px 0 #fff;\n  text-decoration: none;\n}\n.btn-minimal:active {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background: #d4d4d4;\n  border: 1px solid #aeaeae;\n  -webkit-box-shadow: inset 0 0 1px 1px #fbfbfb;\n  -moz-box-shadow: inset 0 0 1px 1px #fbfbfb;\n  box-shadow: inset 0 0 1px 1px #fbfbfb;\n  color: #333;\n  text-shadow: 0 1px 0 #fff;\n  text-decoration: none;\n}\n.btn-clean {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #eeeeee;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100% #d5d5d5));\n  background-image: -webkit-linear-gradient(top, #ffffff 0%, #d5d5d5 100%);\n  background-image: -moz-linear-gradient(top, #ffffff 0%, #d5d5d5 100%);\n  background-image: -ms-linear-gradient(top, #ffffff 0%, #d5d5d5 100%);\n  background-image: -o-linear-gradient(top, #ffffff 0%, #d5d5d5 100%);\n  background-image: linear-gradient(top, #ffffff 0%, #d5d5d5 100%);\n  border: 1px solid #c8c8c8;\n  color: #333;\n  text-shadow: 0 1px 0 #fff;\n}\n.btn-clean:hover {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #e1e1e1;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fbfbfb), color-stop(100% #c8c8c8));\n  background-image: -webkit-linear-gradient(top, #fbfbfb 0%, #c8c8c8 100%);\n  background-image: -moz-linear-gradient(top, #fbfbfb 0%, #c8c8c8 100%);\n  background-image: -ms-linear-gradient(top, #fbfbfb 0%, #c8c8c8 100%);\n  background-image: -o-linear-gradient(top, #fbfbfb 0%, #c8c8c8 100%);\n  background-image: linear-gradient(top, #fbfbfb 0%, #c8c8c8 100%);\n  border: 1px solid #bbbbbb;\n  color: #333;\n  text-shadow: 0 1px 0 #fff;\n  text-decoration: none;\n}\n.btn-clean:active {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #d4d4d4;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(100% #bbbbbb));\n  background-image: -webkit-linear-gradient(top, #eeeeee 0%, #bbbbbb 100%);\n  background-image: -moz-linear-gradient(top, #eeeeee 0%, #bbbbbb 100%);\n  background-image: -ms-linear-gradient(top, #eeeeee 0%, #bbbbbb 100%);\n  background-image: -o-linear-gradient(top, #eeeeee 0%, #bbbbbb 100%);\n  background-image: linear-gradient(top, #eeeeee 0%, #bbbbbb 100%);\n  border: 1px solid #aeaeae;\n  color: #333;\n  text-shadow: 0 1px 0 #fff;\n  text-decoration: none;\n}\n.btn-soft {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #6c84ab;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7c92b4), color-stop(100% #5c77a1));\n  background-image: -webkit-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -moz-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -ms-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -o-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  border: 1px solid #405371;\n  -webkit-box-shadow: inset 0 2px 1px -1px #9dadc7;\n  -moz-box-shadow: inset 0 2px 1px -1px #9dadc7;\n  box-shadow: inset 0 2px 1px -1px #9dadc7;\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n}\n.btn-soft:hover {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #5c77a1;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #6c84ab), color-stop(100% #536b91));\n  background-image: -webkit-linear-gradient(top, #6c84ab 0%, #536b91 100%);\n  background-image: -moz-linear-gradient(top, #6c84ab 0%, #536b91 100%);\n  background-image: -ms-linear-gradient(top, #6c84ab 0%, #536b91 100%);\n  background-image: -o-linear-gradient(top, #6c84ab 0%, #536b91 100%);\n  background-image: linear-gradient(top, #6c84ab 0%, #536b91 100%);\n  border: 1px solid #374760;\n  -webkit-box-shadow: inset 0 2px 1px -1px #8c9fbe;\n  -moz-box-shadow: inset 0 2px 1px -1px #8c9fbe;\n  box-shadow: inset 0 2px 1px -1px #8c9fbe;\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n  text-decoration: none;\n}\n.btn-soft:active {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #536b91;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5c77a1), color-stop(100% #4a5f81));\n  background-image: -webkit-linear-gradient(top, #5c77a1 0%, #4a5f81 100%);\n  background-image: -moz-linear-gradient(top, #5c77a1 0%, #4a5f81 100%);\n  background-image: -ms-linear-gradient(top, #5c77a1 0%, #4a5f81 100%);\n  background-image: -o-linear-gradient(top, #5c77a1 0%, #4a5f81 100%);\n  background-image: linear-gradient(top, #5c77a1 0%, #4a5f81 100%);\n  border: 1px solid #2e3b50;\n  -webkit-box-shadow: inset 0 2px 1px -1px #7c92b4;\n  -moz-box-shadow: inset 0 2px 1px -1px #7c92b4;\n  box-shadow: inset 0 2px 1px -1px #7c92b4;\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n  text-decoration: none;\n}\n.btn-pill {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 20px;\n  -moz-border-radius: 20px;\n  border-radius: 20px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #6c84ab;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7c92b4), color-stop(100% #5c77a1));\n  background-image: -webkit-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -moz-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -ms-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -o-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  border: 1px solid #405371;\n  -webkit-box-shadow: inset 0 2px 1px -1px #9dadc7;\n  -moz-box-shadow: inset 0 2px 1px -1px #9dadc7;\n  box-shadow: inset 0 2px 1px -1px #9dadc7;\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n}\n.btn-pill:hover {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 20px;\n  -moz-border-radius: 20px;\n  border-radius: 20px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #5c77a1;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #6c84ab), color-stop(100% #536b91));\n  background-image: -webkit-linear-gradient(top, #6c84ab 0%, #536b91 100%);\n  background-image: -moz-linear-gradient(top, #6c84ab 0%, #536b91 100%);\n  background-image: -ms-linear-gradient(top, #6c84ab 0%, #536b91 100%);\n  background-image: -o-linear-gradient(top, #6c84ab 0%, #536b91 100%);\n  background-image: linear-gradient(top, #6c84ab 0%, #536b91 100%);\n  border: 1px solid #374760;\n  -webkit-box-shadow: inset 0 2px 1px -1px #8c9fbe;\n  -moz-box-shadow: inset 0 2px 1px -1px #8c9fbe;\n  box-shadow: inset 0 2px 1px -1px #8c9fbe;\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n  text-decoration: none;\n}\n.btn-pill:active {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 20px;\n  -moz-border-radius: 20px;\n  border-radius: 20px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #536b91;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5c77a1), color-stop(100% #4a5f81));\n  background-image: -webkit-linear-gradient(top, #5c77a1 0%, #4a5f81 100%);\n  background-image: -moz-linear-gradient(top, #5c77a1 0%, #4a5f81 100%);\n  background-image: -ms-linear-gradient(top, #5c77a1 0%, #4a5f81 100%);\n  background-image: -o-linear-gradient(top, #5c77a1 0%, #4a5f81 100%);\n  background-image: linear-gradient(top, #5c77a1 0%, #4a5f81 100%);\n  border: 1px solid #2e3b50;\n  -webkit-box-shadow: inset 0 2px 1px -1px #7c92b4;\n  -moz-box-shadow: inset 0 2px 1px -1px #7c92b4;\n  box-shadow: inset 0 2px 1px -1px #7c92b4;\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n  text-decoration: none;\n}\n.btn-gloss {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 5px;\n  -moz-border-radius: 5px;\n  border-radius: 5px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #172d6e;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #8195d0), color-stop(50% #586793), color-stop(50% #3b4c7d), color-stop(100% #44568e));\n  background-image: -webkit-linear-gradient(top, #8195d0 0%, #586793 50%, #3b4c7d 50%, #44568e 100%);\n  background-image: -moz-linear-gradient(top, #8195d0 0%, #586793 50%, #3b4c7d 50%, #44568e 100%);\n  background-image: -ms-linear-gradient(top, #8195d0 0%, #586793 50%, #3b4c7d 50%, #44568e 100%);\n  background-image: -o-linear-gradient(top, #8195d0 0%, #586793 50%, #3b4c7d 50%, #44568e 100%);\n  background-image: linear-gradient(top, #8195d0 0%, #586793 50%, #3b4c7d 50%, #44568e 100%);\n  border: 1px solid #0a132f;\n  -webkit-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  -moz-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n}\n.btn-gloss:hover {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 5px;\n  -moz-border-radius: 5px;\n  border-radius: 5px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #132459;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #6f85c9), color-stop(50% #4e5c83), color-stop(50% #33416b), color-stop(100% #3b4c7d));\n  background-image: -webkit-linear-gradient(top, #6f85c9 0%, #4e5c83 50%, #33416b 50%, #3b4c7d 100%);\n  background-image: -moz-linear-gradient(top, #6f85c9 0%, #4e5c83 50%, #33416b 50%, #3b4c7d 100%);\n  background-image: -ms-linear-gradient(top, #6f85c9 0%, #4e5c83 50%, #33416b 50%, #3b4c7d 100%);\n  background-image: -o-linear-gradient(top, #6f85c9 0%, #4e5c83 50%, #33416b 50%, #3b4c7d 100%);\n  background-image: linear-gradient(top, #6f85c9 0%, #4e5c83 50%, #33416b 50%, #3b4c7d 100%);\n  border: 1px solid #050a1a;\n  -webkit-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  -moz-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n  -webkit-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3);\n  -moz-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3);\n  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3);\n  text-decoration: none;\n}\n.btn-gloss:active {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 5px;\n  -moz-border-radius: 5px;\n  border-radius: 5px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #0e1c44;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5c76c2), color-stop(50% #455073), color-stop(50% #2b375a), color-stop(100% #33416b));\n  background-image: -webkit-linear-gradient(top, #5c76c2 0%, #455073 50%, #2b375a 50%, #33416b 100%);\n  background-image: -moz-linear-gradient(top, #5c76c2 0%, #455073 50%, #2b375a 50%, #33416b 100%);\n  background-image: -ms-linear-gradient(top, #5c76c2 0%, #455073 50%, #2b375a 50%, #33416b 100%);\n  background-image: -o-linear-gradient(top, #5c76c2 0%, #455073 50%, #2b375a 50%, #33416b 100%);\n  background-image: linear-gradient(top, #5c76c2 0%, #455073 50%, #2b375a 50%, #33416b 100%);\n  border: 1px solid #010205;\n  -webkit-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  -moz-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n  -webkit-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3);\n  -moz-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3);\n  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3);\n  text-decoration: none;\n  -webkit-box-shadow: inset 0 0 5px 0 rgba(0, 0, 0, 0.3);\n  -moz-box-shadow: inset 0 0 5px 0 rgba(0, 0, 0, 0.3);\n  box-shadow: inset 0 0 5px 0 rgba(0, 0, 0, 0.3);\n}\n.bar-minimal {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background: #eeeeee;\n  border: 1px solid #c8c8c8;\n  -webkit-box-shadow: inset 0 0 1px 1px #ffffff;\n  -moz-box-shadow: inset 0 0 1px 1px #ffffff;\n  box-shadow: inset 0 0 1px 1px #ffffff;\n  color: #333;\n  text-shadow: 0 1px 0 #fff;\n  display: block;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n}\n.bar-clean {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #eeeeee;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100% #d5d5d5));\n  background-image: -webkit-linear-gradient(top, #ffffff 0%, #d5d5d5 100%);\n  background-image: -moz-linear-gradient(top, #ffffff 0%, #d5d5d5 100%);\n  background-image: -ms-linear-gradient(top, #ffffff 0%, #d5d5d5 100%);\n  background-image: -o-linear-gradient(top, #ffffff 0%, #d5d5d5 100%);\n  background-image: linear-gradient(top, #ffffff 0%, #d5d5d5 100%);\n  border: 1px solid #c8c8c8;\n  color: #333;\n  text-shadow: 0 1px 0 #fff;\n  display: block;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n}\n.bar-soft {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #6c84ab;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7c92b4), color-stop(100% #5c77a1));\n  background-image: -webkit-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -moz-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -ms-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -o-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  border: 1px solid #405371;\n  -webkit-box-shadow: inset 0 2px 1px -1px #9dadc7;\n  -moz-box-shadow: inset 0 2px 1px -1px #9dadc7;\n  box-shadow: inset 0 2px 1px -1px #9dadc7;\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n  display: block;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n}\n.bar-pill {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 20px;\n  -moz-border-radius: 20px;\n  border-radius: 20px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #6c84ab;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7c92b4), color-stop(100% #5c77a1));\n  background-image: -webkit-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -moz-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -ms-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: -o-linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  background-image: linear-gradient(top, #7c92b4 0%, #5c77a1 100%);\n  border: 1px solid #405371;\n  -webkit-box-shadow: inset 0 2px 1px -1px #9dadc7;\n  -moz-box-shadow: inset 0 2px 1px -1px #9dadc7;\n  box-shadow: inset 0 2px 1px -1px #9dadc7;\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n  display: block;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n}\n.bar-gloss {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  cursor: pointer;\n  display: inline-block;\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n  -webkit-border-radius: 5px;\n  -moz-border-radius: 5px;\n  border-radius: 5px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  background-color: #172d6e;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #8195d0), color-stop(50% #586793), color-stop(50% #3b4c7d), color-stop(100% #44568e));\n  background-image: -webkit-linear-gradient(top, #8195d0 0%, #586793 50%, #3b4c7d 50%, #44568e 100%);\n  background-image: -moz-linear-gradient(top, #8195d0 0%, #586793 50%, #3b4c7d 50%, #44568e 100%);\n  background-image: -ms-linear-gradient(top, #8195d0 0%, #586793 50%, #3b4c7d 50%, #44568e 100%);\n  background-image: -o-linear-gradient(top, #8195d0 0%, #586793 50%, #3b4c7d 50%, #44568e 100%);\n  background-image: linear-gradient(top, #8195d0 0%, #586793 50%, #3b4c7d 50%, #44568e 100%);\n  border: 1px solid #0a132f;\n  -webkit-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  -moz-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);\n  color: #fff;\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);\n  display: block;\n  padding-top: 10px !important;\n  padding-right: 10px !important;\n  padding-bottom: 10px !important;\n  padding-left: 10px !important;\n  text-align: center;\n  font-weight: bold;\n}\n/* ==========================================================================\n   Settings\n   ========================================================================== */\n/* ==========================================================================\n   Spacing\n   ========================================================================== */\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n/* ==========================================================================\n   Grid\n   ========================================================================== */\n/* ==========================================================================\n   Buttons\n   ========================================================================== */\n/* ==========================================================================\n   Site Variables\n   ========================================================================== */\n/* ==========================================================================\n   Spacing\n   ========================================================================== */\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n/* ==========================================================================\n   Grid\n   ========================================================================== */\n/* ==========================================================================\n   Buttons\n   ========================================================================== */\n/*\n@baseline: @baseline;\n@button-color: @button-color;\n@button-primary-color: @button-primary-color;\n@button-info-color: @button-info-color;\n@button-success-color: @button-success-color;\n@button-warning-color: @button-warning-color;\n@button-danger-color: @button-danger-color;\n*/\n/* ==========================================================================\n   Default\n   ========================================================================== */\n.btn {\n  height: 30px;\n  font-size: 15px;\n  line-height: 30px;\n  background-clip: border-box !important;\n  background-repeat: repeat-x;\n  border: 1px solid rgba(0, 0, 0, 0.25);\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);\n  cursor: pointer;\n  display: inline-block;\n  background-color: #dddddd;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f7f7f7), color-stop(100% #dddddd));\n  background-image: -webkit-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -moz-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -ms-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -o-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  padding-top: 0px !important;\n  padding-bottom: 0px !important;\n  -webkit-transition: background-position linear 0.1s;\n  -moz-transition: background-position linear 0.1s;\n  -o-transition: background-position linear 0.1s;\n  transition: background-position linear 0.1s;\n  vertical-align: middle;\n  color: #333;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  text-decoration: none !important;\n  text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;\n}\n.btn:hover {\n  background-position: 0 -15px;\n}\n/* ==========================================================================\n   Styles\n   ========================================================================== */\n.btn-primary,\n.btn-info,\n.btn-success,\n.btn-warning,\n.btn-danger {\n  color: #FFF !important;\n  text-shadow: rgba(0, 0, 0, 0.25) 0 -1px 0 !important;\n}\n.btn-primary {\n  height: 30px;\n  font-size: 15px;\n  line-height: 30px;\n  background-clip: border-box !important;\n  background-repeat: repeat-x;\n  border: 1px solid rgba(0, 0, 0, 0.25);\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);\n  cursor: pointer;\n  display: inline-block;\n  background-color: #dddddd;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f7f7f7), color-stop(100% #dddddd));\n  background-image: -webkit-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -moz-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -ms-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -o-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  padding-top: 0px !important;\n  padding-bottom: 0px !important;\n  -webkit-transition: background-position linear 0.1s;\n  -moz-transition: background-position linear 0.1s;\n  -o-transition: background-position linear 0.1s;\n  transition: background-position linear 0.1s;\n  vertical-align: middle;\n  color: #333;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  text-decoration: none !important;\n  text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;\n  background-color: #0055cc;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #006aff), color-stop(100% #0055cc));\n  background-image: -webkit-linear-gradient(top, #006aff 0%, #0055cc 100%);\n  background-image: -moz-linear-gradient(top, #006aff 0%, #0055cc 100%);\n  background-image: -ms-linear-gradient(top, #006aff 0%, #0055cc 100%);\n  background-image: -o-linear-gradient(top, #006aff 0%, #0055cc 100%);\n  background-image: linear-gradient(top, #006aff 0%, #0055cc 100%);\n}\n.btn-primary:hover {\n  background-position: 0 -15px;\n}\n.btn-info {\n  height: 30px;\n  font-size: 15px;\n  line-height: 30px;\n  background-clip: border-box !important;\n  background-repeat: repeat-x;\n  border: 1px solid rgba(0, 0, 0, 0.25);\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);\n  cursor: pointer;\n  display: inline-block;\n  background-color: #dddddd;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f7f7f7), color-stop(100% #dddddd));\n  background-image: -webkit-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -moz-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -ms-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -o-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  padding-top: 0px !important;\n  padding-bottom: 0px !important;\n  -webkit-transition: background-position linear 0.1s;\n  -moz-transition: background-position linear 0.1s;\n  -o-transition: background-position linear 0.1s;\n  transition: background-position linear 0.1s;\n  vertical-align: middle;\n  color: #333;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  text-decoration: none !important;\n  text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;\n  background-color: #2f96b4;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #47b0cf), color-stop(100% #2f96b4));\n  background-image: -webkit-linear-gradient(top, #47b0cf 0%, #2f96b4 100%);\n  background-image: -moz-linear-gradient(top, #47b0cf 0%, #2f96b4 100%);\n  background-image: -ms-linear-gradient(top, #47b0cf 0%, #2f96b4 100%);\n  background-image: -o-linear-gradient(top, #47b0cf 0%, #2f96b4 100%);\n  background-image: linear-gradient(top, #47b0cf 0%, #2f96b4 100%);\n}\n.btn-info:hover {\n  background-position: 0 -15px;\n}\n.btn-success {\n  height: 30px;\n  font-size: 15px;\n  line-height: 30px;\n  background-clip: border-box !important;\n  background-repeat: repeat-x;\n  border: 1px solid rgba(0, 0, 0, 0.25);\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);\n  cursor: pointer;\n  display: inline-block;\n  background-color: #dddddd;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f7f7f7), color-stop(100% #dddddd));\n  background-image: -webkit-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -moz-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -ms-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -o-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  padding-top: 0px !important;\n  padding-bottom: 0px !important;\n  -webkit-transition: background-position linear 0.1s;\n  -moz-transition: background-position linear 0.1s;\n  -o-transition: background-position linear 0.1s;\n  transition: background-position linear 0.1s;\n  vertical-align: middle;\n  color: #333;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  text-decoration: none !important;\n  text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;\n  background-color: #51a351;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #6fb86f), color-stop(100% #51a351));\n  background-image: -webkit-linear-gradient(top, #6fb86f 0%, #51a351 100%);\n  background-image: -moz-linear-gradient(top, #6fb86f 0%, #51a351 100%);\n  background-image: -ms-linear-gradient(top, #6fb86f 0%, #51a351 100%);\n  background-image: -o-linear-gradient(top, #6fb86f 0%, #51a351 100%);\n  background-image: linear-gradient(top, #6fb86f 0%, #51a351 100%);\n}\n.btn-success:hover {\n  background-position: 0 -15px;\n}\n.btn-warning {\n  height: 30px;\n  font-size: 15px;\n  line-height: 30px;\n  background-clip: border-box !important;\n  background-repeat: repeat-x;\n  border: 1px solid rgba(0, 0, 0, 0.25);\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);\n  cursor: pointer;\n  display: inline-block;\n  background-color: #dddddd;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f7f7f7), color-stop(100% #dddddd));\n  background-image: -webkit-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -moz-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -ms-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -o-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  padding-top: 0px !important;\n  padding-bottom: 0px !important;\n  -webkit-transition: background-position linear 0.1s;\n  -moz-transition: background-position linear 0.1s;\n  -o-transition: background-position linear 0.1s;\n  transition: background-position linear 0.1s;\n  vertical-align: middle;\n  color: #333;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  text-decoration: none !important;\n  text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;\n  background-color: #faa732;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fbbc64), color-stop(100% #faa732));\n  background-image: -webkit-linear-gradient(top, #fbbc64 0%, #faa732 100%);\n  background-image: -moz-linear-gradient(top, #fbbc64 0%, #faa732 100%);\n  background-image: -ms-linear-gradient(top, #fbbc64 0%, #faa732 100%);\n  background-image: -o-linear-gradient(top, #fbbc64 0%, #faa732 100%);\n  background-image: linear-gradient(top, #fbbc64 0%, #faa732 100%);\n}\n.btn-warning:hover {\n  background-position: 0 -15px;\n}\n.btn-danger {\n  height: 30px;\n  font-size: 15px;\n  line-height: 30px;\n  background-clip: border-box !important;\n  background-repeat: repeat-x;\n  border: 1px solid rgba(0, 0, 0, 0.25);\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  -webkit-border-radius: 4px;\n  -moz-border-radius: 4px;\n  border-radius: 4px;\n  -webkit-background-clip: padding-box;\n  -moz-background-clip: padding;\n  background-clip: padding-box;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);\n  cursor: pointer;\n  display: inline-block;\n  background-color: #dddddd;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f7f7f7), color-stop(100% #dddddd));\n  background-image: -webkit-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -moz-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -ms-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: -o-linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  background-image: linear-gradient(top, #f7f7f7 0%, #dddddd 100%);\n  padding-right: 10px !important;\n  padding-left: 10px !important;\n  padding-top: 0px !important;\n  padding-bottom: 0px !important;\n  -webkit-transition: background-position linear 0.1s;\n  -moz-transition: background-position linear 0.1s;\n  -o-transition: background-position linear 0.1s;\n  transition: background-position linear 0.1s;\n  vertical-align: middle;\n  color: #333;\n  font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n  text-decoration: none !important;\n  text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;\n  background-color: #bd362f;\n  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #d3534c), color-stop(100% #bd362f));\n  background-image: -webkit-linear-gradient(top, #d3534c 0%, #bd362f 100%);\n  background-image: -moz-linear-gradient(top, #d3534c 0%, #bd362f 100%);\n  background-image: -ms-linear-gradient(top, #d3534c 0%, #bd362f 100%);\n  background-image: -o-linear-gradient(top, #d3534c 0%, #bd362f 100%);\n  background-image: linear-gradient(top, #d3534c 0%, #bd362f 100%);\n}\n.btn-danger:hover {\n  background-position: 0 -15px;\n}\n/* ==========================================================================\n   Sizes (Half = h, Single = s, Double = d)\n   ========================================================================== */\n.btn-h,\n.btn-half {\n  height: 20px;\n  font-size: 12px;\n  line-height: 20px;\n}\n.btn-s,\n.btn-single {\n  height: 30px;\n  font-size: 15px;\n  line-height: 30px;\n}\n.btn-d,\n.btn-double {\n  height: 40px;\n  font-size: 20px;\n  line-height: 40px;\n}\n/* Import site-specific styles */\n.site-header {\n  position: relative;\n  z-index: 1;\n  text-align: center;\n}\n.site-title {\n  margin-bottom: 0px !important;\n  font-family: 'Alfa Slab One';\n  font-size: 80px;\n  font-weight: normal !important;\n  line-height: 100px !important;\n}\n.site-title a {\n  text-decoration: none;\n}\n.site-slogan {\n  font-weight: normal;\n}\n.fork-me,\n.fork-me img {\n  position: absolute;\n  top: 0;\n  right: 0;\n}\n.fork-me {\n  z-index: 2;\n}\n.interior-site-header {\n  background: #EEE;\n  -webkit-box-shadow: inset rgba(0, 0, 0, 0.07) 0 0 40px;\n  -moz-box-shadow: inset rgba(0, 0, 0, 0.07) 0 0 40px;\n  box-shadow: inset rgba(0, 0, 0, 0.07) 0 0 40px;\n  padding-top: 20px !important;\n  padding-right: 20px !important;\n  padding-bottom: 20px !important;\n  padding-left: 20px !important;\n  text-align: center;\n}\n.interior-site-header .site-title {\n  font-size: 40px;\n  line-height: 40px !important;\n}\n.interior-site-header .site-slogan {\n  margin-bottom: 20px !important;\n}\n.site-navigation {\n  background: #EEE;\n  -webkit-box-shadow: inset rgba(0, 0, 0, 0.07) 0 0 40px;\n  -moz-box-shadow: inset rgba(0, 0, 0, 0.07) 0 0 40px;\n  box-shadow: inset rgba(0, 0, 0, 0.07) 0 0 40px;\n  padding-top: 20px !important;\n  padding-right: 20px !important;\n  padding-bottom: 20px !important;\n  padding-left: 20px !important;\n  position: fixed;\n  top: 0;\n  bottom: 0;\n  overflow: auto;\n  width: 240px;\n}\n.build-date {\n  margin-bottom: 20px !important;\n  color: #AAA;\n  font-family: Helvetica, Arial, sans-serif;\n  font-size: 11px;\n}\n.site-navigation ul {\n  margin-top: 0px !important;\n  margin-right: 0px !important;\n  margin-bottom: 0px !important;\n  margin-left: 0px !important;\n  padding-top: 0px !important;\n  padding-right: 0px !important;\n  padding-bottom: 0px !important;\n  padding-left: 0px !important;\n  list-style: none;\n  margin: 0;\n  padding: 0;\n  font-size: 16px;\n}\n.site-navigation > ul > li {\n  margin-bottom: 10px;\n}\n.site-navigation a {\n  text-decoration: underline;\n}\n.site-navigation a:hover {\n  text-decoration: none;\n}\n.site-navigation a.active {\n  background-color: #ff9;\n}\n.site-navigation ul ul {\n  margin-left: 20px !important;\n  padding-top: 10px !important;\n  font-size: 12px;\n}\n.site-navigation ul ul a {\n  text-decoration: none;\n}\n.site-content {\n  padding: 20px 40px 40px 320px;\n}\n.site-content h1 {\n  clear: both;\n}\n.interior-site-content {\n  padding-top: 40px !important;\n  padding-right: 40px !important;\n  padding-bottom: 40px !important;\n  padding-left: 40px !important;\n}\n.top {\n  background: #333;\n  display: inline-block;\n  float: right;\n  margin-right: -40px;\n  padding: 4px 8px;\n  color: #FFF;\n  font-size: 12px;\n  text-decoration: none !important;\n}\n.site-footer {\n  clear: both;\n  padding-top: 40px !important;\n  font-size: 13px;\n  text-align: center;\n}\n.site-footer img {\n  margin-left: 2px;\n  position: relative;\n  top: -2px;\n  vertical-align: middle;\n}\n.site-footer ul {\n  list-style: none;\n  margin-right: 0px !important;\n  margin-left: 0px !important;\n  padding-right: 0px !important;\n  padding-left: 0px !important;\n}\n/* Tablets and Smartphones */\n@media only screen and (max-width: 1024px) {\n  .build-date {\n    text-align: center;\n  }\n  .site-header {\n    height: 220px;\n    position: absolute;\n    top: 20px;\n    left: 0;\n    width: 100%;\n  }\n  .fork-me img {\n    height: 110px;\n    width: 110px;\n  }\n  .site-navigation {\n    margin-top: 240px;\n    padding: 20px;\n    position: relative;\n    width: auto;\n  }\n  .site-navigation ul {\n    border: 1px solid #999;\n    border-bottom: none;\n  }\n  .site-navigation li {\n    margin-top: 0px !important;\n    margin-right: 0px !important;\n    margin-bottom: 0px !important;\n    margin-left: 0px !important;\n    padding-top: 0px !important;\n    padding-right: 0px !important;\n    padding-bottom: 0px !important;\n    padding-left: 0px !important;\n  }\n  .site-navigation a {\n    background: #CCC;\n    display: block;\n    border-bottom: 1px solid #999;\n    padding: 10px;\n    text-decoration: none;\n  }\n  .site-navigation ul ul {\n    border: none;\n    margin-top: 0px !important;\n    margin-right: 0px !important;\n    margin-bottom: 0px !important;\n    margin-left: 0px !important;\n    padding-top: 0px !important;\n    padding-right: 0px !important;\n    padding-bottom: 0px !important;\n    padding-left: 0px !important;\n  }\n  .site-navigation ul ul a {\n    background: transparent;\n  }\n  .site-content {\n    padding: 20px;\n  }\n  .top {\n    display: inline-block;\n    float: none;\n  }\n}\n"
  },
  {
    "path": "styles/all.less",
    "content": "/* ==========================================================================\n   NMC Bootstrap\n\n   This LESS file imports all other LESS files. You should compile\n   and minify this file before site launch.\n   ========================================================================== */\n\n/* Import NMC bootstrap */\n\n@import \"base/all\";\n\n/* Import site-specific styles */\n\n@import \"site/site-header.less\";\n@import \"site/site-navigation.less\";\n@import \"site/site-content.less\";\n@import \"site/site-footer.less\";\n\n/* Tablets and Smartphones */\n\n@media only screen and (max-width : 1024px) {\n    .build-date{\n        text-align: center;\n    }\n    .site-header{\n        height: 220px;\n        position: absolute;\n        top: 20px;\n        left: 0;\n        width: 100%;\n    }\n    .fork-me img{\n        height: 110px;\n        width: 110px;\n    }\n    .site-navigation{\n        margin-top: 240px;\n        padding: 20px;\n        position: relative;\n        width: auto;\n\n        ul{\n            border: 1px solid #999;\n            border-bottom: none;\n        }\n        li{\n            .man;\n            .pan;\n        }\n        a{\n            background: #CCC;\n            display: block;\n            border-bottom: 1px solid #999;\n            padding: 10px;\n            text-decoration: none;\n        }\n        ul ul{\n            border: none;\n            .man;\n            .pan;\n        }\n        ul ul a{\n            background: transparent;\n        }\n    }\n    .site-content{\n        padding: 20px;\n    }\n    .top{\n        display: inline-block;\n        float: none;\n    }\n}\n"
  },
  {
    "path": "styles/base/all.less",
    "content": "@import \"reset\";\n@import \"prefixer\";\n@import \"spacing\";\n@import \"typography\";\n@import \"idioms\";\n@import \"grid\";\n@import \"bars-buttons\";\n@import \"buttons\";"
  },
  {
    "path": "styles/base/bars-buttons.less",
    "content": ".button() {\n    .border-box;\n    cursor: pointer;\n    display: inline-block;\n    .phh;\n    text-align: center;\n    font-weight: bold;\n}\n.button-hover(){\n    text-decoration: none;\n}\n.bar() {\n    display: block;\n    .pah;\n    text-align: center;\n    font-weight: bold;\n}\n\n/* Sizes */\n\n.btn-size(@scale){\n    height: @baseline * @scale !important;\n    padding-bottom: 0 !important;\n    padding-top: 0 !important;\n    line-height: @baseline * (@scale * 0.9);\n}\n.btn-half{\n    .btn-size(1);\n    font-size: 0.8em;\n}\n.btn-single{\n    .btn-size(1.5);\n    font-size: 1em;\n}\n.btn-double{\n    .btn-size(2);\n    font-size: 1.1em;\n}\n\n/* Shapes */\n\n.bb-shape-square() {\n    .border-radius(0);\n}\n.bb-shape-rounded(@rad:3px) {\n    .border-radius(@rad);\n}\n.bb-shape-round() {\n    .border-radius(@baseline);\n}\n\n/* Text */\n\n.bb-text-dark(){\n    color: #333;\n    text-shadow: 0 1px 0 #fff;\n}\n.bb-text-light(){\n    color: #fff;\n    text-shadow: 0 -1px 0 rgba(0,0,0,.3);\n}\n.bb-text-color(@color){\n\n}\n\n/* Color */\n\n.bb-color-plain(@color){\n    background: @color;\n}\n.bb-color-gradient(@color){\n    .gradient(@color,lighten(@color,10%),darken(@color,10%));\n}\n.bb-color-soft(@color){\n    .gradient(@color,lighten(@color,5%),darken(@color,5%));\n}\n.bb-color-gloss(@color){\n    @topStart: desaturate(lighten(@color,40%),20%);\n    @topStop: desaturate(lighten(@color,20%),40%);\n    @bottomStart: desaturate(lighten(@color,10%),30%);\n    @bottomStop: desaturate(lighten(@color,15%),30%);\n    .linear-gradient-top(@color,@topStart,0%,@topStop,50%,@bottomStart,50%,@bottomStop,100%);\n}\n\n/* Border */\n\n.bb-border-noborder(){\n    border: none;\n}\n.bb-border-plain(@color){\n    border: 1px solid darken(@color,10%);\n}\n.bb-border-contrast(@color){\n    border: 1px solid darken(@color,15%);\n    .box-shadow(inset 0 0 1px 1px lighten(@color,15%));\n}\n.bb-border-meta(@color){\n    border: 1px solid darken(@color,15%);\n    .box-shadow(inset 0 2px 1px -1px lighten(@color,20%));\n}\n\n/* Minimal */\n\n.button-minimal(@color) {\n    .button();\n    .bb-shape-rounded();\n    .bb-color-plain(@color);\n    .bb-border-contrast(@color);\n    .bb-text-dark();\n}\n.button-minimal-hover(@color){\n    .button-minimal(darken(@color,5%));\n    .button-hover();\n}\n.button-minimal-active(@color){\n    .button-minimal-hover(darken(@color,5%));\n}\n.bar-minimal(@color) {\n    .button-minimal(@color);\n    .bar();\n}\n\n/* Clean */\n\n.button-clean(@color) {\n    .button();\n    .bb-shape-rounded();\n    .bb-color-gradient(@color);\n    .bb-border-plain(darken(@color,5%));\n    .bb-text-dark();\n}\n.button-clean-hover(@color){\n    .button-clean(darken(@color,5%));\n    .button-hover();\n}\n.button-clean-active(@color){\n    .button-clean-hover(darken(@color,5%));\n}\n.bar-clean(@color){\n    .button-clean(@color);\n    .bar();\n}\n\n/* Soft */\n\n.button-soft(@color) {\n    .button();\n    .bb-shape-rounded();\n    .bb-color-soft(@color);\n    .bb-border-meta(darken(@color,5%));\n    .bb-text-light();\n}\n.button-soft-hover(@color){\n    .button-soft(darken(@color,5%));\n    .button-hover();\n}\n.button-soft-active(@color){\n    .button-soft-hover(darken(@color,5%));\n}\n.bar-soft(@color){\n    .button-soft(@color);\n    .bar();\n}\n\n/* Pill */\n\n.button-pill(@color) {\n    .button();\n    .bb-shape-round();\n    .bb-color-soft(@color);\n    .bb-border-meta(darken(@color,5%));\n    .bb-text-light();\n}\n.button-pill-hover(@color){\n    .button-pill(darken(@color,5%));\n    .button-hover();\n}\n.button-pill-active(@color){\n    .button-pill-hover(darken(@color,5%));\n}\n.bar-pill(@color){\n    .button-pill(@color);\n    .bar();\n}\n\n/* Gloss */\n\n.button-gloss(@color) {\n    .button();\n    .bb-shape-rounded(5px);\n    .bb-color-gloss(@color);\n    .bb-border-plain(darken(@color,5%));\n    .box-shadow(inset 0 1px 0 0 rgba(255,255,255,.5));\n    .bb-text-light();\n}\n.button-gloss-hover(@color){\n    .button-gloss(darken(@color,5%));\n    .box-shadow(inset 0 1px 0 0 rgba(255,255,255,.3));\n    .button-hover();\n}\n.button-gloss-active(@color){\n    .button-gloss-hover(darken(@color,5%));\n    .box-shadow(inset 0 0 5px 0 rgba(0,0,0,.3));\n}\n.bar-gloss(@color){\n    .button-gloss(@color);\n    .bar();\n}\n\n@btn-minimal-color: #eee;\n.btn-minimal { .button-minimal(@btn-minimal-color); }\n.btn-minimal:hover { .button-minimal-hover(@btn-minimal-color); }\n.btn-minimal:active { .button-minimal-active(@btn-minimal-color); }\n\n@btn-clean-color: #eee;\n.btn-clean { .button-clean(@btn-clean-color); }\n.btn-clean:hover { .button-clean-hover(@btn-clean-color); }\n.btn-clean:active { .button-clean-active(@btn-clean-color); }\n\n@btn-soft-color: #6C84AB;\n.btn-soft { .button-soft(@btn-soft-color); }\n.btn-soft:hover { .button-soft-hover(@btn-soft-color); }\n.btn-soft:active { .button-soft-active(@btn-soft-color); }\n\n@btn-pill-color: #6C84AB;\n.btn-pill { .button-pill(@btn-pill-color); }\n.btn-pill:hover { .button-pill-hover(@btn-pill-color); }\n.btn-pill:active { .button-pill-active(@btn-pill-color); }\n\n@btn-gloss-color: #172D6E;\n.btn-gloss { .button-gloss(@btn-gloss-color); }\n.btn-gloss:hover { .button-gloss-hover(@btn-gloss-color); }\n.btn-gloss:active { .button-gloss-active(@btn-gloss-color); }\n\n\n.bar-minimal { .bar-minimal(@btn-minimal-color); }\n.bar-clean { .bar-clean(@btn-clean-color); }\n.bar-soft { .bar-soft(@btn-soft-color); }\n.bar-pill { .bar-pill(@btn-pill-color); }\n.bar-gloss { .bar-gloss(@btn-gloss-color); }"
  },
  {
    "path": "styles/base/buttons.less",
    "content": "/* ==========================================================================\n   Settings\n   ========================================================================== */\n\n@import 'variables.less';\n\n/*\n@baseline: @baseline;\n@button-color: @button-color;\n@button-primary-color: @button-primary-color;\n@button-info-color: @button-info-color;\n@button-success-color: @button-success-color;\n@button-warning-color: @button-warning-color;\n@button-danger-color: @button-danger-color;\n*/\n\n/* ==========================================================================\n   Default\n   ========================================================================== */\n\n.btn{\n    .btn-s;\n    background-clip: border-box !important;\n    background-repeat: repeat-x;\n    border: 1px solid rgba(0, 0, 0, 0.25);\n    .border-box;\n    .border-radius(4px);\n    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);\n    cursor: pointer;\n    display: inline-block;\n    .gradient(@button-color, lighten(@button-color, 10%), @button-color);\n    .phh;\n    .pvn;\n    .transition(background-position linear 0.1s);\n    vertical-align: middle;\n    color: #333;\n    font-family: @body-font-family;\n    text-decoration: none !important;\n    text-shadow: rgba(255,255,255,0.75) 0 1px 0;\n\n    &:hover{\n        background-position: 0 -15px;\n    }\n}\n\n/* ==========================================================================\n   Styles\n   ========================================================================== */\n\n.btn-primary,\n.btn-info,\n.btn-success,\n.btn-warning,\n.btn-danger{\n    color: #FFF !important;\n    text-shadow: rgba(0,0,0,0.25) 0 -1px 0 !important;\n}\n.btn-primary{\n    .btn;\n    .gradient(@button-primary-color, lighten(@button-primary-color, 10%), @button-primary-color);\n}\n.btn-info{\n    .btn;\n    .gradient(@button-info-color, lighten(@button-info-color, 10%), @button-info-color);\n}\n.btn-success{\n    .btn;\n    .gradient(@button-success-color, lighten(@button-success-color, 10%), @button-success-color);\n}\n.btn-warning{\n    .btn;\n    .gradient(@button-warning-color, lighten(@button-warning-color, 10%), @button-warning-color);\n}\n.btn-danger{\n    .btn;\n    .gradient(@button-danger-color, lighten(@button-danger-color, 10%), @button-danger-color);\n}\n\n/* ==========================================================================\n   Sizes (Half = h, Single = s, Double = d)\n   ========================================================================== */\n\n.btn-h, .btn-half{\n    height: @baseline;\n    font-size: @baseline * 0.6;\n    line-height: @baseline;\n}\n.btn-s, .btn-single{\n    height: @baseline * 1.5;\n    font-size: @baseline * 0.75;\n    line-height: @baseline * 1.5;\n}\n.btn-d, .btn-double{\n    height: @baseline * 2;\n    font-size: @baseline;\n    line-height: @baseline * 2;\n}"
  },
  {
    "path": "styles/base/grid.less",
    "content": "/**\n * Hybrid Grid Sytem\n *\n * Blend of the Semantic Grid System and Zurb Foundation with a little Twitter Bootstrap\n */\n\n/* Settings */\n\n@import 'variables.less';\n\n/*\n@fixed-column-width: 40px;\n@fixed-gutter-width: 20px;\n@fixed-columns: 12;\n\n@fluid-column-width: 4.3%;\n@fluid-gutter-width: 4.4%;\n@fluid-columns: 12;\n\n@mobile-break-width: 480px;\n@mobile-column-width: 8.6%;\n@mobile-gutter-width: 8.8%;\n@mobile-columns: 6;\n*/\n\n/* Grid */\n\n#grid {\n\n    .cols(@cols,@width,@gutter){\n        .border-box();\n        width: ((@cols * @width) + ((@cols - 1) * @gutter));\n        margin-left: @gutter;\n        position: relative;\n        display: inline;\n        float: left;\n        min-height: 1px;\n        &:first-child {\n            margin-left: 0;\n        }\n        &:last-child {\n            float: right;\n        }\n    }\n\n}\n\n.grid-fixed,.grid-fluid {\n    .clearfix;\n    .row {\n        .border-box();\n        display: block;\n        width: 100%;\n        margin: 0 auto;\n        .clearfix;\n\n        .center,.center:last-child {\n            float: none;\n            display: block;\n            margin: 0 auto;\n        }\n    }\n}\n\n.grid-fixed {\n    @total-width: (@fixed-column-width*@fixed-columns) + (@fixed-gutter-width*(@fixed-columns - 1));\n    @column-width: @fixed-column-width;\n    @gutter-width: @fixed-gutter-width;\n    @columns: @fixed-columns;\n    width: @total-width;\n\n    /* This is duplicated in both classes. Unavoidable. */\n    .colX (@index) when (@index > 0) {\n        (~\".col@{index}\") {\n            #grid > .cols(@index,@column-width,@gutter-width);\n        }\n        .colX(@index - 1);\n    }\n    .colX (0) {}\n    .colX(@columns);\n\n    .offsetX (@index) when (@index > 0) {\n        (~\".offset@{index}\") {\n            margin-left: (@index * @column-width) + ((@index + 1) * @gutter-width);\n        }\n        .offsetX(@index - 1);\n    }\n    .offsetX (0) {}\n    .offsetX(@columns - 1);\n\n    .pushX (@index) when (@index > 0) {\n        (~\".push@{index}\") {\n            left: @index * (@column-width + @gutter-width);\n        }\n        .pushX(@index - 1);\n    }\n    .pushX (0) {}\n    .pushX(@columns - 1);\n\n    .pullX (@index) when (@index > 0) {\n        (~\".pull@{index}\") {\n            right: @index * (@column-width + @gutter-width);\n        }\n        .pullX(@index - 1);\n    }\n    .pullX (0) {}\n    .pullX(@columns - 1);\n}\n\n\n.grid-fluid {\n    @total-width: 100%;\n    @column-width: @fluid-column-width;\n    @gutter-width: @fluid-gutter-width;\n    @columns: @fluid-columns;\n    width: @total-width;\n\n    /* This is duplicated in both classes. Unavoidable. */\n    .colX (@index) when (@index > 0) {\n        (~\".col@{index}\") {\n            #grid > .cols(@index,@column-width,@gutter-width);\n        }\n        .colX(@index - 1);\n    }\n    .colX (0) {}\n    .colX(@columns);\n\n    .offsetX (@index) when (@index > 0) {\n        (~\".offset@{index}\") {\n            margin-left: (@index * @column-width) + ((@index + 1) * @gutter-width);\n        }\n        .offsetX(@index - 1);\n    }\n    .offsetX (0) {}\n    .offsetX(@columns - 1);\n\n    .pushX (@index) when (@index > 0) {\n        (~\".push@{index}\") {\n            left: @index * (@column-width + @gutter-width);\n        }\n        .pushX(@index - 1);\n    }\n    .pushX (0) {}\n    .pushX(@columns - 1);\n\n    .pullX (@index) when (@index > 0) {\n        (~\".pull@{index}\") {\n            right: @index * (@column-width + @gutter-width);\n        }\n        .pullX(@index - 1);\n    }\n    .pullX (0) {}\n    .pullX(@columns - 1);\n}\n\n\n@media all and (max-width: @mobile-break-width) {\n\n    // Reset all columns to full width\n    .grid-fixed {\n        .colX (@index) when (@index > 0) {\n            (~\".col@{index}\") {\n                width: 100%;\n                margin: 0;\n                left: 0;\n                right: 0;\n            }\n            .colX(@index - 1);\n        }\n        .colX (0) {}\n        .colX(@fixed-columns);\n    }\n    .grid-fluid {\n        .colX (@index) when (@index > 0) {\n            (~\".col@{index}\") {\n                width: 100%;\n                margin: 0;\n                left: 0;\n                right: 0;\n            }\n            .colX(@index - 1);\n        }\n        .colX (0) {}\n        .colX(@fluid-columns);\n    }\n\n    .grid-fixed, .grid-fluid {\n        @total-width: 100%;\n        @column-width: @mobile-column-width;\n        @gutter-width: @mobile-gutter-width;\n        @columns: @mobile-columns;\n        width: @total-width;\n\n        .m-colX (@index) when (@index > 0) {\n            (~\".m-col@{index}\") {\n                #grid > .cols(@index,@column-width,@gutter-width);\n            }\n            .m-colX(@index - 1);\n        }\n        .m-colX (0) {}\n        .m-colX(@mobile-columns);\n\n        .m-offsetX (@index) when (@index > 0) {\n            (~\".m-offset@{index}\") {\n                margin-left: (@index * @column-width) + ((@index + 1) * @gutter-width);\n            }\n            .m-offsetX(@index - 1);\n        }\n        .m-offsetX (0) {}\n        .m-offsetX(@columns - 1);\n\n        .m-pushX (@index) when (@index > 0) {\n            (~\".m-push@{index}\") {\n                left: @index * (@column-width + @gutter-width);\n            }\n            .m-pushX(@index - 1);\n        }\n        .m-pushX (0) {}\n        .m-pushX(@columns - 1);\n\n        .m-pullX (@index) when (@index > 0) {\n            (~\".m-pull@{index}\") {\n                right: @index * (@column-width + @gutter-width);\n            }\n            .m-pullX(@index - 1);\n        }\n        .m-pullX (0) {}\n        .m-pullX(@columns - 1);\n    }\n\n}\n"
  },
  {
    "path": "styles/base/idioms.less",
    "content": "/**\n * New Media Campaigns Idioms\n *\n * These are common patterns we use in all of our\n * projects. They are consolidated here to keep code DRY.\n *\n * Listing\n *    * .no-text, .text-replace\n *    * .no-list\n *    * .no-form\n *    * .fixed-width(@width)\n *    * .column-width(@width)\n *    * .column-left(@width)\n *    * .column-right(@width)\n *    * .full-size\n *    * .absolute-default\n *    * .absolute-fullsize\n *    * .clearfix\n */\n\n/*  Hides text when using image replacement */\n.no-text, .text-replace{\n    overflow: hidden;\n    text-indent: 100%;\n    white-space: nowrap;\n}\n\n/*  Removes bullets, margin, and padding from list */\n.no-list{\n    list-style: none;\n    margin: 0;\n    padding: 0;\n}\n\n/*  Removes webkit styling from form element */\n.no-form{\n    border: none;\n    margin: 0;\n    padding: 0;\n    -webkit-appearance: none;\n}\n\n/*  Center a fixed width container */\n.fixed-width(@width) {\n    margin: 0 auto;\n    width: @width;\n}\n\n/*  Adds left or right columns (e.g. content and sidebar) */\n.column-width(@width){\n    display: inline;\n    width: @width;\n}\n.column-left(@width){\n    .column-width(@width);\n    float: left;\n}\n.column-right(@width){\n    .column-width(@width);\n    float: right;\n}\n\n/*  Set width and height of element to that of its parent */\n.full-size{\n    height: 100%;\n    width: 100%;\n}\n\n/*  Position element absolutely to 0,0 */\n.absolute-default{\n    position: absolute;\n    left: 0;\n    top: 0;\n}\n\n/*  Position element absolutely and set its width and height to that of its parent (useful for slideshows) */\n.absolute-fullsize{\n    .absolute-default;\n    .full-size;\n}\n\n/*  The micro clearfix http://nicolasgallagher.com/micro-clearfix-hack/ */\n.clearfix {\n    *zoom:1;\n\n    &:before,\n    &:after {\n        content:\"\";\n        display:table;\n    }\n    &:after {\n        clear:both;\n    }\n}\n"
  },
  {
    "path": "styles/base/prefixer.less",
    "content": "/*---------------------------------------------------\n    LESS Prefixer\n  ---------------------------------------------------\n    \n    All of the CSS3 fun, none of the prefixes!\n\n    As a rule, you can use the CSS properties you\n    would expect just by adding a '.':\n\n    box-shadow => .box-shadow(@args)\n\n    Also, when shorthand is available, arguments are\n    not parameterized. Learn CSS, not LESS Prefixer.\n\n    -------------------------------------------------\n    TABLE OF CONTENTS\n    (*) denotes a syntax-sugar helper\n    -------------------------------------------------\n\n        .animation(@args)\n            .animation-delay(@delay)\n            .animation-direction(@direction)\n            .animation-duration(@duration)\n            .animation-iteration-count(@count)\n            .animation-name(@name)\n            .animation-play-state(@state)\n            .animation-timing-function(@function)\n        .background-size(@args)\n        .border-radius(@args)\n        .box-shadow(@args)\n            .inner-shadow(@args) *\n        .box-sizing(@args)\n            .border-box() *\n            .content-box() *\n        .columns(@args)\n            .column-count(@count)\n            .column-gap(@gap)\n            .column-rule(@args)\n            .column-width(@width)\n        .gradient(@default,@start,@stop) *\n            .linear-gradient-top(@default,@color1,@stop1,@color2,@stop2,[@color3,@stop3,@color4,@stop4])*\n            .linear-gradient-left(@default,@color1,@stop1,@color2,@stop2,[@color3,@stop3,@color4,@stop4])*\n        .opacity(@factor)\n        .transform(@args)\n            .rotate(@deg)\n            .scale(@factor)\n            .translate(@x,@y)\n            .translate3d(@x,@y,@z)\n            .translateHardware(@x,@y) *\n        .text-shadow(@args)\n        .transition(@args)\n            .transition-delay(@delay)\n            .transition-duration(@duration)\n            .transition-property(@property)\n            .transition-timing-function(@function)\n\n\n\n    Credit to LESS Elements for the motivation and\n    to CSS3Please.com for implementation.\n\n    Copyright (c) 2012 Joel Sutherland\n    MIT Licensed:\n    http://www.opensource.org/licenses/mit-license.php\n\n-----------------------------------------------------*/\n\n\n/* Animation */\n.animation(@args) {\n    -webkit-animation: @args;\n    -moz-animation: @args;\n    -ms-animation: @args;\n    -o-animation: @args;\n}\n.animation-delay(@delay) {\n    -webkit-animation-delay: @delay;\n    -moz-animation-delay: @delay;\n    -ms-animation-delay: @delay;\n    -o-animation-delay: @delay;\n}\n.animation-direction(@direction) {\n    -webkit-animation-direction: @direction;\n    -moz-animation-direction: @direction;\n    -ms-animation-direction: @direction;\n    -o-animation-direction: @direction;\n}\n.animation-duration(@duration) {\n    -webkit-animation-duration: @duration;\n    -moz-animation-duration: @duration;\n    -ms-animation-duration: @duration;\n    -o-animation-duration: @duration;\n}\n.animation-iteration-count(@count) {\n    -webkit-animation-iteration-count: @count;\n    -moz-animation-iteration-count: @count;\n    -ms-animation-iteration-count: @count;\n    -o-animation-iteration-count: @count;\n}\n.animation-name(@name) {\n    -webkit-animation-name: @name;\n    -moz-animation-name: @name;\n    -ms-animation-name: @name;\n    -o-animation-name: @name;\n}\n.animation-play-state(@state) {\n    -webkit-animation-play-state: @state;\n    -moz-animation-play-state: @state;\n    -ms-animation-play-state: @state;\n    -o-animation-play-state: @state;\n}\n.animation-timing-function(@function) {\n    -webkit-animation-timing-function: @function;\n    -moz-animation-timing-function: @function;\n    -ms-animation-timing-function: @function;\n    -o-animation-timing-function: @function;\n}\n\n\n/* Background Size */\n\n.background-size(@args) {\n    -webkit-background-size: @args;\n    -moz-background-size: @args;\n    background-size: @args;\n}\n\n\n/* Border Radius */\n\n.border-radius(@args) {\n    -webkit-border-radius: @args;\n    -moz-border-radius: @args;\n    border-radius: @args;\n\n    -webkit-background-clip: padding-box;\n    -moz-background-clip: padding;\n    background-clip: padding-box;\n}\n\n\n/* Box Shadows */\n.box-shadow(@args) {\n    -webkit-box-shadow: @args;\n    -moz-box-shadow: @args;\n    box-shadow: @args;\n}\n.inner-shadow(@args) {\n    .box-shadow(inset @args);\n}\n\n\n/* Box Sizing */\n.box-sizing(@args){\n    -webkit-box-sizing: @args;\n    -moz-box-sizing: @args;\n    box-sizing: @args;\n}\n.border-box(){\n    .box-sizing(border-box);\n}\n.content-box(){\n    .box-sizing(content-box);\n}\n\n\n\n/* Columns */\n.columns(@args){\n    -webkit-columns: @args;\n    -moz-columns: @args;\n    columns: @args;\n}\n.column-count(@count) {\n    -webkit-column-count: @count;\n    -moz-column-count: @count;\n    column-count: @count;\n}\n.column-gap(@gap) {\n    -webkit-column-gap: @gap;\n    -moz-column-gap: @gap;\n    column-gap: @gap;\n}\n.column-width(@width){\n    -webkit-column-width: @width;\n    -moz-column-width: @width;\n    column-width: @width;\n}\n.column-rule(@args){\n    -webkit-column-rule: @rule;\n    -moz-column-rule: @rule;\n    column-rule: @rule;\n}\n\n\n/* Gradients */\n.gradient(@default: #F5F5F5, @start: #EEE, @stop: #FFF) {\n    .linear-gradient-top(@default,@start,0%,@stop,100%);\n}\n.linear-gradient-top(@default,@color1,@stop1,@color2,@stop2) {\n    background-color: @default;\n    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(@stop1, @color1), color-stop(@stop2 @color2));\n    background-image: -webkit-linear-gradient(top, @color1 @stop1, @color2 @stop2);\n    background-image: -moz-linear-gradient(top, @color1 @stop1, @color2 @stop2);\n    background-image: -ms-linear-gradient(top, @color1 @stop1, @color2 @stop2);\n    background-image: -o-linear-gradient(top, @color1 @stop1, @color2 @stop2);\n    background-image: linear-gradient(top, @color1 @stop1, @color2 @stop2);\n}\n.linear-gradient-top(@default,@color1,@stop1,@color2,@stop2,@color3,@stop3) {\n    background-color: @default;\n    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(@stop1, @color1), color-stop(@stop2 @color2), color-stop(@stop3 @color3));\n    background-image: -webkit-linear-gradient(top, @color1 @stop1, @color2 @stop2, @color3 @stop3);\n    background-image: -moz-linear-gradient(top, @color1 @stop1, @color2 @stop2, @color3 @stop3);\n    background-image: -ms-linear-gradient(top, @color1 @stop1, @color2 @stop2, @color3 @stop3);\n    background-image: -o-linear-gradient(top, @color1 @stop1, @color2 @stop2, @color3 @stop3);\n    background-image: linear-gradient(top, @color1 @stop1, @color2 @stop2, @color3 @stop3);\n}\n.linear-gradient-top(@default,@color1,@stop1,@color2,@stop2,@color3,@stop3,@color4,@stop4) {\n    background-color: @default;\n    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(@stop1, @color1), color-stop(@stop2 @color2), color-stop(@stop3 @color3), color-stop(@stop4 @color4));\n    background-image: -webkit-linear-gradient(top, @color1 @stop1, @color2 @stop2, @color3 @stop3, @color4 @stop4);\n    background-image: -moz-linear-gradient(top, @color1 @stop1, @color2 @stop2, @color3 @stop3, @color4 @stop4);\n    background-image: -ms-linear-gradient(top, @color1 @stop1, @color2 @stop2, @color3 @stop3, @color4 @stop4);\n    background-image: -o-linear-gradient(top, @color1 @stop1, @color2 @stop2, @color3 @stop3, @color4 @stop4);\n    background-image: linear-gradient(top, @color1 @stop1, @color2 @stop2, @color3 @stop3, @color4 @stop4);\n}\n.linear-gradient-left(@default,@color1,@stop1,@color2,@stop2) {\n    background-color: @default;\n    background-image: -webkit-gradient(linear, left top, left top, color-stop(@stop1, @color1), color-stop(@stop2 @color2));\n    background-image: -webkit-linear-gradient(left, @color1 @stop1, @color2 @stop2);\n    background-image: -moz-linear-gradient(left, @color1 @stop1, @color2 @stop2);\n    background-image: -ms-linear-gradient(left, @color1 @stop1, @color2 @stop2);\n    background-image: -o-linear-gradient(left, @color1 @stop1, @color2 @stop2);\n    background-image: linear-gradient(left, @color1 @stop1, @color2 @stop2);\n}\n.linear-gradient-left(@default,@color1,@stop1,@color2,@stop2,@color3,@stop3) {\n    background-color: @default;\n    background-image: -webkit-gradient(linear, left top, left top, color-stop(@stop1, @color1), color-stop(@stop2 @color2), color-stop(@stop3 @color3));\n    background-image: -webkit-linear-gradient(left, @color1 @stop1, @color2 @stop2, @color3 @stop3);\n    background-image: -moz-linear-gradient(left, @color1 @stop1, @color2 @stop2, @color3 @stop3);\n    background-image: -ms-linear-gradient(left, @color1 @stop1, @color2 @stop2, @color3 @stop3);\n    background-image: -o-linear-gradient(left, @color1 @stop1, @color2 @stop2, @color3 @stop3);\n    background-image: linear-gradient(left, @color1 @stop1, @color2 @stop2, @color3 @stop3);\n}\n.linear-gradient-left(@default,@color1,@stop1,@color2,@stop2,@color3,@stop3,@color4,@stop4) {\n    background-color: @default;\n    background-image: -webkit-gradient(linear, left top, left top, color-stop(@stop1, @color1), color-stop(@stop2 @color2), color-stop(@stop3 @color3), color-stop(@stop4 @color4));\n    background-image: -webkit-linear-gradient(left, @color1 @stop1, @color2 @stop2, @color3 @stop3, @color4 @stop4);\n    background-image: -moz-linear-gradient(left, @color1 @stop1, @color2 @stop2, @color3 @stop3, @color4 @stop4);\n    background-image: -ms-linear-gradient(left, @color1 @stop1, @color2 @stop2, @color3 @stop3, @color4 @stop4);\n    background-image: -o-linear-gradient(left, @color1 @stop1, @color2 @stop2, @color3 @stop3, @color4 @stop4);\n    background-image: linear-gradient(left, @color1 @stop1, @color2 @stop2, @color3 @stop3, @color4 @stop4);\n}\n\n\n/* Opacity */\n.opacity(@factor){\n    opacity: @factor;\n    @iefactor: @factor*100;\n    filter: alpha(opacity=@iefactor);\n}\n\n\n/* Text Shadow */\n.text-shadow(@args){\n    text-shadow: @args;\n}\n\n/* Transforms */\n\n.transform(@args) {\n    -webkit-transform: @args; \n    -moz-transform: @args; \n    -ms-transform: @args; \n    -o-transform: @args; \n    transform: @args;\n}\n.rotate(@deg:45deg){\n    .transform(rotate(@deg));\n}\n.scale(@factor:.5){\n    .transform(scale(@factor));\n}\n.translate(@x,@y){\n    .transform(translate(@x,@y));\n}\n.translate3d(@x,@y,@z) {\n    .transform(translate3d(@x,@y,@z));\n}\n.translateHardware(@x,@y){\n    .translate(@x,@y);\n    -webkit-transform: translate3d(@x,@y,0);\n    -moz-transform: translate3d(@x,@y,0);\n}\n\n\n/* Transitions */\n\n.transition(@args:200ms) {\n    -webkit-transition: @args;\n    -moz-transition: @args;\n    -o-transition: @args;\n    transition: @args;\n}\n.transition-delay(@delay:0) {\n    -webkit-transition-delay: @delay;\n    -moz-transition-delay: @delay;\n    -o-transition-delay: @delay;\n    transition-delay: @delay;\n}\n.transition-duration(@duration:200ms) {\n    -webkit-transition-duration: @duration;\n    -moz-transition-duration: @duration;\n    -o-transition-duration: @duration;\n    transition-duration: @duration;\n}\n.transition-property(@property:all) {\n    -webkit-transition-property: @property;\n    -moz-transition-property: @property;\n    -o-transition-property: @property;\n    transition-property: @property;\n}\n.transition-timing-function(@function:ease) {\n    -webkit-transition-timing-function: @function;\n    -moz-transition-timing-function: @function;\n    -o-transition-timing-function: @function;\n    transition-timing-function: @function;\n}"
  },
  {
    "path": "styles/base/reset.less",
    "content": "/**\n * html5doctor.com Reset Stylesheet\n * v1.6.1\n * Last Updated: 2010-09-17\n * Author: Richard Clark - http://richclarkdesign.com\n * Twitter: @rich_clark\n */\n\nhtml, body, div, span, object, iframe,\nh1, h2, h3, h4, h5, h6, p, blockquote, pre,\nabbr, address, cite, code,\ndel, dfn, em, img, ins, kbd, q, samp,\nsmall, strong, sub, sup, var,\nb, i,\ndl, dt, dd, ol, ul, li,\nfieldset, form, label, legend,\ntable, caption, tbody, tfoot, thead, tr, th, td,\narticle, aside, canvas, details, figcaption, figure,\nfooter, header, hgroup, menu, nav, section, summary,\ntime, mark, audio, video {\n    margin:0;\n    padding:0;\n    border:0;\n    outline:0;\n    font-size:100%;\n    vertical-align:baseline;\n    background:transparent;\n}\n\nbody {\n    line-height:1;\n}\n\narticle,aside,details,figcaption,figure,\nfooter,header,hgroup,menu,nav,section {\n    display:block;\n}\n\nnav ul {\n    list-style:none;\n}\n\nblockquote, q {\n    quotes:none;\n}\n\nblockquote:before, blockquote:after,\nq:before, q:after {\n    content:'';\n    content:none;\n}\n\na {\n    margin:0;\n    padding:0;\n    font-size:100%;\n    vertical-align:baseline;\n    background:transparent;\n}\n\n/* change colours to suit your needs */\nins {\n    background-color:#ff9;\n    color:#000;\n    text-decoration:none;\n}\n\n/* change colours to suit your needs */\nmark {\n    background-color:#ff9;\n    color:#000;\n    font-style:italic;\n    font-weight:bold;\n}\n\ndel {\n    text-decoration: line-through;\n}\n\nabbr[title], dfn[title] {\n    border-bottom:1px dotted;\n    cursor:help;\n}\n\ntable {\n    border-collapse:collapse;\n    border-spacing:0;\n}\n\n/* change border colour to suit your needs */\nhr {\n    display:block;\n    height:1px;\n    border:0;\n    border-top:1px solid #cccccc;\n    margin:1em 0;\n    padding:0;\n}\n\ninput, select {\n    vertical-align:middle;\n}"
  },
  {
    "path": "styles/base/spacing.less",
    "content": "/**\n * Spacing\n *\n * This LESS file defines margins and paddings for block-level\n * elements. Helper classes are included for use elsewhere\n * in site styles.\n */\n\n/* Settings */\n\n@import 'variables.less';\n\n/*\n@baseline: @baseline;\n*/\n\n/**\n * Spacing\n * p, m, lh = padding, margin, line-height\n * a, t, r, b, l, h, v = all, top, right, bottom, left, horizontal, vertical\n * n, h, s, d = none(0px), half(@baseline / 2), single(@baseline), double(@baseline * 2), none(0px)\n */\n\n.ptn, .pvn, .pan{\n    padding-top: 0 !important\n}\n.pth, .pvh, .pah{\n    padding-top: @baseline / 2 !important\n}\n.pts, .pvs, .pas{\n    padding-top: @baseline !important\n}\n.ptd, .pvd, .pad{\n    padding-top: @baseline * 2 !important\n}\n.prn, .phn, .pan{\n    padding-right: 0 !important\n}\n.prh, .phh, .pah{\n    padding-right: @baseline / 2 !important\n}\n.prs, .phs, .pas{\n    padding-right: @baseline !important\n}\n.prd, .phd, .pad{\n    padding-right: @baseline * 2 !important\n}\n.pbn, .pvn, .pan{\n    padding-bottom: 0 !important\n}\n.pbh, .pvh, .pah{\n    padding-bottom: @baseline / 2 !important\n}\n.pbs, .pvs, .pas{\n    padding-bottom: @baseline !important\n}\n.pbd, .pvd, .pad{\n    padding-bottom: @baseline * 2 !important\n}\n.pln, .phn, .pan{\n    padding-left: 0 !important\n}\n.plh, .phh, .pah{\n    padding-left: @baseline / 2 !important\n}\n.pls, .phs, .pas{\n    padding-left: @baseline !important\n}\n.pld, .phd, .pad{\n    padding-left: @baseline * 2 !important\n}\n.mtn, .mvn, .man{\n    margin-top: 0 !important\n}\n.mth, .mvh, .mah{\n    margin-top: @baseline / 2 !important\n}\n.mts, .mvs, .mas{\n    margin-top: @baseline !important\n}\n.mtd, .mvd, .mad{\n    margin-top: @baseline * 2 !important\n}\n.mrn, .mhn, .man{\n    margin-right: 0 !important\n}\n.mrh, .mhh, .mah{\n    margin-right: @baseline / 2 !important\n}\n.mrs, .mhs, .mas{\n    margin-right: @baseline !important\n}\n.mrd, .mhd, .mad{\n    margin-right: @baseline * 2 !important\n}\n.mbn, .mvn, .man{\n    margin-bottom: 0 !important\n}\n.mbh, .mvh, .mah{\n    margin-bottom: @baseline / 2 !important\n}\n.mbs, .mvs, .mas{\n    margin-bottom: @baseline !important\n}\n.mbd, .mvd, .mad{\n    margin-bottom: @baseline * 2 !important\n}\n.mln, .mhn, .man{\n    margin-left: 0 !important\n}\n.mlh, .mhh, .mah{\n    margin-left: @baseline / 2 !important\n}\n.mls, .mhs, .mas{\n    margin-left: @baseline !important\n}\n.mld, .mhd, .mad{\n    margin-left: @baseline * 2 !important\n}\n.lhh {\n    line-height: @baseline / 2 !important;\n}\n.lhs {\n    line-height: @baseline !important;\n}\n.lhd {\n    line-height: @baseline * 2 !important;\n}\n.lhn {\n    line-height: 0 !important;\n}\n"
  },
  {
    "path": "styles/base/typography.less",
    "content": "/**\n * Name Here\n *\n * @version     1.0\n * @package     Name Here\n * @author      New Media Campaigns\n * @copyright   2012 New Media Campaigns\n * @link        http://www.newmediacampaigns.com\n *\n * Copyright (c) 2012 New Media Campaigns\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is furnished\n * to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Typography\n *\n * This LESS file defines the baseline, color, font-size, and other typographical\n * styles for text elements.\n */\n\n/* Settings */\n\n@import 'variables.less';\n\n/*\n@baseline: @baseline;\n\n@body-color: @body-color;\n@body-font-family: @body-font-family;\n@body-font-size: @body-font-size;\n@body-accent-color: @body-accent-color;\n\n@header-color: @header-clor;\n@header-font-family: @header-font-family;\n@header-font-weight: @header-font-weight;\n*/\n\n/* Base */\n\nhtml, body {\n    font-family: @body-font-family;\n    color: @body-color;\n    font-size: @body-font-size;\n    .lhs;\n}\n\n/* Block-level */\n\nh1, h2, h3, h4, h5, h6, ul, ol, dl, p, blockquote, table, form, pre{\n    .mbs;\n}\n\n/* Headers */\n\n.all-headers{\n    color: @header-color;\n    font-family: @header-font-family;\n    font-weight: @header-font-weight;\n}\nh1, .alpha{\n    .all-headers;\n    font-size: @body-font-size * 2.5;\n    .lhd;\n}\nh2, .beta{\n    .all-headers;\n    font-size: @body-font-size * 1.75;\n    .lhd;\n}\nh3, .gamma{\n    .all-headers;\n    font-size: @body-font-size * 1.2;\n    .lhd;\n    .mbn;\n}\nh4, .delta{\n    .all-headers;\n    font-size: @body-font-size * 1;\n    .lhd;\n    .mbn;\n}\nh5, .epsilon{\n    .all-headers;\n    font-size: @body-font-size * 1;\n    .lhs;\n    .mbn\n}\nh6, .zeta{\n    .all-headers;\n    font-size: @body-font-size * 1;\n    .lhs;\n    .mbn;\n}\n\n/* Headers (above scale) */\n\n.giga{\n    .all-headers;\n    font-size: @body-font-size * 6;\n    line-height: @baseline * 4;\n}\n.mega{\n    .all-headers;\n    font-size: @body-font-size * 5;\n    line-height: @baseline * 3;\n}\n.kilo{\n    .all-headers;\n    font-size: @body-font-size * 4;\n    line-height: @baseline * 3;\n}\n\n/* Headers (below scale) */\n\n.milli{\n    .all-headers;\n    font-size: @body-font-size * 0.8;\n}\n\n/* Text */\n\na{\n    color: @body-accent-color;\n}\na:link{\n    text-decoration: underline;\n}\na:visited{\n\n}\na:hover{\n    text-decoration: none;\n}\na:active{\n\n}\na:focus{\n\n}\nsmall {\n    font-size: 80%;\n}\nsup, sub {\n    font-size: 80%;\n    .lhn;\n}\nsup {\n    vertical-align: super;\n}\nsub {\n    vertical-align: sub;\n}\n\n.lead{\n    color: darken(@body-color, 20%);\n    font-size: @baseline * 0.8;\n}\n\nblockquote{\n    border-left: 5px solid fade(#000, 10%);\n    .mhs;\n    .pls;\n    color: lighten(@body-color, 20%);\n    font-size: @baseline * 0.8;\n    font-style: italic;\n\n    :last-child{\n        .mbn;\n    }\n    small{\n        color: fade(#000, 50%);\n        font-size: @baseline * 0.7;\n        font-style: normal;\n    }\n}\npre, code, kbd{\n    background: #F8F8F8;\n    border: 1px solid #EAEAEA;\n    .border-radius(3px);\n    margin: 0 2px;\n    padding: 0 5px;\n    font-family: Consolas, \"Courier New\", Courier, mono;\n    font-size: @body-font-size * 0.9;\n    color: @body-color;\n    word-wrap: break-word;\n}\npre{\n    .mhs;\n    .pah;\n\n    code{\n        border: none;\n        .man;\n        .pan;\n    }\n}\na code{\n    background: none;\n    border: none;\n    .pan;\n    .man;\n}\nstrong{\n    font-weight: bold;\n}\nem{\n    font-style: italic;\n}\nol, ul, dl{\n    .mls;\n    .pls;\n    ol,ul {\n        .mbn;\n    }\n}\ndt{\n    font-weight: bold;\n}\ndd{\n    .mls;\n}\n\n.table{\n    border-collapse: collapse;\n    border-spacing: 0;\n    width: 100%;\n}\n    .table th, .table td{\n        border-top: 1px solid fade(#000, 10%);\n        padding: 8px;\n        text-align: left;\n    }\n    .table thead th{\n        vertical-align: bottom;\n        font-weight: bold;\n    }\n    .table thead tr:first-child th{\n        border-top: none;\n    }\n.table-bordered{\n    border: 1px solid fade(#000, 10%);\n    border-collapse: separate;\n    border-left: none;\n    .border-radius(4px);\n\n    th, td{\n        border-left: 1px solid fade(#000, 10%);\n    }\n    thead:last-child tr:last-child th:first-child,\n    tbody:last-child tr:last-child td:first-child{\n        .border-radius(0 0 0 4px);\n    }\n}\n.table-striped{\n    tbody tr:nth-child(odd) td{\n        background: fade(@body-accent-color, 4%);\n    }\n}\n\n/* ==========================================================================\n   Alerts\n   ========================================================================== */\n\n.alert{\n    background: #FCF8E3;\n    border: 1px solid #FBEED5;\n    .border-radius(4px);\n    .mbs;\n    .pah;\n    color: #C09853;\n}\n.alert-success{\n    .alert;\n    background-color: #DFF0D8;\n    border-color: #D6E9C6;\n    color: #468847;\n}\n.alert-error{\n    .alert;\n    background-color: #F2DEDE;\n    border-color: #EED3D7;\n    color: #B94A48;\n}\n.alert-info{\n    .alert;\n    background-color: #D9EDF7;\n    border-color: #BCE8F1;\n    color: #3A87AD;\n}\n\n/* ==========================================================================\n   Forms\n   ========================================================================== */\n\nlabel{\n    display: block;\n    font-weight: bold;\n\n    .req{\n        color: @body-accent-color;\n        font-weight: bold;\n    }\n}\ninput.text,\ntextarea,\nselect,\n.radio-group,\n.checkbox-group{\n    .mbs;\n}\ninput.text, textarea{\n    .no-form;\n    background: #EEE;\n    border: 1px solid #CCC;\n    .border-box;\n    .border-radius(4px);\n    .inner-shadow(fade(#000, 10%) 0 1px 3px);\n    height: @baseline * 1.5;\n    .pah;\n    width: 100%;\n}\ntextarea{\n    height: @baseline * 6;\n}\nselect{\n    min-width: 30%;\n}\n.checkbox-group label,\n.radio-group label{\n    font-weight: normal;\n}\n.error{\n    background-color: #F2DEDE !important;\n    border-color: red !important;\n    outline-color: red !important;\n    color: red !important;\n}\n"
  },
  {
    "path": "styles/base/variables.less",
    "content": "/* ==========================================================================\n   Spacing\n   ========================================================================== */\n\n@baseline: 20px;\n\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n\n@body-color: #555;\n@body-font-family: \"Helvetica Neue\", \"HelveticaNeue\", Helvetica, Arial, \"Lucida Grande\", sans-serif;\n@body-font-size: 14px;\n@body-accent-color: #f00;\n\n@header-color: #000;\n@header-font-family: \"Helvetica Neue\", \"HelveticaNeue\", Helvetica, Arial, \"Lucida Grande\", sans-serif;\n@header-font-weight: bold;\n\n/* ==========================================================================\n   Grid\n   ========================================================================== */\n\n@fixed-column-width: 40px;\n@fixed-gutter-width: 20px;\n@fixed-columns: 12;\n\n@fluid-column-width: 4.3%;\n@fluid-gutter-width: 4.4%;\n@fluid-columns: 12;\n\n@mobile-break-width: 480px;\n@mobile-column-width: 20%;\n@mobile-gutter-width: 6.6666%;\n@mobile-columns: 4;\n\n/* ==========================================================================\n   Buttons\n   ========================================================================== */\n\n@button-color: #DDD;\n@button-primary-color: #0055CC;\n@button-info-color: #2F96B4;\n@button-success-color: #51A351;\n@button-warning-color: #FAA732;\n@button-danger-color: #BD362F;\n\n/* ==========================================================================\n   Site Variables\n   ========================================================================== */\n\n@import \"../site/variables\";"
  },
  {
    "path": "styles/print.css",
    "content": "body, .site-title, h1, h2, h3{\n\tfont-family: 'Georgia' !important;\n}\n\n\nnav.site-navigation, a.fork-me, a.top{\n\tdisplay:none;\n}\n\ndiv.site-content{\n\tpadding: 20px 40px 40px 20px;\n}"
  },
  {
    "path": "styles/site/site-content.less",
    "content": ".site-content{\n    padding: 20px 40px 40px 320px;\n\n    h1{\n        clear: both;\n    }\n}\n.interior-site-content{\n    .pad;\n}\n.top{\n    background: #333;\n    display: inline-block;\n    float: right;\n    margin-right: -40px;\n    padding: 4px 8px;\n    color: #FFF;\n    font-size: 12px;\n    text-decoration: none !important;\n}\n"
  },
  {
    "path": "styles/site/site-footer.less",
    "content": ".site-footer{\n    clear: both;\n    .ptd;\n    font-size: 13px;\n    text-align: center;\n}\n.site-footer img{\n    margin-left: 2px;\n    position: relative;\n    top: -2px;\n    vertical-align: middle;\n}\n.site-footer ul{\n    list-style: none;\n    .mhn;\n    .phn;\n}\n"
  },
  {
    "path": "styles/site/site-header.less",
    "content": ".site-header{\n    position: relative;\n    z-index: 1;\n    text-align: center;\n}\n.site-title{\n    .mbn;\n    font-family: 'Alfa Slab One';\n    font-size: @baseline * 4;\n    font-weight: normal !important;\n    line-height: @baseline * 5 !important;\n\n    a{\n        text-decoration: none;\n    }\n}\n.site-slogan{\n    font-weight: normal;\n}\n.fork-me, .fork-me img{\n    position: absolute;\n    top: 0;\n    right: 0;\n}\n.fork-me{\n    z-index: 2;\n}\n\n.interior-site-header{\n    background: #EEE;\n    .inner-shadow(fade(#000, 7%) 0 0 40px);\n    .pas;\n    text-align: center;\n\n    .site-title{\n        font-size: @baseline * 2;\n        line-height: @baseline * 2 !important;\n    }\n    .site-slogan{\n        .mbs;\n    }\n}\n"
  },
  {
    "path": "styles/site/site-navigation.less",
    "content": ".site-navigation{\n    background: #EEE;\n    .inner-shadow(fade(#000, 7%) 0 0 40px);\n    .pas;\n    position: fixed;\n    top: 0;\n    bottom: 0;\n    overflow: auto;\n    width: 240px;\n}\n.build-date{\n    .mbs;\n    color: #AAA;\n    font-family: Helvetica, Arial, sans-serif;\n    font-size: 11px;\n}\n.site-navigation ul{\n    .man;\n    .pan;\n    .no-list;\n    font-size: 16px;\n    margin-bottom: 10px;\n}\n.site-navigation > ul > li{\n    margin-bottom: 10px;\n}\n.site-navigation a{\n    text-decoration: underline;\n\n    &:hover{\n        text-decoration: none;\n    }\n}\n.site-navigation a.active{\n\tbackground-color: #ff9;\n}\n.site-navigation ul ul{\n    .mls;\n    .pth;\n    font-size: 12px;\n\n    a{\n        text-decoration: none;\n    }\n}\n"
  },
  {
    "path": "styles/site/variables.less",
    "content": "/* ==========================================================================\n   Spacing\n   ========================================================================== */\n\n@baseline: 20px;\n\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n\n@body-color: #666;\n@body-font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n@body-font-size: 14px;\n@body-accent-color: #000;\n\n@header-color: #111;\n@header-font-family: \"Droid Serif\", Georgia, \"Times New Roman\", Times, serif;\n@header-font-weight: 700;\n\n/* ==========================================================================\n   Grid\n   ========================================================================== */\n\n@fixed-column-width: 60px;\n@fixed-gutter-width: 20px;\n@fixed-columns: 12;\n\n@fluid-column-width: 4.3%;\n@fluid-gutter-width: 4.4%;\n@fluid-columns: 12;\n\n@mobile-break-width: 480px;\n@mobile-column-width: 20%;\n@mobile-gutter-width: 6.6666%;\n@mobile-columns: 4;\n\n/* ==========================================================================\n   Buttons\n   ========================================================================== */\n\n@button-color: #DDD;\n@button-primary-color: #0055CC;\n@button-info-color: #2F96B4;\n@button-success-color: #51A351;\n@button-warning-color: #FAA732;\n@button-danger-color: #BD362F;\n"
  },
  {
    "path": "styles/syntax.css",
    "content": ".highlight  { background: #ffffff; margin: 0 4px; font-size: 0.8em; }\n.highlight .c { color: #999988; font-style: italic } /* Comment */\n.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */\n.highlight .k { font-weight: bold } /* Keyword */\n.highlight .o { font-weight: bold } /* Operator */\n.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */\n.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */\n.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */\n.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */\n.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */\n.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */\n.highlight .ge { font-style: italic } /* Generic.Emph */\n.highlight .gr { color: #aa0000 } /* Generic.Error */\n.highlight .gh { color: #999999 } /* Generic.Heading */\n.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */\n.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */\n.highlight .go { color: #888888 } /* Generic.Output */\n.highlight .gp { color: #555555 } /* Generic.Prompt */\n.highlight .gs { font-weight: bold } /* Generic.Strong */\n.highlight .gu { color: #aaaaaa } /* Generic.Subheading */\n.highlight .gt { color: #aa0000 } /* Generic.Traceback */\n.highlight .kc { font-weight: bold } /* Keyword.Constant */\n.highlight .kd { font-weight: bold } /* Keyword.Declaration */\n.highlight .kp { font-weight: bold } /* Keyword.Pseudo */\n.highlight .kr { font-weight: bold } /* Keyword.Reserved */\n.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */\n.highlight .m { color: #009999 } /* Literal.Number */\n.highlight .s { color: #d14 } /* Literal.String */\n.highlight .na { color: #008080 } /* Name.Attribute */\n.highlight .nb { color: #0086B3 } /* Name.Builtin */\n.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */\n.highlight .no { color: #008080 } /* Name.Constant */\n.highlight .ni { color: #800080 } /* Name.Entity */\n.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */\n.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */\n.highlight .nn { color: #555555 } /* Name.Namespace */\n.highlight .nt { color: #000080 } /* Name.Tag */\n.highlight .nv { color: #008080 } /* Name.Variable */\n.highlight .ow { font-weight: bold } /* Operator.Word */\n.highlight .w { color: #bbbbbb } /* Text.Whitespace */\n.highlight .mf { color: #009999 } /* Literal.Number.Float */\n.highlight .mh { color: #009999 } /* Literal.Number.Hex */\n.highlight .mi { color: #009999 } /* Literal.Number.Integer */\n.highlight .mo { color: #009999 } /* Literal.Number.Oct */\n.highlight .sb { color: #d14 } /* Literal.String.Backtick */\n.highlight .sc { color: #d14 } /* Literal.String.Char */\n.highlight .sd { color: #d14 } /* Literal.String.Doc */\n.highlight .s2 { color: #d14 } /* Literal.String.Double */\n.highlight .se { color: #d14 } /* Literal.String.Escape */\n.highlight .sh { color: #d14 } /* Literal.String.Heredoc */\n.highlight .si { color: #d14 } /* Literal.String.Interpol */\n.highlight .sx { color: #d14 } /* Literal.String.Other */\n.highlight .sr { color: #009926 } /* Literal.String.Regex */\n.highlight .s1 { color: #d14 } /* Literal.String.Single */\n.highlight .ss { color: #990073 } /* Literal.String.Symbol */\n.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */\n.highlight .vc { color: #008080 } /* Name.Variable.Class */\n.highlight .vg { color: #008080 } /* Name.Variable.Global */\n.highlight .vi { color: #008080 } /* Name.Variable.Instance */\n.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */"
  }
]