News Feed
Sections




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

SitePoint PHP Blog:
What to Expect from Yii 2.0
September 22, 2014 @ 12:32:17

The SitePoint PHP blog has a new post today from Arno Slatius that talks about some of the features coming in Yii 2.0, a PHP-based MVC framework with a target for a stable release coming very soon.

Yii 2.0 was released into beta last April and the goal for a first stable release was set for the middle of 2014. The GitHub issue list has 300 open issues and 2913 closed while I'm writing this and both numbers are still increasing. The progress to the 2.0RC milestone was at 99%. My guess is that the team is close, but we'll probably have to wait just a little bit longer. While we're all waiting, lets take a look at what we can expect by looking at an already available example.

He starts with a "tiny bit of history" about the framework (its origins, the work done on 2.0) and talks about some of the requirements to get it installed and working. He helps you set up a sample project and shows off the Twitter Bootstrap integration, the debug bar and the "Gii" tool that can help generate code automatically (following the conventions of the framework). He finishes off the post with a look at some of the main things that changed in the 2.0 release including moving some method calls to properties, datetime handling, behavior definitions and model/view updates.

0 comments voice your opinion now!
yii v2 introduction tutorial changes requirement install gii history

Link: http://www.sitepoint.com/expect-yii-2-0/

NetTuts.com:
How to Build Rate Limiting into Your Web App Login
September 22, 2014 @ 11:12:14

In this new tutorial on NetTuts.com, Jeff Reifman shows you how to build rate limiting into your application to help with issues on your login caused by possible brute force attacks.

Since one of the wealthiest corporations in the world [Apple] didn't allocate the resources to rate limit all of their authentication points, it's likely that some of your web apps don't include rate limiting. In this tutorial, I'll walk through some of the basic concepts of rate limiting and a simple implementation for your PHP-based web application.

He starts with a brief look at how (brute force) login attacks actually work and how that relates to the most common passwords used. He splits out the two main approaches to rate limiting in applications: limit based on failures by username or limiting by IP address. He then gets into the actual code examples, choosing a Yii framework-based application for his illustration. He creates a simple "failed login" database table, shows how to log the attempts and includes a snippet to purge items older than (by default) 120 minutes ago. Finally, he includes the code to check the table and see if the username has too many failures listen and, if so, denies them access.

0 comments voice your opinion now!
rate limiting login application tutorial mysql database

Link: http://code.tutsplus.com/tutorials/how-to-build-rate-limiting-into-your-web-app-login--cms-22133

Halls of Valhalla:
From PHP 5 to 7
September 22, 2014 @ 10:56:32

On the "Halls of Valhalla" site there's a new post the tries to explain the jump from PHP5 to PHP7 and what all that means for the language (and community around it).

Since around 2005 we've heard talk about PHP 6 development. There have even been books sold about it. But where is it? As of July of this year it was decided that there won't be one and that PHP will skip directly to version 7. Why is it skipping to the next major version, and what ever happened with PHP 6? And if we're already jumping to PHP 7, what kinds of features will it have?

They start with a "brief history" of PHP since its inception back in the mid 1990s and follow its evolution at a high level through the years. Then comes the topic of PHP6 and the work that was already being put towards it and integrated Unicode support. It talks about some of the difficulties of this conversion and the delays that ended up happening. Instead, it was decided that things would stay in the PHP 5.x series and 5.3, 5.4 and 5.5 have been created since. The jump to PHP7 came from this vote with several different reasons influencing the decision.

The post finishes with a look at some of the new things that will be coming in PHP7 including major performance improvements, abstract syntax tree functionality and asynchronous programming, allowing for the execution of parallel tasks in the same request.

0 comments voice your opinion now!
php5 php6 php7 community unicode language history features

Link: http://halls-of-valhalla.org/beta/news/from-php-5-to-7,146/

Sameer Borate:
Data cleaning in PHP applications
September 22, 2014 @ 09:41:56

Sameer Borate has a new post today showing the use of a "cleaner" library to help sanitize the data input to your application. In this tutorial he introduces you to Mr Clean, an "extendible PHP Data Cleaner".

Scrubbers or data cleaners are an important part of the data transformation process. Whenever you are involved in some data import or export process, data scrubbers can help you clean and standardize your data elements before storing. There are many libraries that help in sanitizing and cleaning data. One such I recently found is mr-clean; it is a extendible PHP Data Cleaner that you can use in your PHP applications to clean heterogeneous data before storing it in your database or other persistent storage like CSV files.

He walks you through the installation (via Composer) and the creation of an instance of the main "cleaner" object. He then provides a few examples of some data scrubbing features it offers:

  • Basic scrubbing (trim, stripping HTML tags, etc)
  • Booleans
  • Filtering HTML
  • Stripping CSS attributes
  • Nullify
  • Null if repeated
  • Strip Phone Number
  • Pre/Post scrubbing handling

He finishes up the post with a look at creating a custom scrubber class, an "only numeric" handler that replaces any character that's not a number in a string with an empty string (removing it).

0 comments voice your opinion now!
data cleaning mrclean library introduction tutorial

Link: http://www.codediesel.com/data/data-cleaning-in-php-applications/

Community News:
Packagist Latest Releases for 09.22.2014
September 22, 2014 @ 08:00:11

Recent releases from the Packagist:

Community News:
Packagist Latest Releases for 09.21.2014
September 21, 2014 @ 08:05:50

Recent releases from the Packagist:

Community News:
Packagist Latest Releases for 09.20.2014
September 20, 2014 @ 08:01:25

Recent releases from the Packagist:

Reddit.com:
The purpose of a framework
September 19, 2014 @ 12:19:48

In this post over in the /r/PHP community of Reddit.com, there's a question about frameworks. The original poster wonders about the purpose of a framework and if they're a requirement to build any kind of application that's "worthwhile".

I read posts here from time to time, and Laravel and Symphony are mentioned a lot here, and I always get the impression that it is a must to use a framework, to build something worthwhile. A little background on myself is that I've always approached development in a cowboy coding style where I just code. I've made a system where I use the basic mysqli object in PHP for database interaction, and I use Smarty templating system to output the html/css/js. I build my own classes based on what the customer is asking for, and then obviously I make the controller pages calling the classes I made - manipulate the data and output to smarty. What would Symphony help me with - that would be hard to accomplish regularly?

Plenty of answers and opinions are shared in the comments of the post, ranging from:

  • Encouragement for Symfony2 and the development speed it accommodates
  • Building a project without a framework
  • The benefits and downfalls of using MVC and other design patterns you may not fully understand
  • A definition of what a "framework" means outside of the world of MVC

There's also a consensus among several of the posts that one of the major benefits of a framework is to provide an overall decrease in the time to market with the handy features and things it provides out of the box. What do you think? Head over and post some thoughts of your own about frameworks and where they fit in your development.

0 comments voice your opinion now!
framework purpose opinion reddit mvc

Link: http://www.reddit.com/r/PHP/comments/2gub3p/the_purpose_of_a_framework/

SitePoint PHP Blog:
Ardent Laravel Models on Steroids
September 19, 2014 @ 11:54:34

In Ardent, an enhancement to the model system in the Laravel framework that allows for easy configuration of validation rules.

One of the (few) things I don't like about Laravel is that you cannot move the validation code from your controller to your models easily. When I write software I like to apply the "fat models, skinny controllers" principle. So, for me, writing the validation code in the controller is not a good thing. To solve this, I'd like to introduce Ardent, a great package for Laravel 4. To be more precise, Ardent presents itself as "Self-validating smart models for Laravel Framework 4's Eloquent ORM." In other words: exactly what we need!

He introduces the library as a part of a test application, a To-Do list that includes user and task handling. He starts with the creation of the base Laravel migrations to build the tables and the code for the two necessary models. He then shows how to install Ardent and put it to use in the controller code, adding validation rules and messages for each property on failure. He also shows how to use the model auto-hydration and hooks to make working with the models even easier. He finishes off the post showing how to set up relations "the Ardent way" using a slightly different format as the usual Laravel handling.

0 comments voice your opinion now!
laravel model ardent library tutorial introduction

Link: http://www.sitepoint.com/ardent-laravel-models-steroids/

PHP.net:
PHP 5.4.33 Released
September 19, 2014 @ 10:18:06

The PHP development group has officially release the latest in the PHP 5.4.x series today - PHP 5.4.33. This is largely a bugfix release, but all users are encouraged to update to this latest version.

The PHP development team announces the immediate availability of PHP 5.4.33. 10 bugs were fixed in this release. All PHP 5.4 users are encouraged to upgrade to this version. This release is the last planned release that contains regular bugfixes. All the consequent releases will contain only security-relevant fixes, for the term of one year. PHP 5.4 users that need further bugfixes are encouraged to upgrade to PHP 5.6 or PHP 5.5.

Updates in this release include bugs fixed in the OpenSSL handling, the GD graphics functionality and the language core. As always, the latest source for this version can be downloaded from the main downloads page or from windows.php.net for Windows users. If you're in interested in the full set of changes, check out the Changelog for the release.

0 comments voice your opinion now!
language release bugfix update

Link: http://php.net/index.php#id2014-09-18-2


Community Events





Don't see your event here?
Let us know!


tips language voicesoftheelephpant list code deployment podcast api bugfix conference framework series community release laravel symfony zendserver interview introduction threedevsandamaybe

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework