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 Kwiecień, 2012

Site News: Popular Posts for the Week of 04.27.2012

Site News: Popular Posts for the Week of 04.27.2012Popular posts from PHPDeveloper.org for the past week:

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

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

Site News: Popular Posts for the Week of 04.27.2012

Site News: Popular Posts for the Week of 04.27.2012Popular posts from PHPDeveloper.org for the past week:

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

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

Seth May’s Blog: The 5 Ws of Data Validation – Part 1

Seth May’s Blog: The 5 Ws of Data Validation – Part 1

With a reminder about the best practice of always validating your data, Seth May has this new post about the “Five Ws” of validation – why, when, where and who.

As web developers, the applications you write are complex data processing engines. They try and convince your users to enter good, meaningful data and to respond in solid, predictable ways based on what was entered. Robust data validation will allow the rest of you application to work effectively. [...] Data is scrutinized in various ways to make sure that it adheres to basic restrictions and to fundamental properties. It’s no good receiving a sandwich when you expect a car.

The questions he answers are:

  • Why is Data Validation Important?
  • Where Should I be Validating Data?
  • When Should My Data Be Validated?
  • Who is Responsible for Validation?
  • How Do I Validate My Data? (yes, there’s a “w” in there!)

In the real world data is ugly, crazy, and untrustworthy. Your only hope to taming the data beast is to diligently, methodically validate your data.

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

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

Seth May’s Blog: The 5 Ws of Data Validation – Part 1

Seth May’s Blog: The 5 Ws of Data Validation – Part 1

With a reminder about the best practice of always validating your data, Seth May has this new post about the “Five Ws” of validation – why, when, where and who.

As web developers, the applications you write are complex data processing engines. They try and convince your users to enter good, meaningful data and to respond in solid, predictable ways based on what was entered. Robust data validation will allow the rest of you application to work effectively. [...] Data is scrutinized in various ways to make sure that it adheres to basic restrictions and to fundamental properties. It’s no good receiving a sandwich when you expect a car.

The questions he answers are:

  • Why is Data Validation Important?
  • Where Should I be Validating Data?
  • When Should My Data Be Validated?
  • Who is Responsible for Validation?
  • How Do I Validate My Data? (yes, there’s a “w” in there!)

In the real world data is ugly, crazy, and untrustworthy. Your only hope to taming the data beast is to diligently, methodically validate your data.

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

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

DZone.com: Testing PHP scripts

DZone.com: Testing PHP scripts

In this new post to DZone.com, Giorgio Sironi talks about a method of testing that’s non-invasive when you’re in a chicken-and-egg kind of situation:

The legacy code dilemma, however, is always present: you can’t refactor the code before putting up some tests on it to avoid regressions and putting your application offline. At the same time, you can’t easily unit test the code until some refactoring is introduced.

He suggests making copies of some files to allow you to make small changes where needed to “mock” resources in the application to prevent it from accessing the actual data sources. His method fakes HTTP requests to the script and uses the copy of the script as an internal resource. Don’t worry, code is included showing how its done – a basic “ForumPosting” class that includes the needed file and wraps the output in a buffer.

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

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

DZone.com: Testing PHP scripts

DZone.com: Testing PHP scripts

In this new post to DZone.com, Giorgio Sironi talks about a method of testing that’s non-invasive when you’re in a chicken-and-egg kind of situation:

The legacy code dilemma, however, is always present: you can’t refactor the code before putting up some tests on it to avoid regressions and putting your application offline. At the same time, you can’t easily unit test the code until some refactoring is introduced.

He suggests making copies of some files to allow you to make small changes where needed to “mock” resources in the application to prevent it from accessing the actual data sources. His method fakes HTTP requests to the script and uses the copy of the script as an internal resource. Don’t worry, code is included showing how its done – a basic “ForumPosting” class that includes the needed file and wraps the output in a buffer.

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

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

PHPMaster.com: An Intro to Virtual Proxies, Part 2

PHPMaster.com: An Intro to Virtual Proxies, Part 2

Following up on his previous article, Alejandro Gervasio has a new post to PHPMaster.com with the second part of his series on using virtual proxies in PHP.

Resting on the foundation of Polymorphism (dynamic Polymorphism, not the ad-hoc one often achieved through plain method overriding), Virtual Proxies are a simple yet solid concept which allows you to defer the construction/loading of expensive object graphs without having to modify client code.

He shows how to create a collection of domain objects that use proxies to populate their data. He includes the code for creating a “Post” interface/object as well as a Comment interface/object. These are put into a “CommentCollection” and, when it’s accessed, pull the item in the collection out, only populating the data on demand.

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

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

PHPMaster.com: An Intro to Virtual Proxies, Part 2

PHPMaster.com: An Intro to Virtual Proxies, Part 2

Following up on his previous article, Alejandro Gervasio has a new post to PHPMaster.com with the second part of his series on using virtual proxies in PHP.

Resting on the foundation of Polymorphism (dynamic Polymorphism, not the ad-hoc one often achieved through plain method overriding), Virtual Proxies are a simple yet solid concept which allows you to defer the construction/loading of expensive object graphs without having to modify client code.

He shows how to create a collection of domain objects that use proxies to populate their data. He includes the code for creating a “Post” interface/object as well as a Comment interface/object. These are put into a “CommentCollection” and, when it’s accessed, pull the item in the collection out, only populating the data on demand.

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

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

Kevin Schroeder’s Blog: ZF2 Dependency Injection: Managing Configuration – Part 1

Kevin Schroeder’s Blog: ZF2 Dependency Injection: Managing Configuration – Part 1

Kevin Schroeder has a new post talking about dependency injection in a Zend Framework v2-based application and managing your configurations.

In my previous blog post I showed how you could provide parameters to object that you’re pulling from a DiC and have them populated in the resulting object. As cool as that is, it’s not a massive saving as you need to manually inject the parameters into the DiC. You can often do the same thing by setting up the DiC ahead of time to get the object with those parameters pre-set.

He defines a class (Test) and shows how you can replace the DI container example with a ZendDiConfiguration object that contains the config options. He shows how to use this newly created container to access an instance of this “Test” class.

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

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

Kevin Schroeder’s Blog: ZF2 Dependency Injection: Managing Configuration – Part 1

Kevin Schroeder’s Blog: ZF2 Dependency Injection: Managing Configuration – Part 1

Kevin Schroeder has a new post talking about dependency injection in a Zend Framework v2-based application and managing your configurations.

In my previous blog post I showed how you could provide parameters to object that you’re pulling from a DiC and have them populated in the resulting object. As cool as that is, it’s not a massive saving as you need to manually inject the parameters into the DiC. You can often do the same thing by setting up the DiC ahead of time to get the object with those parameters pre-set.

He defines a class (Test) and shows how you can replace the DI container example with a ZendDiConfiguration object that contains the config options. He shows how to use this newly created container to access an instance of this “Test” class.

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

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