News Feed
Sections




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

NetTuts.com:
Programming With Yii2 Validations
May 27, 2015 @ 11:41:37

NetTuts.com has continued their series around developing applications with the Yii2 framework with this new post covering validations.

In this Programming With Yii2 series, I'm guiding readers in use of the newly upgraded Yii2 Framework for PHP. In this tutorial, I'm going to introduce you to Yii2's validators. Validators simplify the code needed to validate input, i.e. verify conformance or non-conformance of data input, typically from users via web forms. For these examples, we'll continue to leverage the Hello application codebase we've used in past tutorials. Use the GitHub links on this page to get the code.

They start with a brief look at what the validators are and some common uses (and how they can save you time in the long run). There's a list of the current validators included in the framework and how/where they fall in the overall process flow. Then the tutorial gets into the application of a validator, showing how to define the rules, display errors associated with them and application to a "Sample" model and form. This includes the use of the FilterValidator, DefaultValueValidator and SafeValidator.

0 comments voice your opinion now!
yii2 series tutorial programming validators

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-validations--cms-23418

QaFoo Blog:
Developers Life is a Trade-Off
May 27, 2015 @ 10:57:57

In a new post from the QaFoo blog they talk about a developer's life as a trade-off, the amount of work to put into one technology or approach before deciding it's not worth the trouble and moving on.

At Qafoo, we train a lot of people on topics like object oriented software design, automated testing and more. [...] There is no silver bullet and one of the most important skills every developer needs to hone is to assess possibilities and to find the best trade-off for the current challenge.

He uses personal experience to illustrate the point, a struggle they had with choosing a storage system for their application's data. While one technology seemed to be an ideal fit (Cassandra) the trouble it caused made them fall back to something more reliable. He also talks about another instance where he had to make a decision around using a state machine...or not, because of the overhead and time consumed around it.

One of the most important tasks of a developer is to make trade-offs. They occur wherever you look in your every day life. It is a highly important step to realize and accept this. And it is important to hone that skill. You need to open your mind for new technology and techniques, learn and try them wherever you can. But then you need to step back, analyze the current situation and then find the best trade-off between all possible approaches.
0 comments voice your opinion now!
developer life opinion technology tradeoff decision

Link: http://qafoo.com/blog/075_developers_life_trade_off.html

Christopher Pitt:
Making Dependable #2 (Series)
May 27, 2015 @ 09:25:01

Christopher Pitt has posted the second part of his series about creating "Dependable", a Laravel-based application with a focus on Composer use and customization. In part one he laid the foundation, creating a new project, database and setting up migrations to create the tables. In part two he builds on this and creates additional functionality to store a GitHub user's repositories.

One of the ideas we've had is to create an application; which can build a custom Composer dependency map, and deploy that to a new server. It would also be great if there was an interface for deciding which dependencies are included, and a unique URL for each installation.

He starts with a brief mention of testing and why he hasn't included that in his current work. Then he gets into the new models for storing repositories and the migration to create the matching table. He also includes the code that will be needed to link a Developer to a Repository. He finishes the post with an endpoint that can be called to refresh the data from GitHub and pull the repository information down and populate it into the database.

0 comments voice your opinion now!
tutorial series part2 dependable laravel github repositories developer

Link: https://medium.com/laravel-5-tutorials/making-dependable-2-36411b64b958

D
May 27, 2015 @ 08:39:26

Hannes Van De Vreken has posted a tutorial to his site showing users of the Symfony Console component how to show progress on a stream using the ProgressBar helper and a bit of code to inspect the stream itself.

With PHP you can, next to handling HTTP requests, invoke scripts from the command line. [...] The Symfony console component is a very useful tool to define and invoke these kind of CLI tasks. [...] What is actually printed on the console is very important for the issuer of the task. Think of it as the command's usability. Too little runtime information, the less usable the task. [...] Enter the ProgressBar. The ProgressBar is an output helper that wraps the OutputInterface object.

He talks briefly about how the ProgressBar helper works in the console component's output and gives a simple example of the output. He then shows how to hook it into a bit of PHP using the stream_notification_callback optional parameter (defined in stream_context_create) to point to another class method that handles the progress bar updates. It performs a bit of introspection on the stream and updates the progress as its contents progress. He does point out a few caveats though, including that the transfer is not made asynchronous by this handling.

0 comments voice your opinion now!
symfony console stream progress progressbar helper tutorial

Link: https://hannesvdvreken.com/2015/05/12/stream-progress/

Community News:
Recent posts from PHP Quickfix
May 27, 2015 @ 07:05:28

Recent posts from the PHP Quickfix site:
0 comments voice your opinion now!



Binary Studio Blog:
Definitive Guide On Creating Custom Providers For Laravel OAuth2 Authorization
May 26, 2015 @ 12:45:12

A new guide has been posted showing you how to create custom OAuth2 providers for your Laravel application. In this case they wanted to hook the application in via Socialite to the VK social network but needed a custom connector to make it happen.

First of all let's say that social authorization is very popular and frankly speaking it's really handy tool. Surfing internet we can see a lot of sites and services which offer login with Facebook, Twitter, Google and other social networks. [...] If you're building your website in PHP using Laravel, probably you've noticed Socialite which provides OAuth / OAuth 2 authentication with Facebook, Twitter, Google, and GitHub. The most famous social network which provides OAuth2 authentication in Russian segment of the internet is vk. But there is a lack of such connector (provider) in Socialite library. Actually it's not a hard problem, so let's build new VkProvider on top of Socialite's components.

He starts with a brief look at the typical OAuth2 authentication flow between the social network and your application. From there it gets more vk.com specific. He shows how to set up the custom application on their side, updating your configuration with the credentials and installing Socialite. He then implements a "VkProvider" defining the required methods based on the interface. He then registers it as a "SocialiteServiceProvider" and uses it in a "login" request route.

0 comments voice your opinion now!
oauth2 guide custom provider laravel socialite tutorial vkcom russian

Link: http://binary-studio.com/2015/05/25/laravel-oauth2/

SitePoint PHP Blog:
Mastering Composer - Tips and Tricks
May 26, 2015 @ 11:02:32

The SitePoint PHP blog has a new tutorial today from editor Bruno Skvorc with some tips and tricks to help you master Composer, the widely popular PHP package management tool.

Composer has revolutionized package management in PHP. It upped the reusability game and helped PHP developers all over the world generate framework agnostic, fully shareable code. But few people ever go beyond the basics, so this post will cover some useful tips and tricks.

Tips in his list include:

  • Installing Composer globally
  • Using "composer require" to install packages
  • Committing your composer.lock file
  • Options to provide profiling information
  • Speeding up Composer installations

...and many more. If you're looking to take your Composer usage and knowledge beyond the basics, definitely check out this article.

0 comments voice your opinion now!
master composer tips tricks advanced list

Link: http://www.sitepoint.com/mastering-composer-tips-tricks/

Kinsta Blog:
HHVM vs PHP 7 - The Competition Gets Closer!
May 26, 2015 @ 10:19:02

In this new post to thier blog Kinsta shares benchmark results comparing PHP 7 to HHVM, both in their own experience and some shared from other companies too.

A few years ago, engineers at Facebook went on a swashbuckling mission to rebuild the foundation of the world's most populated social network struggling to sustain acceptable performance levels. PHP was all the rage a decade ago when Facebook was gaining steam and pursuing a global target audience.

As they put it the "competition is getting closer" and the performance gap between the two is growing smaller and smaller. They talk some about the performance improvements and new features that are being worked into PHP 7 and some speculations around a Just-In-Time engine and asynchronous programming features. Then comes the benchmarks. They provide the specifications of the machine they tested on and the results of tests runs of WordPress and Drupal (based on requests per second). The rest of the article talks about two stories from other companies using HHVM, Etsy and WikiMedia, and some of the lessons that have been learned along the way.

0 comments voice your opinion now!
hhvm php7 performance benchmarks mediawiki etsy wordpress drupal

Link: https://kinsta.com/blog/hhvm-vs-php-7/

Damien Seguy:
Prepare for PHP 7 error messages (Series)
May 26, 2015 @ 09:35:11

For those looking forward to PHP 7, there's a new series of posts from Damien Seguy that can help you with some of the newer error messages and what might be causing them.

The first step to prepare for PHP 7 is to lint it : using the command line instruction 'php -l script.php', one can easily check that every file in a current application compile with PHP 7. The second step is to run the application and the unit tests : in short, execute it with PHP 7. And this is where we'll learn about the new errors that PHP has prepared for us. In order to be one step ahead of the migration, this article will help you prepare here is a panorama on PHP error messages.

In part one he looks at some of the most often raised errors including the incorrect use of "$this" and undefined offsets. Part two gets into a few more complex messages about return type hinting, the constant scalar expression and using temporary expressions in a write context. Finally, part three looks at messaging around redefinition of identical parameters, bit shifting by a negative number, named constructor deprecation and strict typing. Each part of the series covers a few more than just the ones listed here too, so be sure to check each for more helpful error messages and solutions.

0 comments voice your opinion now!
php7 error message help series part1 part2 part3 resolve information

Link: http://www.exakat.io/php-7-error-messages-part-1/



Community Events

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


php7 part2 example interview community laravel symfony2 opinion voicesoftheelephpant application conference library configure series performance podcast api release introduction framework

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