https://chris.lu/article/rss
Tue, 22 Jan 2019 02:39:09 +0100chris.lu Online Feed Generatoren-enhttp://blogs.law.harvard.edu/tech/rsshttps://chris.lu/article/read/53807148268c42510d8b4568
https://chris.lu/article/read/53807148268c42510d8b4568Sat, 24 May 2014 12:15:36 +0200https://chris.lu/article/read/531b5e72268c42f0358b4567
https://chris.lu/article/read/531b5e72268c42f0358b4567It'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.

]]>Sat, 08 Mar 2014 19:16:18 +0100https://chris.lu/article/read/531a5350268c42f4358b4567
https://chris.lu/article/read/531a5350268c42f4358b4567Go 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.

]]>Sat, 08 Mar 2014 00:16:32 +0100https://chris.lu/article/read/531397c0268c42ef098b4567
https://chris.lu/article/read/531397c0268c42ef098b4567I have updated my "HTML5 and beyond" slides. I now use the great reveal.js library.

The "HTML5 and beyond slides" are a presentation of HTML5, of other proposals that often get thrown in the HTML5 pot and also an introduction to CSS3.

]]>Sun, 02 Mar 2014 21:42:40 +0100https://chris.lu/article/read/530d17ef268c42490a8b4568
https://chris.lu/article/read/530d17ef268c42490a8b4568Go 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.

]]>Tue, 25 Feb 2014 23:23:43 +0100https://chris.lu/article/read/530bd8d0268c42f0098b4568
https://chris.lu/article/read/530bd8d0268c42f0098b4568If 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).

]]>Tue, 25 Feb 2014 00:42:08 +0100https://chris.lu/article/read/530a4364268c4283538b4567
https://chris.lu/article/read/530a4364268c4283538b4567My 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.

]]>Sun, 23 Feb 2014 19:52:20 +0100https://chris.lu/article/read/530a3136268c42ec098b4569
https://chris.lu/article/read/530a3136268c42ec098b4569This 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.

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:

]]>Sat, 15 Feb 2014 13:22:57 +0100https://chris.lu/article/read/50ce3947268c42b773000001
https://chris.lu/article/read/50ce3947268c42b773000001What 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.

]]>Sun, 16 Dec 2012 22:12:39 +0100https://chris.lu/article/read/50a7848a268c42c17e000007
https://chris.lu/article/read/50a7848a268c42c17e000007In 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.]]>Sat, 17 Nov 2012 13:35:22 +0100https://chris.lu/article/read/50a78343268c42be7e000006
https://chris.lu/article/read/50a78343268c42be7e000006It's good when you know the new HTML5 and use them, but there are also tags that are not supported anymore, you should avoid using them and remove them from your content when you do an update.

Can I use the new HTML5 now?

Yes you can, but you need to use the HTML5shiv javascript for IE lower then version 9, or use modernizr where the HTML5 shiv is built in. The shiv script is a little javascript that enables HTML5 in browsers older then ie9. The advantage of using the new HTML5 right now is the semantic plus they will give you, it's always good to add semantic value to content because it can enhance your SEO quality.

]]>Sun, 21 Oct 2012 19:48:01 +0200https://chris.lu/article/read/50832018268c422808000006
https://chris.lu/article/read/50832018268c422808000006We have just installed Nginx and now we want to host the php application we made. This is when php-fpm comes into play. Since the day i started playing around with php-fpm i loved it. You install php-fpm and then using the powerful configuration files you can setup multiple vhost on a single machine. Each php-fpm pool, can have it's own socket or run on it's own port, you can setup a different user and group for each pool and put as many ftp-users in that group as you want. You can even chroot the directory you as nginx public web directory, have an own php-ini per vhost and therefore also setup a different sessions folder for each pool.

install php5 and php-fpm:

php-fpm (PHP fastCGI process manager) is available in the remy repo which depends on the epel repo:

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:

]]>Sun, 21 Oct 2012 00:05:12 +0200https://chris.lu/article/read/5082b8c8268c422908000004
https://chris.lu/article/read/5082b8c8268c422908000004NGINX is much more then just a server like Apache, that's probably why it gained so much market share over the few last years if you trust the Netcraft server market share statistics.

NGINX has two advantages over Apache, first one is super fast, second one it's consumes less resources then Apache. Those are two important wins in two areas that really matter when having to decide which server to choose when getting started. Nginx is so fast because it's event driven. You may already have seen how javascript uses events and asynchronous loading of data. Nginx is similar to this, it emits a request, but doesn't wait all the time for a response keeping the connection open. Nginx requests something, then closes the connection and does something else. But in the request is a callback. So when the requested data is ready the nginx callback gets called and the response is send through a new connection to nginx. This is why nginx can handle such a lot of connections.

But as i said NGINX is more then just a server. The powerful configuration mechanism lets you setup NGINX to be a proxy server for one or multiple apache servers. You can use it as load balancer for multiple node.js instances or "just" use it as normal server to host your php website. If it's a php website you want to host.