Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

Archive for Czerwiec, 2014

Community News: Packagist Latest Releases for 06.29.2014

Community News: Packagist Latest Releases for 06.29.2014Recent releases from the Packagist:

Source: http://www.phpdeveloper.org/news/21368

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Community News: Packagist Latest Releases for 06.29.2014

Community News: Packagist Latest Releases for 06.29.2014Recent releases from the Packagist:

Source: http://www.phpdeveloper.org/news/21368

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Community News: Packagist Latest Releases for 06.28.2014

Community News: Packagist Latest Releases for 06.28.2014Recent releases from the Packagist:

Source: http://www.phpdeveloper.org/news/21367

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Community News: Packagist Latest Releases for 06.28.2014

Community News: Packagist Latest Releases for 06.28.2014Recent releases from the Packagist:

Source: http://www.phpdeveloper.org/news/21367

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

NetTuts.com: Refactoring Legacy Code: Part 6 – Attacking Complex Methods

NetTuts.com: Refactoring Legacy Code: Part 6 – Attacking Complex Methods

The NetTuts.com site has posted the sixth part in their “Refactoring Legacy Code” series, this time with a focus on the more complex methods. They look at simplifying their contents and testing their various parts (better code coverage). The post is based completely on the contents of the previous five in the series, so if you haven’t read up on those do that before starting.

In our previous five lessons we invested quite a lot of time in understanding our legacy system, in writing tests for whatever testable piece of code we could find. We reached a point to where we have quite a few tested methods but we still avoided the complex, hard to understand logic. It’s now time for some serious coding.

The start with one of the more complex methods (roll) and work through it line-by-line to figure out what it’s being given, how it’s handling the data and what kinds of things it might return or modify inside. The break it down into to “parts” and figure out the right tests to write for each. With the method fully tested, they then start in on the refactor, teasing out various parts of the method into other methods and property changes. There’s also a section at the end talking about pair programming and how it relates to good testing practices.

Link: http://code.tutsplus.com/tutorials/refactoring-legacy-code-part-6-attacking-complex-methods–cms-21522
Source: http://www.phpdeveloper.org/news/21366

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

NetTuts.com: Refactoring Legacy Code: Part 6 – Attacking Complex Methods

NetTuts.com: Refactoring Legacy Code: Part 6 – Attacking Complex Methods

The NetTuts.com site has posted the sixth part in their “Refactoring Legacy Code” series, this time with a focus on the more complex methods. They look at simplifying their contents and testing their various parts (better code coverage). The post is based completely on the contents of the previous five in the series, so if you haven’t read up on those do that before starting.

In our previous five lessons we invested quite a lot of time in understanding our legacy system, in writing tests for whatever testable piece of code we could find. We reached a point to where we have quite a few tested methods but we still avoided the complex, hard to understand logic. It’s now time for some serious coding.

The start with one of the more complex methods (roll) and work through it line-by-line to figure out what it’s being given, how it’s handling the data and what kinds of things it might return or modify inside. The break it down into to “parts” and figure out the right tests to write for each. With the method fully tested, they then start in on the refactor, teasing out various parts of the method into other methods and property changes. There’s also a section at the end talking about pair programming and how it relates to good testing practices.

Link: http://code.tutsplus.com/tutorials/refactoring-legacy-code-part-6-attacking-complex-methods–cms-21522
Source: http://www.phpdeveloper.org/news/21366

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

NetTuts.com: Refactoring Legacy Code: Part 6 – Attacking Complex Methods

NetTuts.com: Refactoring Legacy Code: Part 6 – Attacking Complex Methods

The NetTuts.com site has posted the sixth part in their “Refactoring Legacy Code” series, this time with a focus on the more complex methods. They look at simplifying their contents and testing their various parts (better code coverage). The post is based completely on the contents of the previous five in the series, so if you haven’t read up on those do that before starting.

In our previous five lessons we invested quite a lot of time in understanding our legacy system, in writing tests for whatever testable piece of code we could find. We reached a point to where we have quite a few tested methods but we still avoided the complex, hard to understand logic. It’s now time for some serious coding.

The start with one of the more complex methods (roll) and work through it line-by-line to figure out what it’s being given, how it’s handling the data and what kinds of things it might return or modify inside. The break it down into to “parts” and figure out the right tests to write for each. With the method fully tested, they then start in on the refactor, teasing out various parts of the method into other methods and property changes. There’s also a section at the end talking about pair programming and how it relates to good testing practices.

Link: http://code.tutsplus.com/tutorials/refactoring-legacy-code-part-6-attacking-complex-methods–cms-21522
Source: http://www.phpdeveloper.org/news/21366

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

SitePoint PHP Blog: Stress-test your PHP App with ApacheBench

SitePoint PHP Blog: Stress-test your PHP App with ApacheBench

In this recent post to the SitePoint PHP blog Bruno Skvorc looks at using a popular tool from the Apache project, Apache Bench (or just “ab”) to stress-test your application.

There’s no telling when your app might attract a throng of visitors at once. [...] Regardless of the reason, massive influxes of visitors are a double-edged sword: they get you what you always wanted – a chance to prove your worth to a large chunk of the internet’s population – but also often bring with them what you always feared: absolute downtime. [Some] platforms usually offer plugins that can optimize your application while it’s up, so you can fine tune it as you go along, but why not try and predict issues while still developing locally and save yourself time, money and effort in the long run?

He bases the testing off of a Laravel Homestead virtual machine instance and tests a simple “hello world” PHP page to minimize any overhead from other processing. He includes the commands to make a simple ab request and mentions the kinds of request it provides on completion. He moves on from there to something a bit more complex – an actual Laravel-based application using the default “HomeController” and “showWelcome” action/view combination.

Link: http://www.sitepoint.com/stress-test-php-app-apachebench/
Source: http://www.phpdeveloper.org/news/21365

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

PHPClasses.org: Lately in PHP Podcast #48 – To TDD or Not TDD?

PHPClasses.org: Lately in PHP Podcast #48 – To TDD or Not TDD?

On the PHPClasses.org site today Manuel Lemos has released the latest episode in their “Lately in PHP” podcast series: Episode #48 – To TDD or Not TDD?.

Lately the debate about whether you should use TDD or not in all software projects all the time has been very intense. [...] They also talked about the upcoming end of life release of PHP 5.3, getting information of parameter type hinting with reflection, using object methods on native data types, security problems of OAuth implementations, and the built-in support of Composer to access password protected repositories.

You can listen to this latest episode either through the in-page audio player, by downloading the mp3 or you can watch the live recording over on the PHPClasses YouTube playlist. A transcription of the recording is also provided as well as links to some of the topics mentioned.

Link: http://www.phpclasses.org/blog/post/239-To-TDD-or-Not-TDD–Lately-in-PHP-podcast-episode-48.html
Source: http://www.phpdeveloper.org/news/21364

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Master Zend Framework: Change Layout in Controllers and Actions in Zend Framework 2

Master Zend Framework: Change Layout in Controllers and Actions in Zend Framework 2

Matthew Setter has a new post to his Master Zend Framework site today showing you how to change layouts in controllers and actions for a Zend Framework v2 based application.

In Zend Framework 2, if you want to change the layout just for one action or for every action in a controller, how do you do it? How do you do it without overriding the layout for every action throughout the entire application? In today’s post, based on an excerpt from Zend Framework 2 for Beginners, we see how to achieve both of these requirements.

He talks about the framework’s use of the two-step view pattern and what the “template_map” definition usually looks like in a default ZF2 application. He shows three different ways to do the view switching from the controller or action:

  • Override the default layout in your module

  • Override the layout per/action
  • Override the layout per/controller

Each of these comes with a bit of code showing you how to make it work. They move from simplest to more complex, with the layout per controller being the most complex. It’s not that it’s difficult, it’s just that there’s more involved to make it work. You can either do it at the controller level or at the module level.

Link: http://www.masterzendframework.com/views/change-layout-controllers-actions-zend-framework-2
Source: http://www.phpdeveloper.org/news/21363

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>