News Feed
Jobs Feed
Sections




News Archive
feed this:

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

Igor Wiedler:
Stateless Services
April 04, 2013 @ 10:41:50

Igor Wiedler has a recent post to his site about creating stateless services, specifically in the context of using a dependency injection container to manage the objects your application uses.

As more frameworks and libraries, particularly in the PHP world, move towards adopting the Dependency Injection pattern they are all faced with the problem of bootstrapping their application and constructing the object graph. In many cases this is solved by a Dependency Injection Container (DIC). Such a container manages the creation of all the things. The things it manages are services. Or are they?

He notes that, according to some of the principles of domain-driven design, "services" should be stateless - the results of calls to the service shouldn't alter it, it should only depend on the values passed in. He goes on to put this into the context of a DIC and gives an example of the "request service" (and how it violates the DDD principles of statelessness). He talks some about scopes (dependencies) and mutable services. He talks about methods to get around these issues with the "request" instance, ultimately coming to the conclusion that event listeners might be the way to go.

0 comments voice your opinion now!
stateless services dependency injection event listener request

Link: https://igor.io/2013/03/31/stateless-services.html

Gonzalo Ayuso:
Managing Windows services with Symfony/Process and PHP
November 01, 2012 @ 10:49:09

In his recent post Gonzalo Ayuso shows how to use Symfony to work with Windows services on the server.

Sometimes I need to stop/start remote Windows services with PHP. It's quite easy to do it with net commnand. This command is a tool for administration of Samba and remote CIFS servers. [...] Today we are going to create a PHP wrapper for [net rpc service].

He uses Behat to create a feature (test) file, the code behind the features and a service class that handles the actual work of interacting with the service (with methods to do things like stop, start and list running services). Examples of its use are also included.

0 comments voice your opinion now!
windows services behat feature test class tutorial symfony


PHPMaster.com:
An Introduction to Services
April 03, 2012 @ 13:12:16

On PHPMaster.com today there's a new article from Alejandro Gervasio introducing you to the concept of "services", a layer put on top of your models to make a common API that's easier to reuse.

Don't let the definition freak you out, as if you've been using MVC for a while the chances are you've used a service already. Controllers are often called services, as they carry out application logic and additionally are capable of interfacing to several client layers, namely views. Of course in a more demanding environment, plain controllers fail short in handling several clients without the aforementioned duplicating, so that's why the construction of a standalone layer is more suitable in such cases.

He explains the process behind creating a simple domain model (image here) and shows how the Service layer wraps it up into a simpler interface, leaving the model to handle the business logic. He uses the example of an "EncoderInterface" that's implemented in a "JsonEncoder" and "Serializer" to both provide a "setData" method.

0 comments voice your opinion now!
services tutorial model wrapper layer


Jakub Zalas' Blog:
Managing object creation in PHP with the Symfony2 Dependency Injection component
September 08, 2011 @ 09:24:55

On his blog today Jakub Zalas has posted a tutorial he's written up about using dependency injection in PHP with the Symfony2 dependency injection component (DIC).

Symfony's DependencyInjection component is a PHP implementation of a Service Container, or as others like to call it, a Dependency Injection Container (DIC). The component also provides useful tools for handling service definitions, like XML loaders or dumpers. If you want to learn more about the dependency injection or the dependency injection container, read an excellent series of articles on the subject by Fabien Potencier: What is Dependency Injection?

He walks you through the entire process - installing the needed libraries (the DIC, a config and class loader component and Buzz, a lightweight HTTP client). Code is included to show object creation the "usual way" and then creating the same types of objects in a dependency injection environment. Also included is a sample XML document describing the services for the container. He finishes the post with a GraphvizDumper-generated image for the container.

0 comments voice your opinion now!
dependency injection symfony2 component services xml tutorial


Brian Swan's Blog:
Getting Started with SQL Server Reporting Services (SSRS) and PHP
May 06, 2010 @ 10:12:15

Brian Swan has a new post to his MSDN blog today that looks at working with the SQL Server Reporting Services SDK and PHP to automatically create some reports based on the date in your database.

In this post I'll dive into the SSRS SDK for PHP that was recently released by the Interoperability team here at Microsoft. [...] The documentation in the SDK is complete with explanations for the classes that make up the SDK, code examples, and a "hello world" example. However, in this post, I'll build a simple web page (code attached to this post) that renders the Sales report that I created last week.

He starts off with an overview of how all of the technology will fit together and some of the things you'll need to have before you can get started - a user with the right permissions and a connection to the server. The "SSRSReport" class in the SDK gives you quick access to load a report based on a named location. You can then use methods like "RenderAsHTML" to output it as HTML or one of other methods (like CSV, text, PDF, etc).

0 comments voice your opinion now!
reporting services sqlserver ssrs sdk tutorial


RIAZone:
Integrating PHP with Flash Collaboration Services
December 14, 2009 @ 13:47:28

On the RIA Zone (a part of the DZone network) there's a new tutorial from Ryan Stewart about combining PHP with the Flash Collaboration Services (real-time collaboration and social capabilities via the LCCS) in the second part of his series (part one).

Another great way to integrate LCCS and PHP is with the REST APIs and the library that ships with the LCCS SDK. With those APIs we can perform a number of management functions including creating and deleting rooms, managing roles, and creating templates. These APIs make it very easy to create a customized, dynamic collaboration experience with PHP. You can create rooms on the fly for your users and get information about what kind of content is in those rooms. In this example we're going to create a basic room manager with PHP that will let us create, delete, and view information about specific rooms.

Code is included to use the AFCS PHP library to connect to the Services API and pass in the username and password directly from the user. The request is made and a token is passed back to the calling script. The XML description of the full Flex application is included in the tutorial.

0 comments voice your opinion now!
flash collaboration services api tutorial


Aaron Wormus' Blog:
Interoperability is Overrated
February 14, 2007 @ 07:19:00

Despite opinions from some of the PHP community, interoperability between PHP applications isn't is such a bad state - at least According to Aaron Wormus:

The fact of the matter is that it's not such a big deal. Porting a plugin from Wordpress to Serendipity is usually trivial, and as we see more web-services based plugins (stuff like the awesome askimet) the task becomes simpler and simpler.

Interoperability is overrated, the more you think of it the more complex it gets. As you start throwing in new factors into the equation (how will this interoperate with a java/c# application) you start to develop monsters like JSR 170 which solve a lot of problems on paper, but in reality are too unwieldy to be truly useful.

He even lists out some of his "steps to interoperability" to help speed things along (like "use as much abstract code as possible" and "use services").

0 comments voice your opinion now!
interoperability overrated abstract libraries glue services interoperability overrated abstract libraries glue services


Zend Developer Zone:
Ben Ramsey on XML, SOAP, and Web Services
October 05, 2006 @ 09:43:00

On the Zend Developer Zone, Cal Evans talks about one of the presenters of the upcoming Zend/PHP Conference and Expo - Ben Ramsey. He asked Ben some questions about the conference and a talk that he'll be giving - "XML & Web Services with PHP (An Overview)".

Ben Ramsey will be speaking on "XML & Web Services with PHP (An Overview)" at the upcoming Zend/PHPConference and Expo. Since I hang out with Ben in the freenode.net #phpc channel I thought it would be cool to talk to him for a bit about his session.

They talk about why Ben is passionate about web services, the two popular protocols for using these services - SOAP and REST, and which one of them Ben prefers.

0 comments voice your opinion now!
web services xml soap rest interview zendcon2006 web services xml soap rest interview zendcon2006


Davey Shafik's Blog:
More Web Services
October 02, 2006 @ 08:55:00

Davey Shafik has posted another update on his web services component he's working up for the Zend Framework, the Zend_Service_Server.

I have been working closely with Matthew Weier O'Phinney for the last week on bringing my Zend_Service_Server proposal to fruition.

There have been several changes, but the core has not moved too far. Matthew, Andi and I have decided that we will first implement the different server/client libraries.

He lists the libraries they'll need to tackle first and talks about an "exercise" he did to work up a JSON server component that works in a similar fashion.

0 comments voice your opinion now!
web services zend_service_server libraries zend_json_server web services zend_service_server libraries zend_json_server


PHPied.com:
The PEAR book is on it's way
September 12, 2006 @ 16:25:06

To prepare the way for the upcoming PEAR book from Packt Publishing correctly, Stoyan Stefanov has posted this info about the book and where to find the latest details on it.

Here's the link to publisher's page dedicated to the PHP Programming with PEAR. Guess who wrote the chapter for MDB2? ;)

It's an honour to me to be in the company of the other authors, people who have done a lot for the PEAR community

He also mentions some of the topics that the book will contain, including accessing databases with MDB2, creating and parsing XML documents, and accessing web APIs. The book is coming out in September, so keep on the lookout for it at your local bookseller soon.

0 comments voice your opinion now!
pear book packt publishing mdb2 xml pdf web api services pear book packt publishing mdb2 xml pdf web api services



Community Events











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


unittest package install hhvm component opinion overview introduction facebook release example symfony2 hack language code application framework composer podcast security

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