News Feed
Jobs Feed
Sections



Recent Jobs

News Archive
feed this:

DevArticles.com:
Singletons in PHP
December 06, 2011 @ 10:17:33

On DevArticles.com today there's a new tutorial posted talking about one of the more popular design patterns, the Singleton, and how it can be implemented in PHP.

Though in the past they enjoyed both popularity and a certain amount of prestige, without a doubt Singletons have progressively become one of the most evil and despicable villains in object-oriented design. Singletons earned their bad reputation for a reason: bringing them to life requires the programmer to deal at least with a static method. This is simply an elegant masquerade for creating a global access point (which in most cases is mutable as well) throughout an entire application. And we all know that global, mutable access is unquestionably a bad thing that must be avoided at all costs.

In this first part (of two) of the series they introduce the Singleton pattern and show how, via an example of using a database adapter interface to work with a MySQL database, in a tightly coupled example. In the second part of the series, they'll show how to break these apart using dependency injection.

0 comments voice your opinion now!
singleton designpattern dependencyinjection di mysql database adapter interface



Alberto Viana's Blog:
Zend Framework and Oracle XMLType
September 21, 2011 @ 09:52:04

Alberto Viana has a new post to his blog about using Oracle ZML Types with a Zend Framework application. He created a custom adapter to create the type and handle the binding/execution on an new OCI8 connection.

So few days ago I needed to insert Oracle XMLtype with Zend Framework. I used oracle adapter to wrote it in Zend Framework. I was looking for and I found on Chris Jones Blog.

His table has a column defined as an XMLType, a special data type specifically for working with XML datasets directly in the database. His adapter includes a bit of sample XML and the code needed to bind the data as a CLOB and, using the writeTemporary function.

0 comments voice your opinion now!
zendframework oracle datatype xmltype adapter


Zend Developer Zone:
My Favorite Design Patterns
April 25, 2011 @ 10:38:13

On the Zend Developer Zone there's a new article from Keith Casey where he talks about some of his favorite design patterns he's come across in his time as a developer - adapter, facade and decorator.

Within the Design Patterns world, there are four main categories: Architectural, Structural, Creational, and Behavioral. Architectural patterns describe the system as a whole, Structural patterns describe the relationships between objects, Creational handle creating objects, and finally Behavioral describe the communication patterns between objects. Each of the categories is worth discussion on its own, but in this case we'll stick to the Structural patterns of Adapter, Facade, and Decorator.

He describes each of the patterns (no code in this one, just descriptions) and for each mentions some of the tools that the Zend Framework has to offer that match up. For example, the Adapter pattern is used in quite a few places in the framework including in the Zend_Db component for the connection types to different databases.

0 comments voice your opinion now!
designpattern zendframework adapter facade decorator


Daniel Cousineau's Blog:
Doctrine 1.2 MSSQL Alternative LIMIT/Paging
September 17, 2010 @ 11:34:03

Daniel Cousineau has a new post to his blog today looking at an alternative that can be used for pagination in your MSSQL queries than the trick with TOP and reversing the ORDER BY in Doctrine.

As ugly as this technique is, it works. The problem is it requires an extreme amount of intelligence or an extreme amount of simplicity in the query in order for an automated system like Doctrine to be usable. The biggest caveat with this technique is good goddamned luck paging your query if it doesn't have an ORDER BY. And sometimes queries that are complex enough break the modified Zend_Db code. There exists an easier MSSQL paging technique. Using features first available in SQL Server 2005, with only 1 subquery you can mimic MySQL's LIMIT clause with ease.

He includes the query that will make it happen (the SQL for it) and then the implementation as an adapter you can use to get it to cooperate in your Doctrine queries.

0 comments voice your opinion now!
mssql doctrine limit paging adapter


NETTUTS.com:
A Beginner's Guide to Design Patterns
July 08, 2010 @ 08:47:55

On NETTUTS.com today there's a new tutorial that introduces a bit more advanced concept in the development process - design patterns.

Design patterns are optimized, reusable solutions to the programming problems that we encounter every day. A design pattern is not a class or a library that we can simply plug into our system; it's much more than that. It is a template that has to be implemented in the correct situation. It's not language-specific either. A good design pattern should be implementable in most - if not all - languages, depending on the capabilities of the language.

They introduce a few of the more widely used patterns including the strategy pattern, adapter pattern, factory methods, decorator and singleton patterns. Each comes with a bit of code showing how it would work and a "where would I use this?" section with a better example.

0 comments voice your opinion now!
designpattern beginner strategy factory singleton decorator adapter


Richard Thomas' Blog:
Solar Framework Shorts - Using Multiple auth adapters
April 07, 2010 @ 15:56:30

Richard Thomas has posted another "Solar Short" to his PHPJack blog today dealing with a method for using multiple authentication methods in a single Solar framework installation.

What if you want to use multiple methods? OpenID? Facebook Connect? Saml? or one of the other dozen+ solutions that you might use.. What to do? One thing to keep in mind, Auth happens really early in the bootstrapping process so things like SQL may not be available yet unless you specifically loaded it in the config.. Then you need to load the proper auth module and call it as needed..

He includes a code example of how it would work - extending the Solar_Auth_Adapter to create a single "multi-adapter" with a switch to evaluate and load/use the correct authentication method. It uses the Solar_Config object to set the Auth Adapter when it's loaded so you can even use multiples in the same page load if you need it.

1 comment voice your opinion now!
solar framework multiple authentication adapter tutorial


ZendCasts.com:
Writing a Zend_Auth_Adapter with Doctrine
January 25, 2010 @ 09:54:32

New from the ZendCasts.com site today there's this new screencast looking at the integration of the Zend_Auth_Adapter component of the Zend Framework and the Doctrine ORM library to split out the authentication from the persistence layer.

I've been using Doctrine a lot in my own work, and recently found myself itching to have tighter integration between Zend and Doctrine when it comes to user logins. Luckily, Zend provides a very simple interface with regards to Zend_Auth. This way, it's easy to decouple your persistence layer (in my case Doctrine) from the authentication layer.

He also recommends checking out Palo Verede's look at the same topic. You can watch the screencast here and grab the code for it here.

0 comments voice your opinion now!
zendauth adapter doctrine authentication


Richard Thomas' Blog:
Solar Framework Shorts - Creating your own OpenID Auth Adapter
December 21, 2009 @ 10:09:01

Richard Thomas has posted another Solar framework short today. This time it's about OpenID and how you cn easily create a custom adapter that integrates directly into the framework to support it.

Solar makes heavy use of Adapter based classes, Solar_Auth is one of these. This makes adding additional methods pretty easy and allows you to borrow from other Frameworks without having to Hack in a third party auth setup, You can use the basics provided by Solar.

He includes a code example showing how to extend the Solar_Auth_Adapter component to create an OpenID adapter you can use as a part of your authentication process. His Solar component encourages code reuse too by using the Zend Framework native OpenID implementation as its authetication functionality.

0 comments voice your opinion now!
solar framework openid authentication adapter


Federico Cargnelutti's Blog:
Database Replication Adapter for Zend Framework Applications
October 05, 2009 @ 09:33:00

Federico Cargnelutti has added a new post to his blog today looking at a database replication adapter he's created for the Zend Framework - the ReplicationAdapter.

In 2008, Paul M. Jones announced the release of an SQL adapter that allows Solar users to connect to master/slave database installations. My first reaction was: Great! This will inspire other FOSS developers to create similar components. And guess what, it did. I wrote my own ReplicationAdapter. It's not great, but it's flexible enough to support the most commonly used replication scenarios:

He gives examples of how it can be used for single-master replication, multi-master replication and how the adapter can be used to create a distributed caching system for database connections. A brief Zend Framework-based example is also included.

0 comments voice your opinion now!
database replication adapter zendframework


Christian Stocker's Blog:
A Twitter Adapter for Zend_Auth
July 08, 2009 @ 11:02:16

Christian Stocker has posted an adapter he's created to hook the Zend_Auth component of the Zend Framework into Twitter's authentication system.

From time to time I write some little scripts for my own needs or just to test out new stuff. And I realised, that I blog about it way too little. So here I start with my latest addition: Zend_Auth_Adapter_Twitter. [...] I came up with a Zend_Auth Adapter for Twitter. The integration was pretty easy, but the code is very basic and rough. Nevertheless, it does the job and alongside the Openid Adapter I can offer a federated login for many people already.

You can grab the code and an example of it in action from their SVN server (as well as this library) or just check out the live demo.

0 comments voice your opinion now!
zendauth zendframework adapter twitter



Community Events





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


custom release language opinion series framework package conference interview symfony2 manifesto unittest phpunit api development introduction application community podcast test

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