News Feed
Sections




News Archive
feed this:

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

NetTuts.com:
The Repository Design Pattern
November 26, 2013 @ 11:53:16

While design patterns are a wider topic than just PHP, the NetTuts.com site has posted a new tutorial looking at the Repository Pattern and uses PHP and PHPUnit to illustrate how the pattern works. They looks at the structure of the pattern at a high level and provide a more "real world" example too.

The Repository Design Pattern, defined by Eric Evens in his Domain Driven Design book, is one of the most useful and most widely applicable design patterns ever invented. Any application has to work with persistence and with some kind of list of items. These can be users, products, networks, disks, or whatever your application is about. If you have a blog for example, you have to deal with lists of blog posts and lists of comments. The problem that all of these list management logics have in common is how to connect business logic, factories and persistence.

They start with an overview of the pattern and some of the problems that it can help to solve. They also briefly mention the Gateway pattern that will be used in the examples to pull information into the Repository. After covering some of the basic concepts, they get into the code (going the TDD route) showing how to manage comments, like from a blog, inside a repository. It implements a "Comment" class, a persistence mechanism (the Gateway) and a Factory class that takes in the comment data and returns a correctly formatted object. Finally, they make the repository class and show how to add and retrieve comments from its internal data set.

0 comments voice your opinion now!
designpattern repository gateway factory persistence tutorial

Link: http://net.tutsplus.com/tutorials/php/the-repository-design-pattern/

PHP Cloud Casts:
#3 Creating Charges with Stripe.com (Screencast)
October 29, 2012 @ 10:05:06

The PHP Cloud Casts site has posted another screencast-based tutorial showing you how to interface your application with Stripe.com, a developer-friendly payment solution with its own API.

In this, the second episode of PHP Cloud Development Casts, we go through how to creating charges with the Stripe.com libraries. We use a simple Kohana based PHP setup to create a token and an accompanying charge. We then login to our account and look at the details that Stripe stores about the transaction from tokens, charges, events and other logged data.

You can view the video either on their site or by heading to Vimeo for a bit larger version. He shows how to use Stripe's own Javascript and PHP scripts to connect to the API. He does it as a part of a Kohana-based application, but it can be easily adapted to any framework (or non-framework) site out there.

0 comments voice your opinion now!
screencast tutorial stripe payment gateway api


Ibuildings techPortal:
Architecture Patterns Domain Model and Friends
October 31, 2011 @ 11:26:09

On the Ibuildings techPortal today there's a new post from Robert Raszczynski about domain modeling and how a good knowledge of it can help your application's architecture.

Architectural and design patterns help software architects to break systems in to smaller, more maintainable sections organised by their functionality and usage. [...] There are three major layers in software architecture: presentation, domain and data source. [...] Now that we know what types of layers we can find in software architecture, let's have a look at how we can organize domain logic and data sources layers.

He looks at three patterns that can help organize your domain logic - a transactional script (one file that does one thing), a table module (logic lives in the tables) and his focus, the domain model. He shows (via a graph) how the domain logic approach can cut through some of the effort it could take to improve on the other two. He gives a two suggestions of how to access the data in your domain layer - a Gateway or a Data Mapper. To reinforce the ideas he's presented, he includes some code snippets of a basic domain model for a Store, Customer and Product and uses them in both Gateway and Data Mapper examples.

0 comments voice your opinion now!
domain model architecture application gateway datamapper transactional tablemodule


Matt Williams' Blog:
Integrating PayPal with PHP and IPN
April 14, 2010 @ 12:02:09

In a recent post Matt Williams shares how to integrate your application with the PayPal IPN payment gateway service.

PayPal has a huge API reference to integrate it's services into any website. But from personal experience I found that the theory is far more simple than the practice. There are various methods to implement PayPal's services including Soap webservices with 'Express Checkout' and 'Website Payment Pro'. This tutorial will focus on 'Website Payment Pro' and the 'IPN' event listener.

He shows how to send the information as a POST request in one of two ways - as a standard form submission kind of POST and from a script opening a direct socket to the PayPal server and sending over a well-formed request.

0 comments voice your opinion now!
paypal ipn payment gateway request


Stuart Herbert's Blog:
Participating in the European WinPHP Challenge 2009
April 21, 2009 @ 12:03:18

Stuart Herbert has decided to get in on the action and enter himself into the WinPHP Challenge (as sponsored by Ibuildings).

Generally, folks choose to deploy web-based applications on Windows Server because they already have Windows Server. Selling them something that will only work on Linux is a tough sell, so a competition like this that seeks to show off how well PHP works on Windows should be another small step forward for all those small ISVs like Box UK who want to sell products written in PHP - provided Microsoft actually do something marketing-wise with the results.

His idea is to build a PHP/.NET tool that can act as a web services gateway. He's already started development and blogs about getting the environment all set up - Windows Server 2008, IIS7 and PHP 5.2.9 For Windows.

He's made another post with an update on his status - finishing out the development environment with PHP up and running, setting up a database, picking an IDE (Visual Studio) and setting up a version control system (git).

In this post he takes about what he's trying to achieve with his application and some use case examples and in this other post some of the feedback he's gotten about his dev environment.

0 comments voice your opinion now!
dotnet gateway webservice vps server windows winphp09 winphpchallenge09 european


Juozas Kaziukenas' Blog:
PayPal payment with encryption
February 23, 2009 @ 12:04:28

Juozas Kaziukenas points out a new class in his latest blog post that can be used to make secure connections over to PayPal (encrypted) using their Encrypted Website Payment method.

In my situation, PayPal is only used to pay for orders - cart and order setup is done in our shop, so I do not want to have additional problems with users changing orders numbers, amount to be paid, etc. [...] Only PayPal knows how to decrypt it, because it uses public key encryption technology (you need to upload your certificate in PayPal account).

Some sample usage code is included as is a link to the class itself. His example takes a payment transaction including the item name, amount and currency type and sends it off to the PayPal servers in a connection protected by certificates.

0 comments voice your opinion now!
paypal encryption payment secure certificate gateway tutorial class


Attila Szabo's Blog:
Send SMS messages from your website through smsBug gateway
September 15, 2008 @ 11:13:41

Attila Szabo has come up with a class that makes sending SMS messages from your site simple (through the smsBug gateway).

I wrote a simple PHP class for sending SMS messages through smsBug gateway. It can send a single SMS message and receive the number of credits left (see the UML diagram of the classes below). You need to include two classes into your PHP code.

He includes an example of it in use (sending a single SMS message to a phone) as well as a demo of it in action and a link to the download where you can grab the class for yourself.

0 comments voice your opinion now!
sms message class tutorial smsbug gateway


Community News:
AMFPHP - Flash Remoting Gateway
December 07, 2005 @ 11:54:14

From this post on Ajaxian.com today, there's a look at a new PHP-based library/framework to help with Flash remoting - AMFPHP.

MFPHP is an open-source implementation of the Flash Remoting framework. It's fast, reliable, 100% free and open-source. With this new version we have strived to make a product as stable and full-featured as ColdFusion-based remoting (the reference implementation).

You also get to use the wonderful NetConnection debugger, which shows you exactly what's being sent between the client and server. Remoting uses AMF, a very lightweight binary format that cuts the bulk out of packets, meaning data exchange is a lot faster than with XML.

You can get the complete details from their homepage or just dive right in to their documentation...

0 comments voice your opinion now!
flash remoting gateway flash remoting gateway



Community Events





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


symfony laravel series composer podcast framework interview opinion introduction language tool voicesoftheelephpant update library security release package install version community

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