Archive for the 'PHP' Category

26th Jun 2008

BugMiner

So as well as being the God of unit testing in PHP it seems that Sebastian Bergmann ahas created a new project called BugMiner. It looks to be a very cool tool that will use your version control repository to ascertain metrics about risk and complexity. I’ve not had a chance to play with it yet but I’m always impresses with Sebastian so I have high hopes.

Posted in PHP, Testing | No Comments »

26th Jun 2008

Overloading Internal PHP Classes With Namespaces

Over on Greg Beaver’s Blog he talks about a patch he very quickly got into the PHP 5.3 and HEAD repository that will allow you to import a class into the global name space and override the internal PHP classes if the name matches. This means you could fix a bug in one of the PHP classes if you needed to or even use it for unit testing. I wounder if you could over load PDO?

Posted in PHP, Testing | No Comments »

25th Jun 2008

Getting Excited About SplFastArray

After reading about the new SplFastArry on Colder’s blog I started to get really excited about the possibilities and this could really give a boost in a lot of places. The thing to keep in mind is that SplFastArray will only increase performance when you add, remove, and generally access elements and you’ll see a decrease in performance when you are iterating or counting.

Posted in PHP | No Comments »

25th Jun 2008

Cutting Use of Zend_Log in Half - The Easy Way

After reading Tony Bibbs post on how he cut his usage of Zend_Log in half by taking

$logger = Zend_Registry::get('logger');
$logger->log($errorMessage,1);

And creating

MyLog::log('Kernel starting up');

While the benefits of abstracting the Zend code away from your code to allow you to switch to another logger at some other time are all well and good. If you just want to reduce your line count, surely simply doing the following would do the same.

Zend_Registry::get('logger')->log($errorMessage,1);

Posted in PHP | No Comments »

27th Jan 2008

Following php.internals and the lack of a good web based NNTP reader

I often read blog posts and have heard the guys at work talking about the php.internals mailing list also with new PDO mailing list which is where all the PDOv2 debates will be taking place I decided it was about time I start following these lists.

So I started looking around for a way to do this. Here are my requirements. I don’t want to be tied to one computer and I want my reader to remember which posts I’ve read.

Try as I might I’ve not been able to to find anything that will let me do that with NNTP. I did find http://news.php.net/ this is a web based archive of the php mailing lists so I’d found my not being tied to one computer solution. Now I just needed a way for it to remember which posts I’d read.

For most lists support for RSS and RDF is available so I added a subscription to my feed reader (Google Reader if you care) and now I have tracking of what I have read.

Now I have a very different problem the content in the feeds is not what I need. I was expecting the title of each item to be the subject of the email with the autor directly after the subject and the descripton to be the body of the email possibly truncated. In fact what you get is the item title is just the subject of the email and the description is the author of the email.

To remedy this I created a Yahoo! Pipes application that would read the feed pull out the link to the full email page and then pull the contents of that page and set that as the description. I also took, with some regex, the author name that was in the original description and added it to the title.

I’d never used pipes before and it was not easy it took me a long time to get close to want I wanted and I still have a few niggling issues with my feed so I think I will write my own script to do the same thing so I can have complete control over the output. One it’s dome I’ll post it so other can use it if they would like.

I also have a very similar problem with DVD release feeds I just can’t find one that suites all I want. I’m starting to think that as time moves forward that feed providers need to add some level of configurability to there feed services so people can tailer them to what they really want.

Posted in PHP | No Comments »

20th Sep 2007

PRADO Watch: 20th September 2007

Well so much for increasing the frequency of PRADO Watch posts. Well my excuse was my wife having twin baby girls and I’m sting with it!

We have a lot for you today so I’ll try to be brief.

Just Checked In

Wildcards and IP filtering added to page configuration.
Pages attribute in the authorization rules can take relative page paths with wildcard ‘*’. For example, pages=”admin.Home” refers to the Home page under the admin directory, and pages=”admin.*” would refer to all pages under the admin directory and subdirectories.

IP rules are specified by a new attribute ip in authorization rules. The IP rules are used to determine if an authorization rule applies to an end-user according to his IP address. One can list a few IPs together, separated by comma ‘,’. Wildcard ‘*’ can be used in the rules. For example, ip=”192.168.0.2, 192.168.1.*” means the rule applies to users whose IP address is 192.168.0.2 or 192.168.1.*. The latter matches any host in the subnet 192.168.1.

TMemCacheSession
The new TMemCacheSession module provides access for storing sessions in memcache.

ForceSecureConnection
The ForceSecureConnection option was added to THttpRequest to force all generated urls to use the https prefix. If the url already is using https:// you can use $this->Request->setForceSecureConnection(false) to create links with http://.

PRADO Translations
There has been a lot of effort of late in the area of translating PRADO with kabayan putting in overtime on the Indonesian front, Eric.M and Tof have been upding and adding to the French, Shinya.K adding to the Japanese sections, xue making some updates for the Chinese translations and YOIS is doing a Spanish translation.

As a side note I’m looking for people to translate and publish PRADO Watch into more languages. More on that later.

TKeyboard
Sergey Morkovkin submitted his virtual JavaScript keyboard to the component repository back in March, well it mush have struck a cord as it’s now been added to PRADO well done Sergey.

TCaptcha and TCaptchaValidator
Well I guess xue cracked from the pressure and has included a CAPTCHA control to PRADO even with his resavations about it being beatable. Along with the validator this will be a very welcome addition to PRADO for some users.

TSlider
Hats off to tof for adding a JavaScript slider control to PRADO. Based on the script.aculo.us widget this is a great addition to the framework.

Consecutive Cells Grouping for TDataGrid
If you set the EnableCellGrouping in a column of a TDataGrid cell directly above of below each other will be grouped into one big cell. An example of what it may look like can be seen here.

The Community Component

XActiveDataGrid
Billed as full active DataGrid with the ability to do paging, sorting and editing, with praise from PRADO core developers like Carl. daneel has created a very excting component.

MediaHTMLCodeEmbedded
YOIS has created a cool component for easaliy adding videos and such to your page. With support for YouTou, Flash, Windows Media, Quick Time and Real players.

PRADO/Wordpress/BBPress integration v1.0
javalizard has out done himself with this on. In his own words.

“I’ve been wanting to share with all you something new and special. I’ve needed to use Wordpress Multiuser as blogging software (it’s supported and has new releases once in a while and people know how to use it) with PRADO. Auxiliary is the integration of BBPress too. Basically, it’s a single login system for prado, blogs, and forums.

Here’s what it integrates:

* Users management in PRADO uses Wordpress
* User roles in PRADO uses Wordpress
* Permissions and user capabilities in PRADO uses wordpress (more an extension of PRADO)
* User authentication in prado uses itself (sessions) and wordpress (cookies)
* initializes most of the Wordpress code libraries (so you get actions and filters!!)
* includes all the Wordpress plugins
* (and it’s relatively easy to integrate!)”

In The Wild

eioba.com
This amazingly well polished site, which is a social site based around articles users publish is a real gem of an application and well worth your time to poke around.

spcvideo.com.br
A DVD movie rental application helping with bad customers and occurrences of material damage, not paid rent, robbery etc….

Well I do have more to post but this is a good start, so another PRADO Watch will follow soon.

Posted in Ajax, PHP, PRADO, PRADO Watch | No Comments »

20th Aug 2007

PRADO Watch: Interview With Timani Tunduwani - Why I Moved From CakePHP to PRADO

Prodezine LogoWhen Timani Tunduwani posted a message in the PRADO forums say that he had just made the switch from CakePHP to PRADO and had create prodezine.com my interest peeked and just had to find out more.

Tell us a little about yourself?

I am a 24 year old programmer from Seattle. I am a freelancer at heart, UNIX/Linux, PHP, Python, but i currently have a fairly large, long-term project underway for a airfare consolidator. Basically worked as a network analyst for 3 years, then switched to web programming, had about two years of .net experience and then decided to make the switch early PHP4 and haven’t looked back since.

What were you using CakePHP for?

I am currently one of the lead programmers at Justfares.com and they are planning a major overhaul of their site. It was previously ASP.net and we switched to PHP5 rather rapidly, and as a team soon realized that we needed a standardized, scalable, mature, framework to manage and streamline development. CakePHP had rapid framework growth and development, good community support, and detailed framework documentation. Our main application is going to be a fairly comprehensive airfare engine that needs to get to its maximum potential, while working at an efficient rate.

What made you start looking around for another framework?

In the end we needed a framework that was flexible, powerful, versatile, and scalable so the company could grow and be efficient in a team setting. A new project arose spanning two large organizations with intricate data models, and they had said that the data management and management of business objects was becoming extremely complicated and was now a major issue to coordinate and manage effectively. CakePHP did not really address any of these issues directly so it was time for a new solution. PRADO.

Why did you settle on PRADO over other frameworks?

There are a number of reasons but primarily was the SQLMap Data Mapper. The ability to deal with the complex business logic that had arisen was pivotal. There was an extra but minor overhead, but a small price to pay and easily rectifiable through optimizing and using accelerators. Once we discovered the Data Mapper, more discoveries arose about the benefits of PRADO such as : the component structure, controls, strong event driven programming, team integration ability, power and simplicity to name but a few.

In detail how do PRADO and CakePHP compare?

The “average programmer” can grasp the concepts of PRADO fairly rapidly and the ease of configuration allows for ideal use in team situations. CakePHP has a steep learning curve and unless you have had some RoR it is not really ideal for adding to a team and productive time is wasted on training and understanding. A drawback not really found in PRADO, we have added programmers and with simple instruction they are able and easy to integrate into team environments without wasting too much time.

PRADO is good for all! Often working with designers can be a project within itself. They are focused on aesthetics and as a developer we prefer function. In PRADO a designer can complete his tasks without needing a great detailed understanding of the framework’s architecture. PRADO takes hold of certain tasks which can be done simply using controls(GridView, Repeater…..) vs CakePHP without having to do iterations through tables, rows, columns etc.

What do you miss from CakePHP?

PRADO’s Community is strong but CakePHP’s is stronger. Good support as well as rapidly growing community, and easily accessible applications with good documentation and snippets. It would be great if the IRC channel #prado was stronger, we can enhance the PRADO wiki, with a bit of effort from everyone to compete with the Bakery, and CakeForge which are well done. But most importantly promote the framework, and participate and promote PRADO HARD!!!!


Wow! I know that I personally feel that Tim has really been able to find that sweet spot that PRADO fills for big team development something I’ve been pushing myself.

I hope you enjoy this interview look out for more PRADO verse other PHP frameworks posts coming soon!

Posted in PHP, PRADO | 1 Comment »

09th Aug 2007

PRADO Watch: Interview with Dario Rigolin of foxcoverplay.com

A music contest site based on PRADO 3 was posted in the forums looking very cool and bristling with multi media features. I just had to find out more. So I sent a message to Dario Rigolin from Italy, asking if he would share with me and the readers of PRADO Watch his experience.

Tell me a little about yourself?

I’m a PHP adopter since PHP3. I worked many years in IT industries doing huge integration projects around Europe for the largest telecom companies and financial institutions. I worked mainly in Java and C/C++ during my travels.

Tell me a little about ePortal Technologies?

In 2003 I decided to startup my company, ePortal Technologies with my dear friend (a librarian) to build innovative applications for libraries. We released our first application “Clavis” to handle large library consortia. But the design of that wasn’t good enough to jump into Web 2.0. Then one and a half years ago we decided to start a complete redesign based on PRADO. We are a young and fast growing company here in Italy. We have three large library consortia: Verona, Milan and Gorizia. We have more than 200 libraries using our software daily.

Tell me where PRADO fits into ePortal Technologies’ business?

We were already using PRADO 2.x but for ClavisNG we decided to use PRADO3 at a very early stage. We are now close to releasing our first beta and we are very happy about our choice. We built components we released to the PRADO community and also test the snapshot to report any issues daily. In our applications we use all features of PRADO. We also are investing time and resources to make a better PRADO Portal. The only issue we have with PRADO is the decrease in speed due to “large framework” overhead and large use of OO in any aspect of the framework. We use PHP accelerators to speed up execution and profiling to fine tune code and are working to put in place a series of lightweight components for data grids and lists. We hope the PRADO extension will help speedup the code. In any case, the flexibility in our development process and the ability to adapt and extend the GUI to the end user is fantastic and this is the most valuable asset. At the moment any web applications and dynamic websites we build are PRADO based.

In what way did PRADO help you the most when developing foxcoverplay.com?

FoxCoverPlay had requirements to be not only a simple WebSite for a Music Contest but to become a portal with many new features designed to make a community: blogs, voting, advertising, eCommerce and so on. The customer was in a position to say: “I would like to test if this idea is good. I don’t have tons of Euros to invest but if it’s successful then we will attract investors and we will grow.” At this point, we decided to build a website with “flexibility in mind” and for us:

IF develop(WEBAPP) THEN PRADO

. And this was a good move. After a few weeks the customer asked for “multilanguage” everywhere, localization in PRADO is easy. Then we discussed about integrating personal areas for artistis, news/blog for site managers and so on. We had in the past really bad experiences customizing existing CMS or eCommerce in PHP. Most of them are “single man” projects, and you need to “enter into the mind” of the developer to be able to customize it. We failed in the past. Spending one month to understand how to do something simple like a chart read from a database or customizing a layout is really bad, etc. In one month a PRADO developer is able to put in place the usual 5 things a customer is asking. And then we have a framework we can adapt to future needs. This is really really really true when your website layout is coming from a Web Designer you never knew or you’ve never worked with and also he knows only PhotoShop and you receive a PSD… You need full control everywhere… And the PRADO component architecture helps a lot to reuse a visual part of the page. Is like playing with LEGO!

Was there any area that you felt PRADO got in your way or slowed you down?

No.

Did you create any cool components while developing the site?

Not really. UI was really simple and we simply created composite components.

What was the most challenging part of creating the site and how did PRADO fit into it?

The most challenging was making a “nonweb” customer to understand what to do with a Web Site from a technical point of view.

What would you have done differently if you were to do it all again?

CMS feature like uploading documents. At the moment is a WebDav based access. Not a PRADO upload via form.

What is your favorite thing about PRADO?

How easy it is using Active Components.

What is your least favorite thing about PRADO?

Too many event phases (11 or 13 I don’t remember). “init”, “load”, “preRender”, etc. 99% of the time we needed “init” and “load” only. When you have pages with lots of components every event dispatching to simply do nothing can be costly. I was thinking to have a “PradoLight” with less event dispatching.

If the PRADO fairy gave you one wish what component or feature would you wish for?

PRADO extension!

-

I want to thank Dario Rigolin for giving us his time to share his knowledge with the community and hope to see more good stuff from him in the future.

If you enjoyed this interview and would like to see more please comment.

Posted in Ajax, PHP, PRADO | 1 Comment »

25th Jul 2007

PRADO Watch: 25th July 2007

We got some big happenings in the PRADO community, some cool new components and if you can get to New Delhi there’s a sweet PHP camp going to happen.

The PRADO Community Project

If you’ve ever wished that PRADO had a bigger more active community, then your wish is coming true. I’ve spearheaded a movement within the current community to really start to take the PRADO community to the next level. So come on over and see what we’re doing to generate more excitement and how you can get involved.

Just Checked In

TTabPanel
Tomasz Wolny (aka Ykee) has had his community contributed component YTabPanel added to the core PRADO framework as TTabPanel with some extra functionality added by Qiang Xue. Congratulations Tomasz and great work.

Focus problem with dynamic validator messages fixed.

As pointed out by vincedev in his thread there was a problem with form submits not happening due to the form elements moving around if you were using dynamic validation messages. That has now been fixed by tof06, thanks Tof.

The Community Component

Oracle support for Active Record
Marcos Nobre (aka marcosanobre) has submitted a patch to add ActiveRecord Oracle Drives to PRADO. He also open a thread in the forum so if you have any questions about it that’s the spot.

DNGFeed
Ciro Mattia Gonano (aka ciro) has created a complement component to TFeedService that helps you quickly build RSS, ATOM and OPML feeds. There is a caveat that the current release of PRADO (3.1) forces TFeedService to text/xml as the content type. This has been fixed in the SVN.

TDBContent
javalizard has post a cool component that lets you store that contents of the control in a database but treats the record returned as if it was template code being parsed by PRADO.

PRADO at New Delhi OSS Camp

Qiang Xue posted a thread in the forum about PRADO being at the New Delhi PHP Camp in India as part of the New Delhi OSS Camp as a whole. I can’t find any reference to PRADO on their site but lots of other PHP frameworks are mentioned so maybe they are still looking for a speaker for PRADO.

Posted in PHP, PRADO, PRADO Watch | No Comments »

10th Jul 2007

PRADO Watch: 10th July 2007

I’m still playing with the Prado Watch format, I may push it up to a weekly post. Please give me any feedback you may have.

Releases

3.1 finally gets it’s stable release, I like to think of it as “Prado Web 2.0″. You can now confidently put all the cool new features into your production code. If you have enjoyed Prado but weren’t sure about recommending it to your friends and colleges now is the time to send them that link!

Don’t forget to check out the demos section it has ten great demos and a screencast to checkout some even with tutorials that go with them. The release says there is a blog tutorial but for the life of me I couldn’t see a link in the demo area, so here is a direct link to the blog tutorial.

Just Checked In

TErrorHandler, which is the default error display class received the addition of two new methods getErrorTemplate() and getExceptionTemplate() this is going to make having your own custom error messages much more simple to implement.

Components

Tof has release a very exciting set of components under the name Csitemap. The release consists of four components, I won’t go into detail but the most exciting thing for me is it has a standalone site map module. This allows you to create a new style of menu with out having to write any code for how the pages are configured, just tell people downloading your menu component to use Tof’s CSitemapManager. If you’ve got some menu code sitting out there but haven’t released it because didn’t want to write all the configuration code, go create a components that sits on top of Tof’s work and your done.

In The Wild

Dario Rigolin of ePortal Technologie has just released www.foxcoverplay.com a Prado built site using Prado 3, I18N and Ajax.

Next Time On Prado Watch

I’ll be talking to Dario Rigolin about his experiance building www.foxcoverplay.com and some of the other work him company dose with Prado.

If you have any suggestions for other people from the Prado world you would like to read an interview for and what you would ask please post it in the comments.

Posted in Ajax, PHP, PRADO, PRADO Watch | No Comments »