Zend Framework 1 tutorial Part 6: The application bootstrap.php file

Zend Framework 1 Logo

It's time to create a bootstrap file, in the bootstrap we will initialize the application. Open the myapp/application directory and create and empty bootstrap.php file.

For a basic bootstrap I have added a lot of code, that I will explain in the few chapters of this article, but there are several things a haven't added just yet. For example, one thing I haven't included yet is the database initialization as well as the database profiler initialization, I will add that part as soon as we need it.

Zend Framework 1 tutorial Part 5: The index.php file

Zend Framework 1 Logo

Go into the public folder and create a new file called index.php. As I already mentioned in the htaccess chapter, this file receives all the requests and passes them to the Zend Framework which will dispatch them.

Zend Framework's controller uses the frontcontroller design pattern. All requests to the frontcontroller will get rooted through a single entry point, the index.php file.

Zend Framework 1 tutorial Part 4: The application configuration file

Zend Framework 1 Logo

Go into the "application/configs" folder and create a new file called application.ini. We will need this configuration file to setup some default values for our application. We will see in the next tutorial how the index.php loads this file and passes its values to the application class to create an instance.

As you can see below we have three parts in our configuration file, a config setp for the production environment. Another for the testing environment which inherits the values set for the production mode but changes some values. Finally a setup for the development environment which inherits the values from testing mode (and therefore also from production mode) but also changes some values.

Zend Framework 1 tutorial Part 3: The ZF project htaccess file

If you have read the you should have created a public directory and if you installed XAMPP by using the following XAMPP tutorial, this directory will probably be in "C:\xampp\htdocs\myapp\public". Open the "public" folder of your app and create a new file called ".htacess" using your text editor or your IDE. If you can't see the htaccess file in the public folder after creating it, open the view "tab" in the Windows Explorer and enable "File name extensions and Hidden items" by clicking the checkbox next to it.

Adding an environment variable to our htaccess

The first thing we will add to our htaccess file is the environment variable. Our app will have an environment variable which will have three possible values, the first one is "development", the second one is "testing" and the third one is "production". "development" will be the environment type we will use while developing our application. "testing" is the environment variable value we will use while testing of our application and finally "production" is application environment we will use after we have deployed our application on the production server(s).

Zend Framework 1 tutorial Part 2: The directories structure

Zend Framework 1 Logo

My goal was to create a structure that is very easy to understand, flexible enough for big or small websites and not totally different from what books or other guides recommend as a "files and folders structure for a Zend Framework project" best practice.

Another goal was to create a CMS core, which has lots of modules that can be (re)-used on (multiple) other websites. Every module is designed so that it can be copied and put in another project without having to modify any file of that project. The main directory of each module contains all the files it needs to work, I has its own bootstrap, its own configuration files, its views and of course its own models.

Zend Framework 1 tutorial Part 1: Installing and configuring Apache, PHP, MySQL and an IDE

XAMPP: Apache, PHP, MySQL, PHPMyAdmin

This Zend Framework 1 application will be explain how to build a news portal or blogging website using the Zend Framework. But first let's install a development platform and an IDE. If you have already the tools needed you can jump to the next step.

If you prefer to install your development platform on a Mac, I recommend using Mamp (Mac, Apache, MySQL, PHP) or Homebrew (A package manager for OS X that can be used to quickly install MySQL, PHP and Apache).

If you want to install a development platform on Linux, for example on Cent OS 6 you might want to check out my Cent OS 6 Server Setup tutorial.

step 9: install redis (redis.io store)

redis logo

Installation of redis on CentOS 6:

Redis (the redis.io key-value store) is available in the remy repo which depends on the epel repo:

If you didn't already previously add the remi repo to your repositories then follow the following step to do so.

I wanted the remi repo "Enterprise Linux 6 (with EPEL)" package, you may have to use another one depending on your OS and version, i used centos6 and therefore choosed to use the following commands:

WAI-ARIA role taxonomy for Accessible Rich Internet Applications

What are WAI-ARIA roles and what are they good for?

WAI-ARIA roles get used to annotate page elements. One of the goals we want to achieve by using WAI-ARIA roles is to improve accessibility, this means improving the way screen readers parse the document and therefore make it better machine readable so that screen readers can represent the content to the user with text-to-speech, sound icons, or on Braille output device.

Another goal is that we also improve the way search engines consume our content, because if you care about SEO it is never a bad idea to improve the semantic value of your document. If you use the ARIA roles and maybe also the new HTML5 elements you will improve the semantic value of your content. The more we define the structure of our documents the easier it is for a search engines to extract the valuable content. We can therefore also avoid getting penalized because we are tagging the content that is complementary and that is found on each of our pages, by clearly separating it from the more important part of the document.

HTML5: new tag attributes

HTML5 Logo

In previous articles I have tried to explain which new tags HTML5 allows us to use, but there are also lots of new tag attributes that are available, it is at least as important to know those new attributes as it is to know the new HTML5 tags.