• Complain

Mit Randall. - Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners

Here you can read online Mit Randall. - Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners
  • Author:
  • Genre:
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Mitchum Digital, 2016. 65 p. ASIN: B01DOSPJH8A great start for PHP developers who want to learn how to get an app up and running with Phalcon. This is truly a barebones, straightforward, working recipe that you can use as a foundation for building future apps.
Get precise instructions and sample code for installing Phalcon, configuring the loader, connecting to a database and even setting up routes. You get fully-working MVC code with DB output. This is book covers all of the the essentials for a working app.

Mit Randall.: author's other books


Who wrote Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners? Find out the surname, the name of the author of the book and a list of all author's works by series.

Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make

Creating a Barebones

Phalcon App

A simple step-by-step recipe for beginners

By

Randall Mit

Table of Contents

Overview

This book is intended for a developers who are new to the Phalcon PHP framework. The primary goal of this book is to walk you through setting up a working, barebones Phalcon app. The foundation that you get from this book will assist you in growing your app into a more robust, production app.

You do not need any prior experience with Phalcon. In addition, this book will help developers who briefly looked at Phalcon but left frustrated because they did not know how to get things started.

I will not cover any of the advanced topics in Phalcon such as security, complex model queries, hybrid apps, extended error handling and others. My intention is to get you up and running, and to do that, we will cover these core concepts:

  1. Getting the essential folder structure in place
  1. Configuring the loader and .htaccess files
  1. Using controllers and views
  1. Hooking your app to a DB and using models
  1. Handling custom routes

This book is divided into Sprints to encapsulate core concepts into small, concrete deliverables. So, lets get busy and build the simplest possible Phalcon app.

Sprint 1 - Installing Phalcon

Before proceeding to install, I suggest you look for the latest options at https://phalconphp.com

The first step in creating a Phalcon app is to actually have it installed on your machine. Phalcon does not come with the default PHP installation, and as I am writing this recipe, none of the major hosting companies that I know of have as a default.

I have personally installed it on three different versions of Mac OS, installed it for MAMP and installed it on a variety of different Unix platforms within AWS/EC2 instances (Linux/RHEL and Ubuntu). I found that it was fairly straightforward, but you should follow the installation steps to the letter.

Be advised, this installation information is mostly derived directly from Phalcons site at https://phalconphp.com .

Install on Windows

To install Phalcon on Windows:

  1. Start here: https://phalconphp.com/en/download/windows
  1. Download Phalcon for Windows
  1. Extract the DLL file and copy it to your PHP extensions directory
  1. Edit your php.ini file and add this line: extension=php_phalcon.dll
  1. Finally, restart your webserver
Install in Linux/Unix/Mac
Ubuntu 14.04+

To install Phalcon on Ubuntu you need to follow these steps:

sudo apt-add-repository ppa:phalcon/stable

sudo apt-get update

sudo apt-get install php5-phalcon

You will need these dependencies to compile Phalcon into a PHP binary (phalcon.so):

sudo apt-get install php5-dev php5-mysql gcc libpcre3-dev

If you are missing apt-add-repository run the following command:

sudo apt-get install software-properties-common

Important - See compile notes below

Fedora

sudo yum install php-devel php-mysqlnd gcc libtool

Important - See compile notes below

RHEL

sudo yum install php-devel php-mysql gcc libtool

Important - See compile notes below

Suse

yast2 -i php5-pear php5-devel php5-mysql gcc

Important - See compile notes below

Mac OS X

MAMP

I found it rather easy to get Phalcon up and running for MAMP following the instructions at: https://github.com/majksner/php-phalcon-mamp .

Using Homebrew

  1. brew tap homebrew/dupes
  1. brew tap homebrew/versions
  1. brew tap homebrew/php
  1. brew install php5x php5x-phalcon # Where "x" - minor number of PHP
Compiling for your Linux platform

You will need to compile Phalcon to generate a binary extension (phalcon.so) for your PHP installation. Issue these commands from your terminal (or command line) to generate the binary extension for your platform:

git clone git://github.com/phalcon/cphalcon.git

cd cphalcon/build

sudo ./install

Add the extension to your php.ini :

extension=phalcon.so

Finally, restart the webserver.

Install for cPanel

The cPanel developers have released a custom module that allows for installation of Phalcon in cPanel hosted sites. Information can be found here:

https://github.com/thecpaneladmin/EA-PhalconPHP

Although Phalcon does not binary link to other extensions, it does use some of them to offer functionality. The extensions used are:

  1. mbstring
  1. mcrypt
  1. openssl
  1. PDO
  1. PDO/Mysql
  1. PDO/Postgresql
  1. PDO/Sqlite
  1. PDO/Oracle
  1. Mongo

It is not necessary for all the above extensions to be present in the system that has Phalcon installed. You can only install the ones that meet your needs. For instance if you use a MySQL database, then you can only load PDO and PDO/MySQL ignoring the Oracle, SQlite, Postgresql and Mongo.

Verify your installation

Create a small PHP script to display PHPinfo and execute it in your browser:

Verify that you see a section for Phalcon in the list of settings. For my installation, I see this:

CONGRATS - You are done with Sprint 1 Sprint 2 - A Hello World app Our first - photo 1

CONGRATS - You are done with Sprint 1

Sprint 2 - A Hello World app

Our first Sprint will get you up and running with the famous Hello World app. The main goals of this Sprint are to install essential folder structure and get a working response from the app by going to the apps home page.

Essential Folders and Files

Lets get our Sprint kicked off by installing the core folder structure. We will also add a few empty files just so I can talk about why they are needed before you actually start writing code. This is the fastest way to get into the underlying thinking of the Phalcon framework.

Create a project folder

Open a terminal window and go into your development directory. We will make a new folder where we want to store the app. Name it whatever you want, but if you are doing this for the first time, you may want to use my naming convention so you do not get lost.

I like to put all of my projects in a folder called Development off my main user folder. You should put your projects wherever works best for you, and it will be obvious where you can replace your folder names with mine.

cd Development

mkdir phalcon-starter

cd phalcon-starter

Remember, the Development folder is my personal location. Please use the one that works best for you.

Create your essential folders

The convention in Phalcon is to store all of your application files (controllers, models, views, configs, etc) in a folder called app and all of your publicly accessible files such as CSS, JS and images in a folder called public .

cd phalcon-starter

mkdir app

mkdir public

Create your APPs MVC folders

Phalcon is based on the Model-View-Controller (MVC) pattern for separating the core aspects of an application. Lets create the following folders under your app folder:

cd phalcon-starter/app

mkdir controllers

mkdir models

mkdir views

Controllers

Controllers hold the application logic for your app. Controllers are where you put actions that handle user interaction and determine the appropriate UI to respond back to the user. Controllers can also be used to check for member credentials, post form data, format JSON responses, handle errors and so forth.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners»

Look at similar books to Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners»

Discussion, reviews of the book Creating a Barebones Phalcon App: A simple step-by-step recipe for beginners and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.