Planet eZ publish
Plus a couple of improvements and bugfixes
...was it worth the wait?
- it includes a list of all the known FKs between tables, tested on eZP 4.7
- it can check them via command line
- any FK violation which you think is legit, please report as bug either on projects.ez.no or github
Get it from https://github.com/gggeek/ezdbintegrity
eZ has changed a lot over the last year: management changes, slight product strategy update, new engineering office in Katowice, Poland, and not the least: technical changes! And we have been wanting to share more on such changes for a while. Why they happen, why we went such way and not another. This is what this blog is about.
Back in October 2013, Morag and I started walking the London LOOP - with section 1. It took nearly four months before we embarked on the second section. The delay was mostly caused by the short days and the terrible weather we have had during the winter. But with the Sun returning and the days getting longer it was time to do part 2: Bexley to Jubilee County Park. We originally intended to do the walk on February 15th, but all the trains towards Kent were buggered due to lots of falling trees caused by the latest storm — hence our second attempt last Sunday. Why I thought it was a good idea to do this right after the PHP UK Conference is a bit of a mystery to me still.
Of course, the travel to the start of the walk was not as straightforwards as it could be. With lots of engineering work and bus replacement services. We ended up taking the train to Barnehurst and bussing it to Bexley—much better than the route that was suggested by National Rail Inquiries: train from Charing Cross to Plumstead, bus to Dartford, and then the train back to Bexley.
From Bexley startion we crossed under the railway and headed South. Just before getting to the river Cray, we walked through some woodland where a fair amount of trees had not survived the winter storms. Joining the river after a mile or so we noticed that it was still very high, and rather fast flowing. In fact, it was so high that many of the paths were either flooded—or very muddy. The muddy path opened up into the Stable and Footscray Meadows and a very lovely bridge, the Five Arches, crossing over the river Cray.
I think there was a bit more water in the meadows than there usually was. Or perhaps the locals tried to create an extra lake. In any case, there was no dry way out of the meadows into the direction we had to be going. The photo to the right just points out how much water we had to wade through. I estimate it was about 3 inches deep.
Past the meadows and All Saints Church we stopped in Sidcup for lunch. Although the route goes past a pub, we decided to skip and instead just pick a cafe in Sidcup itself. But not before we encountered this friendly horse.
Sidcup itself seems like a little village with not much going on, but lunch at Urban Food was decent. After filling up we continued the walk by finding Sidcup Place and crossing the A20 into Scadbury Park.
Scadbury Park is rather large and a local nature reserve. It is also old and has a ruined moated manor in the middle, which was owned by the Scathebury family. The LOOP as mapped on OpenStreetMap had the route go past the manor, but I found that was incorrect as shown by the sign posts on the route.
From Scadbury park we crossed into Petts Wood, or rather perhaps it should be called the Petts Mud Flats as there was nearly no space without mud — some times up to half a foot deep. An indication of the amount is visible in the image to the right. I don't think I've ever had this much mud on a walk actually.
This meant that we were a bit delayed and we would just miss the train home from Petts Wood station. When coming out of the woods we crossed multiple sets of train tracks. The section as shown on the left is just before the end point of second section in the Jubilee Country Park.
The weather was colder than the first section, but that was no surprise as it is February. At around 8°C there was a fair bit of wind, but we kept it dry.
For the full photo series of the LOOP, see my Flickr set.
I have had a couple of problems related to eZ Autosave the last year, which have been quite a challenge to figure out. So in case someone else might have the same problem, I'll make a note of it here.
The first time that my improved DateTime support made its way into PHP was officially in PHP 5.1, although the more advance features such as the DateTime class only made it appearance in PHP 5.2. Since its introduction the DateTime class implementation suffered from one design mistake — arguably not something that even an RFC would have highlighted.
In PHP, if you do the following:
modify( 'next monday' )->format( 'Y-m-d' ); } $d = new DateTime(); echo formatNextMondayFromNow( $d ), "\n"; echo $d->format( 'Y-m-d' ), "\n"; ?>
modify() method does not only return the modified DateTime object, but also changes the DateTime object it was called on. In an API like above, this is of course totally unexpected and the only way to avoid this behaviour is to do the following instead:
echo formatNextMondayFromNow( clone $d ), "\n";
This mutability property that all modifying methods of the DateTime class have is highly annoying, and something that I would now rather remove. But of course we cannot as that would break backwards compatibility.
So in PHP 5.5, after a few stumbles, I finally managed to rectify this. I did not change the original class's behaviour, but instead, I added a new class. The new
DateTimeImmutable class which does not display this "mutable" behaviour, and only returns the modified object:
modify( 'next monday' )->format( 'Y-m-d' ); } $d = new DateTimeImmutable(); echo formatNextMondayFromNow( $d ), "\n"; echo $d->format( 'Y-m-d' ), "\n"; ?>
Both the old DateTime and the new DateTimeImmutable classes implement the DateTimeInterface interface. This interface defines all the methods that both classes implement. Of course, they can not be methods that change the object. That is why the interface is restricted to formatting and other read-only methods, such as getTimezone.
Perhaps in the future (PHP 6), we can replace the mutable DateTime class with the new DateTimeImmutable variant. Until then, you will have to take care of this yourself!
A workshop which will cover eZ Publish CMS development will be held at Friday, February 28, 2014. at 8 am on the campus of the Faculty of electrical engineering in Osijek, Croatia.