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 Październik, 2014

SitePoint PHP Blog: PHP and RabbitMQ: Advanced Examples

SitePoint PHP Blog: PHP and RabbitMQ: Advanced Examples

On the SitePoint PHP blog Miguel Ibarra Romero continues his series looking at the use of RabbitMQ with PHP in part two. He builds on the code (and setup) from the first part of the series and gets into some more advanced examples this time.

In part 1 we covered the theory and a simple use case of the AMQP protocol in PHP with RabbitMQ as the broker. Now, let’s dive into some more advanced examples.

The remainder of the post includes two examples of more advanced operations:

  • Example 1: send request to process data asynchronously among several workers

  • Example 2: send RPC requests and expect a reply

Each example includes a diagram of the overall flow of the process, the code to make it happen both for the sender and receiver.

Link: http://www.sitepoint.com/php-rabbitmq-advanced-examples/
Source: http://www.phpdeveloper.org/news/21857

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

NetTuts.com: Design Patterns: The Facade Pattern

NetTuts.com: Design Patterns: The Facade Pattern

NetTuts.com has continued their series covering common design patterns and their implementation in some example PHP scripts today. In their latest post they focus on the Facade pattern, a member of the “structural” family of patterns.

When it comes to design patterns, you may have questions: Why should we use design patterns in programming? Our code can work just fine without it. [...] Code that employs design patterns is easy to understand, easy to maintain, and easy to extend.[...] In this tutorial, we are going to cover the facade design pattern. It falls under the category of structural patterns because it deals with how your code should be structured to make it easily intelligible and keep it well maintained in the long term.

They start with a UML layout of a typical Facade and include a typical problem/solution where it could be used. They get into a code example that creates a simple checkout process. In this process, they use the Facade pattern to create a more maintainable, extensible ordering workflow.

Link: http://code.tutsplus.com/tutorials/design-patterns-the-facade-pattern–cms-22238
Source: http://www.phpdeveloper.org/news/21856

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

NetTuts.com: Design Patterns: The Facade Pattern

NetTuts.com: Design Patterns: The Facade Pattern

NetTuts.com has continued their series covering common design patterns and their implementation in some example PHP scripts today. In their latest post they focus on the Facade pattern, a member of the “structural” family of patterns.

When it comes to design patterns, you may have questions: Why should we use design patterns in programming? Our code can work just fine without it. [...] Code that employs design patterns is easy to understand, easy to maintain, and easy to extend.[...] In this tutorial, we are going to cover the facade design pattern. It falls under the category of structural patterns because it deals with how your code should be structured to make it easily intelligible and keep it well maintained in the long term.

They start with a UML layout of a typical Facade and include a typical problem/solution where it could be used. They get into a code example that creates a simple checkout process. In this process, they use the Facade pattern to create a more maintainable, extensible ordering workflow.

Link: http://code.tutsplus.com/tutorials/design-patterns-the-facade-pattern–cms-22238
Source: http://www.phpdeveloper.org/news/21856

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

NetTuts.com: Design Patterns: The Facade Pattern

NetTuts.com: Design Patterns: The Facade Pattern

NetTuts.com has continued their series covering common design patterns and their implementation in some example PHP scripts today. In their latest post they focus on the Facade pattern, a member of the “structural” family of patterns.

When it comes to design patterns, you may have questions: Why should we use design patterns in programming? Our code can work just fine without it. [...] Code that employs design patterns is easy to understand, easy to maintain, and easy to extend.[...] In this tutorial, we are going to cover the facade design pattern. It falls under the category of structural patterns because it deals with how your code should be structured to make it easily intelligible and keep it well maintained in the long term.

They start with a UML layout of a typical Facade and include a typical problem/solution where it could be used. They get into a code example that creates a simple checkout process. In this process, they use the Facade pattern to create a more maintainable, extensible ordering workflow.

Link: http://code.tutsplus.com/tutorials/design-patterns-the-facade-pattern–cms-22238
Source: http://www.phpdeveloper.org/news/21856

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

Qandidate.com Blog: Using the Accept Header to version your API

Qandidate.com Blog: Using the Accept Header to version your API

On the Qandidate.com blog today there’s a new tutorial talking about the use of the Accept header in REST HTTP requests and, more specifically, working with it in a Symfony-based application.

I investigated different ways to version a REST API. Most of the sources I found, pretty much all said the same thing. To version any resource on the internet, you should not change the URL. The web isn’t versioned, and changing the URL would tell a client there is more than 1 resource. [...] Another thing, and probably even more important, you should always try to make sure your changes are backwards compatible. That would mean there is a lot of thinking involved before the actual API is built, but it can also save you from a big, very big headache. [...] Of course there are always occasions where BC breaks are essential in order to move forward. In this case versioning becomes important. The method that I found, which appears to be the most logical, is by requesting a specific API version using the Accept header.

He shows how to create a “match request” method in his custom Router that makes use of the AcceptHeader handling to grab the header data and parse it down into the type and API version requested. He also includes an example of doing something similar in the Symfony configuration file but hard-coding the condition for the API version by endpoint.

Link: http://labs.qandidate.com/blog/2014/10/16/using-the-accept-header-to-version-your-api/
Source: http://www.phpdeveloper.org/news/21855

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

Qandidate.com Blog: Using the Accept Header to version your API

Qandidate.com Blog: Using the Accept Header to version your API

On the Qandidate.com blog today there’s a new tutorial talking about the use of the Accept header in REST HTTP requests and, more specifically, working with it in a Symfony-based application.

I investigated different ways to version a REST API. Most of the sources I found, pretty much all said the same thing. To version any resource on the internet, you should not change the URL. The web isn’t versioned, and changing the URL would tell a client there is more than 1 resource. [...] Another thing, and probably even more important, you should always try to make sure your changes are backwards compatible. That would mean there is a lot of thinking involved before the actual API is built, but it can also save you from a big, very big headache. [...] Of course there are always occasions where BC breaks are essential in order to move forward. In this case versioning becomes important. The method that I found, which appears to be the most logical, is by requesting a specific API version using the Accept header.

He shows how to create a “match request” method in his custom Router that makes use of the AcceptHeader handling to grab the header data and parse it down into the type and API version requested. He also includes an example of doing something similar in the Symfony configuration file but hard-coding the condition for the API version by endpoint.

Link: http://labs.qandidate.com/blog/2014/10/16/using-the-accept-header-to-version-your-api/
Source: http://www.phpdeveloper.org/news/21855

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

Laravel Podcast: Episode 18 – Laravel 5 Routing, the War over PHP Annotations, and The Secret Weapon

Laravel Podcast: Episode 18 – Laravel 5 Routing, the War over PHP Annotations, and The Secret Weapon

The Laravel Podcast has released their latest episode, Episode #18: Laravel 5 Routing, the War over PHP Annotations, and The Secret Weapon(tm). Join hosts Shawn McCool, Taylor Otwell and Jeffrey Way as they talk all things Laravel.

In this episode, we discuss new Laravel 5 features including annotated routing and middlewares. We discuss some motivations and guiding forces that make Laravel what it is. Also, hints about Jeffrey and Taylor’s secret new project. The referenced article by @everzet can be found here: http://everzet.com/post/99045129766/introducing-modelling-by-example.

You can listen to this latest episode either by using the in-page audio player, by downloading the mp3 or by subscribing to their feed.

Link: http://www.buzzsprout.com/11908/212256-episode-18-laravel-5-routing-the-war-over-php-annotations-and-the-secret-weapon-tm
Source: http://www.phpdeveloper.org/news/21854

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

Laravel Podcast: Episode 18 – Laravel 5 Routing, the War over PHP Annotations, and The Secret Weapon

Laravel Podcast: Episode 18 – Laravel 5 Routing, the War over PHP Annotations, and The Secret Weapon

The Laravel Podcast has released their latest episode, Episode #18: Laravel 5 Routing, the War over PHP Annotations, and The Secret Weapon(tm). Join hosts Shawn McCool, Taylor Otwell and Jeffrey Way as they talk all things Laravel.

In this episode, we discuss new Laravel 5 features including annotated routing and middlewares. We discuss some motivations and guiding forces that make Laravel what it is. Also, hints about Jeffrey and Taylor’s secret new project. The referenced article by @everzet can be found here: http://everzet.com/post/99045129766/introducing-modelling-by-example.

You can listen to this latest episode either by using the in-page audio player, by downloading the mp3 or by subscribing to their feed.

Link: http://www.buzzsprout.com/11908/212256-episode-18-laravel-5-routing-the-war-over-php-annotations-and-the-secret-weapon-tm
Source: http://www.phpdeveloper.org/news/21854

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

Joshua Thijssen: Deepdive into the symfony2 security component: part 1

Joshua Thijssen: Deepdive into the symfony2 security component: part 1

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.

Link: https://www.adayinthelifeof.nl/2014/10/19/deepdive-into-the-symfony2-security-component-part-1/
Source: http://www.phpdeveloper.org/news/21853

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

Joshua Thijssen: Deepdive into the symfony2 security component: part 1

Joshua Thijssen: Deepdive into the symfony2 security component: part 1

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.

Link: https://www.adayinthelifeof.nl/2014/10/19/deepdive-into-the-symfony2-security-component-part-1/
Source: http://www.phpdeveloper.org/news/21853

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