Blogs
PHP Subconference at FrOSCon 2013
This years FrOSCon – one of the most awesome open source software conferences – is right ahead and we are organizing a PHP project room again this year. Read more for details…XPath expert needed
In the PHPCR implementation using Doctrine DBAL we support search queries by converting the SQL2/QOM statements into XPath queries that we run on the XML stored in an RDBMS. Sounds insane, yes .. but it works pretty well .. obviously will not scale very well .. but it works for smaller data sets and there will be ways to improve performance later. In terms of functionality we have everything working quite well including JOIN support that was added recently.
However we are stuck with multivalue queries. What makes it particularly tricky is that we do not know which properties are multivalue and which are not as illustrated by these tests.
As you can see in the test we have a multivalue property "tags" and in the SQL2 statement we want to test if that multivalue property contains both "foo" and "bar". However inside the query engine we do not know that this property is multivalued or not.
The relevant code is in QOMWalker:: sqlXpathValueExists() and QOMWalker:: sqlXpathExtractValue(). As you can see it currently only looks at "sv:value[1]".
You can find some more information here:
https://github.com/jackalope/jackalope-doctrine-dbal/issues/88Phix 0.16.0 Released
Phix is a tool for creating and managing PHP components and tools and releasing them as PEAR packages.
I’ve pushed out Phix 0.16.0 this evening, with the following changes:
- phing build-vendor now removes the component’s own code from the vendor/ folder. (We build the vendor/ folder using PEAR, which installs the component into the vendor/ folder … sigh)
- An update to Phing changed the default behaviour of the <fileset> tag, breaking backwards-compatibility. I’ve updated our build.xml file to make the <fileset> tag revert back to its original behaviour.
To update your copy of Phix, please run:
pear upgrade phix/phix4componentdev
Any problems, please let me know.
UA Testing with Selenium and PHPUnit
Last week I spoke at php[tek] 2013 where I explained to people how to get started with Selenium IDE to record user interaction with the web interface, convert them to PHPUnit testcases and automatically execute them on multiple browsers on multiple platforms.The feedback I got was awesome, you're all a great crowd! But on twitter I also received a bunch of questions regarding how to set up multiple platforms and why I used Windows in my presentation to deploy to.So today I deceided it was time to write a full article on this subject.What is Selenium?
Selenium is a tool that allows you to continuously test user interfaces of web applications. The most common usages for Selenium testing are the following:- testing elements are (not) on the web interface
- users can't break out a certain flow on the web interface
- calculated values are correct after modification
- errors appear on screen when mistakes are made by users
- reported issues are valid
In general we call these type of tests User Acceptance Tests or UAT and are all focused from the point of the end-user, the person using the web interface to accomplish a certain goal.Why are they important?
UAT have their own right to exist. Just like regular unit, performance and stress tests they have their own agenda and are adressing a particular part of your application that needs testing. All to prevent your customers/visitors from finding issues, bugs or just unfunctional pieces on your web application and loose their trust in your products or services.Therefor it's always good to invest in the "visibile" part of your web application. Especially when using javascript, you want to ensure it always works as intended.Disclaimer
Selenium tests are in no way a replacement for regular unit tests. Their focus is on generated output of your web application within a browser. Unit tests are still necessary to ensure the logic of your application is not broken when making modifications or adding new functionality!Setting things up
Truncated by Planet PHP, read more at the original (another 36325 bytes)
Web2bb 0.0.9 Released
This is the latest update to the WEB2BB Framework and includes a simple fix for an error that failed to catch an exception. The WEB2BB framework is a fully functioning MVC style framework that utilizes the best features of PHP 5.3 and above. By making use of the latest additions to PHP, the WEB2BB framework is able to provide sleek code and optimal performance. It does not try to be all things to all people and so the codebase is kept to a minimum.Test For Prime Numbers With PHP Regular Expression
This function provides a novel method of testing if a number is prime, by using a PHP regular expression.Swede From Future Says He Can Code
A revaluation today as a Swedish national, who has traveled back in time, says he can code!Simple Mysql PHP Menu
There are possibly as many menu systems available for PHP and MySQL as there are PHP programmers. Here is yet another way of generating menus from a database.Simple Mysql PHP Menu
There are possibly as many menu systems available for PHP and MySQL as there are PHP programmers. Here is yet another way of generating menus from a database.PGSQL Cheat Sheet
This table provides a simple ready reference to some common commands used in PostgreSQL. Ideal for those more accustomed to MySQL or other databases.




