Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Nette Framework: First Impressions
Jun 23, 2015 @ 09:41:33

The SitePoint PHP blog has a new article posted with some first impressions of the Nette framework, a larger but not often talked about PHP framework that showed up in their framework survey results in third place.

SitePoint’s PHP channel conducted its annual survey on the most popular framework of 2015 and the results were discussed here. We saw some familiar names: Laravel, Symfony2, Phalcon, Silex, Slim, etc. But wait, what is this: Nette? According to the survey result, it ranked number 3 in both “at Work” and “in Personal Projects”, just tailing the two giants: Laravel and Symfony2.

I had never heard of this framework before the survey results got published. A framework so popular is worth looking into. Thus, in this article, we will take a look at Nette, see what it can do and discuss some of the features.

The Nette framework is a "set of decoupled and reusable PHP components" that combine into a complete framework (including templating, error tracing and unit testing integration). He follows along with their Getting Started guide and helps you get a demo application copy up and running (via Composer). He then goes through the project structure, the "Adminer" tool, route handling, controllers/actions and the "Latte" templating engine. He also covers basic security functionality and some other interesting features like the "Tracy" debugger and the use of the integrated unit test functionality.

tagged: nette framework first impression overview demo project tutorial

Link: http://www.sitepoint.com/nette-framework-first-impressions/

Christoph Rumpel:
Hello world, I am Laravel (5)
Apr 24, 2015 @ 12:46:22

With Laravel 5 out in the wild, you may be wondering what this new version has to offer either as someone already using the framework or brand new. In this recent post from Christoph Rumpel you can find out some of the highlights of this new release along with some code samples to illustrate.

So there is this thing called Laravel. You may have heard of it already, but you're not sure what it is actually about? Or you do, but want to know more about it and its great new features in version 5? Great, this post is especially for you! Laravel is at the same time one of the youngest and most popular PHP frameworks out there. So how does this work together? Let us take a closer look at why it is that popular and how it could be of use for you too. We will go through the main functionalities and talk about brand new features in version 5.

He touches on several different topics including: routing, use of the Eloquent ORM, the "artisan" command line tool, controllers, migrations and form request handling. Each section has some example code and a brief description of the feature. Obviously the Laravel documentation is a much more complete resource for each of these topics, but at least this gives you a feel for the framework and what it can do.

tagged: introduction laravel5 framework version features overview

Link: http://christoph-rumpel.com/2015/04/hello-world-i-am-laravel/

ServerGrove Blog:
Symfony2 components overview: OptionsResolver
Apr 23, 2015 @ 08:23:32

The ServerGrove blog has posted another in their spotlights on specific Symfony2 components. In this latest post they look at the OptionsResolver component.

In the 13th post of the Symfony2 components series we will be talking about one little but extremely useful component: OptionsResolver. This component helps us to reduce the boilerplate code required to create an options system with default parameters. As stated in the official docs, is array_replace on steroids.

They start with a common situation, wanting to use options from user input, but only if they exist, and otherwise provide a default. This includes the use of the array_replace function but with the OptionsResolver there's an even easier way. A simple example is included showing how to use it to define options (and throw an exception when an undefined one is set). They show how to use a closure to set defaults on a specific option with more complex logic and how to use the validation and normalization handling.

tagged: optionsresolver component symfony2 overview options

Link: http://blog.servergrove.com/2015/04/13/symfony2-components-overview-optionsresolver/

ServerGrove Blog:
Symfony2 components overview: Filesystem
Apr 22, 2015 @ 10:29:32

The ServerGrove blog has posted another in their series of Symfony2 component spotlights with a look at the Filesystem component.

The 15th post of the Symfony2 components series is focused on the Filesystem component, which provides some basic utilities to work with the filesystem. It extends PHP built-in functions such as mkdir() or copy() to make them more portable and easier to use and test.

They start by stating the common problems with working in the file system from PHP and the warnings/errors that can come with them. They show how this kind of thing can be prevented with the Filesystem component and the functionality it provides. They also list some of the other useful functions (besides mkdir and touch previous mentioned) including: chmod, rename, makePathRelative and mirror. They also briefly mention the file locking ability the component has to prevent issues with multiple services interacting with the same files.

tagged: symfony2 component overview filesystem introduction

Link: http://blog.servergrove.com/2015/04/22/symfony2-components-overview-filesystem/

ServerGrove Blog:
Symfony2 components overview: Stopwatch
Mar 17, 2015 @ 11:12:40

The ServerGrove blog has returned with another of their overviews of a specific Symfony2 component. In this new article they talk about the Stopwatch component, a useful way to help in profiling execution of your application.

It’s been a long wait, but we are back again with the Symfony2 components series. In the 12th post of the series, we cover the Stopwatch component. Even though is one of the smallest ones, that does not mean is not important, as plays a crucial role when we want to profile our code.

Since the article series is about working with the component individually, they show you how to get it installed via Composer by itself. They include a simple example of it in use, starting/stopping a "test" timer, getting the duration and getting the overall memory consumption. They also include a slightly more complex example timing the execution of a Fibonacci sequence, reporting back the execution time on each line of output. The article also covers other features like the "lap" method, sections for grouping events and the difficulties you'd have extending it.

tagged: symfony2 component overview stopwatch introduction

Link: http://blog.servergrove.com/2015/03/16/symfony2-components-overview-stopwatch/

Pascal Martin:
In favor of RFC "Scalar Type Hints"
Feb 09, 2015 @ 09:40:18

Pascal Martin has a new post today sharing some of his thoughts around one of the currently proposed PHP RFCs for < href="http://blog.pascal-martin.fr/post/in-favor-of-rfc-scalar-type-hints.html">scalar type hinting. PHP has had type hints for custom objects and some things like arrays but this proposal would add in additional ones for things like "string", "int" and "float".

The Scalar Type Hints RFC for PHP 7 has first been initialized in December 2014. It went on with version 0.2 at the middle of January 2015, after changing several major ideas, and is now in version 0.3, integrating return types, as RFC Return Type Declarations has been accepted a few days ago. [...] I’ve been following this RFC (and the previous ones) with some interest, and, as I’ve taken some time to play with it a bit last week, building PHP from the sources of the corresponding Git branch, I’ll try summarizing here why I think it is interesting. Please note this is my personal opinion.

He starts with a look at what the proposal entails around these new scalar type hints and why he thinks they're a good idea. He looks at some of the things that PHP's current weak typing allows and how it has made the language very flexible as a result. He also shows how the proposal suggests the use of the "declare" function to define a strict typing constant to essentially turn on the checking only where needed. He provides a few code snippet example including object/method handling, setting a custom error handler and which of the calls work in which typing method. He finishes the post looking at the "per-file" idea of enabling the strict typing checks and some of his confusion around the point. He also talks about return types, the directives that are proposed to enable the feature and the current status of the RFC.

tagged: scalar type hint rfc summary proposal php7 opinion overview

Link: http://blog.pascal-martin.fr/post/in-favor-of-rfc-scalar-type-hints.html

Joshua Thijssen:
Deepdive into the symfony2 security component: part 1
Oct 20, 2014 @ 10:26:33

On the latest post on his site Joshua Thijssen has kicked off a series taking a deep dive into the Symfony security component, a key piece in the security of Symfony-based applications. In this first part of the series he introduces the component and starts in on some of the features it offers.

Once in a while I like diving into code and see how things work under the hood. And as the symfony2 framework consists of many different components, bundles and bridges, there is a lot to discover. But ultimately, the code itself mostly isn’t really as complex as it might seem from the outside world: just like a good magic trick, once unraveled, it all seems very simple and makes sense.

However, this is not true for one of those components: the security component. This black box full of dark magic doesn’t like to give up its secrets, and after some (miserably) failed attempts, I am trying to unravel it once more in a few blog posts. Either we achieve complete victory, or fail yet again.. At this point, I will give both fair odds.

He starts off with an overview of the component, pointing out the two main things is handles: authentication and authorization. He also pulls in a few other things to do with security in Symfony to give a more complete, well rounded picture - the component itself, the security bundle and security bridges. He gets into a bit more detail about this last one and describes their specific use.

tagged: symfony security bundle component overview deepdive series part1

Link: https://www.adayinthelifeof.nl/2014/10/19/deepdive-into-the-symfony2-security-component-part-1/

NetTuts.com:
Understanding and Working with Data in WordPress
Jul 29, 2014 @ 11:28:05

On NetTuts.com there's a new post for those new to WordPress (or just wanting to figure out more about the internals of the tool) showing how some of the data is structured and how to work with it.

Most WordPress users never come into direct contact with the database and may not even be aware that it's constantly working to populate their site. When WordPress serves up any kind of page, be that the home page, a single post or page or an archive, it's accessing the database to bring up content that editors and administrators have added to the site. In this series of tutorials I'll look in detail at different aspects of the WordPress database.

This post is the first in the series and provides an overview of the database and what kinds of information each one contains. They talk about content types and provide the table structure and relations in a handy graphical form (an ERD). They then go through each of the tables and describe what the data is including link tables, joining the content in different places.

tagged: data wordpress introduction database table erd overview

Link: http://code.tutsplus.com/tutorials/understanding-and-working-with-data-in-wordpress--cms-20567

Developer's Lane:
Top 20 CakePHP Interview Questions and Answers
Jul 04, 2014 @ 13:48:25

The Developer's Lane site has posted a top ten list of questions answered about the CakePHP framework. The idea is that they could be used as a part of an interview to see how well the candidate knows the framework.

Here there are many questions and answers about How CakePHP Framework works? and basic questions related to CakePHP framework functionality.

Questions include:

  • What are are drawbacks of Cakephp?
  • What is the name of Cakephp database configuration file name and its location?
  • What are commonly used components of Cakephp?
  • Why does Cakephp have two vendor folders?
  • Can you remember what is the directory structure when you download Cakephp?

The questions provide a good overview of the framework, but won't tell you if the developer is any good...you still need to figure out that one on your own.

tagged: cakephp framework interview questions developer overview

Link: http://www.developerslane.com/top-20-cakephp-interview-questions-and-answers/

SitePoint PHP Blog:
Announcing PHP Summer Camp
Jun 17, 2014 @ 11:22:07

The SitePoint PHP blog has a new post officially announcing the PHP Summer Camp, an event being held in Rovinj, Croatia on September 3rd through 6th with a larger focus on Symfony and related technology.

The Summer Camp is a two-in-one type of event that focuses on practical workshops and training. [...] The Summer Camp is the perfect middle ground between conferences and official training camps/academies, lacking the formality but exceeding conference-type gatherings in that one practical regard: unlike conferences, which are often little more than glorified slideshows, attendees go home from PSC with new, practical, usable knowledge that can be applied immediately, because they then have actual hands on experience with everything the speakers talked about.

Since it's happening at the same time and same place as the eZ Summer Camp, there'll be a wide range of sessions to choose from. He includes a quick list of some of the topics that'll be covered including Symfony+Behat, using Sylius, REST APIs with Symfony and using the CMF for a CMS. He includes some shots of the location and links to the travel and accommodation information for those interested in attending.

tagged: phpsummercamp14 september rovinj croatia overview comference

Link: http://www.sitepoint.com/announcing-php-summer-camp/