245681 items (663 unread) in 24 feeds
CNN
(6 unread)
MSNBC
(16 unread)
PHP
(57 unread)
Deals
(573 unread)
Tech
(3 unread)
Web Development
(1 unread)
CNN Money
(6 unread)
Frugal Blogs
(1 unread)
Over the last couple months I had a chance to help create a great new product for Stumbleupon. Su.pr lets create short urls, publish directly to Facebook and Twitter and gives you great tracking and statistics around them. Su.pr also helps you get more traffic by making it easy to get your content in front of the Stumbleupon community.
Last week we launched our API which lets you integrate shorten and post functionality into any site or application. Today we are adding the ability to use your own domain for shortening. This lets you have urls like [joshuaeichorn.com] so your readers can know what domain they are going too before they click on the link.
Now down to the fun part installation.
Step 1, Sign up for Su.prJust go to the su.pr homepage and sign up using suprjosh for the invite code (The code is good for 500 sign ups).
I’m not going go over this in detail since instructions are already available from su.pr.
Note: when installing the rewrite rule you’ll want to make sure its not catching any of your other pages, I put mine after all my custom rules and added a condition to check the given url wasn’t the name of a file or directory.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^[a-zA-Z0-9]{4}$ supr.php?supr=$0
RewriteRule ^supr_settings.json$ supr.php?check_install=$0
If your doing your URL rewriting in PHP you might want to handle the link detection there instead, but 4 character words with no extension aren’t too common.
Step 3, Test is outNow that you are up and running any short url created on Su.pr for your domain will be use your domain instead of su.pr for the shortening. If you ran into any problems let me know, I will see what I can do to help.
Details on how things workThe double redirection at the end lets us collect stats and do the required setup for showing the Javascript version of the Stumbleupon toolbar.
While the manual for Zend_Session does discuss unit testing and the read-only exception, it has no mention of an exception I encountered recently while unit testing. I admit that the reason I encountered the exception is most likely because I'm Doing It Wrong. However, given reality, I did not have time to properly make the class, or at least do it better. I received the following exception:
exception 'Zend_Session_Exception' with message 'Session must be started before any output has been sent to the browser; output started...'
The problem was, of course, that the feedback from previous tests was already outputted to the screen. I could've solved this by playing with my test suite and just starting sessions at that level but that wouldn't have been the best solution. In fact, I'd qualify that solution under bandaids (solutions that mask a problem instead of fixing them). If you can't see why it is a bandaid, I'm happy to discuss it but for once, I"m going to try to stay on topic and not digress any further than I have.
So, here's the scenario:
The solution? A little 'undocumented' static variable:
Zend_Session::$_unitTestEnabled = true;
Ok, undocumented is a bit misleading. You won't find out about it by looking at the Manual but will find it when you're digging through the API. So it is documented, just not well. I'm guessing because it is rare to encounter the exception. I'm not surprised that I encountered it since my projects always seem to have some degree of weirdness, which makes for an interesting learning curve thats compounded with Zend's curve.
W00t! 5.3.0 stable is out. Never expected it to take this long, but its a lesson to keep faithful to the "release early, release often mantra" in the future. At some point a branch can just get too big, that it becomes close to impossible to release it. While I do appreciate the various thank you (or in the case of backslash haters "drop dead") emails, I want to highlight that all I really did is take over the tasks that require at most a bit of patience and certainly no technical skill (well I did have to update a few websites, but even there I needed Hannes to fix all my typos).
So Johannes was the one who was especially in the last few weeks laboring over tons of patches and bug reports and sleeping less and less as we got closer to the actual release date. Pierre was of course also a huge help in this process .. and of course the countless developers that worked on the actual code that you all can now download and play with.
Now I am not saying that 5.3.0 hasn't eaten up my share of time. I am very thankful to my employer Liip that let me spend time on all of this. A bit of free time also went into 5.3.0, which I hope to now direct towards my music career a bit more :)
It was a long run and I'm sure it felt like an eternity for many - for me it certainly did. PHP 5.3 was branched of over two years ago and finally is ready to be called 5.3.0.
The php.net website and many other blogs discuss the features - from often loved closures, to well discussed namespaces to the sometimes hated goto - so I think I don't have to this here but instead can focus on that what really matters:
So with that: In case you didn't do already: Browse over to php.net and grab your copy, it's for free!
If you want to celebrate the release and are close to Munich: We're planing a PHP Release Party on July 17th, details on that will follow.
Stefan Esser's Bytekit is an extension to the PHP interpreter that provides a userspace representation of the bytecode that is generated during the PHP interpreter's compilation phase. The extension not only exports the raw bytecode data but also provides control flow information in the form of code flow graphs and basic blocks. Among other things, Bytekit is developed with the goal of providing a foundation to develop all kinds of static and dynamic code analysis tools.
bytekit-cli is such an analysis tool that I started to develop immediately after Stefan released Bytekit 0.1.0 at the International PHP Conference - Spring Edition in Berlin earlier this year. This posting provides an overview of the functionality implemented so far.
Some days ago I released a little bugfix release of the PHP extension uploadprogress. It fixes one nasty bug with cleaning filenames with preceding whitespace, so an upgrade is highly recommended. It furthermore improves tmp-directory detection, but can only do this during compile time.
Last but not least, the example was improved. It checks for more possible wrong settings (like if the tmp-directory is there and writeable) and gives more feedback. Due to the nature of how this extension works, it may be a little bit tricky to get it working, but the example should help. See also the "Common issues and some answers" post for some hints.
According to Drupal.org, it has now been four years and five days since I first joined the Drupal community. My how time flies, and how much has changed since then.
Lately, there have been many well-intentioned but I would contend misguided ideas proposed to handle noise on public programmer mailing lists. The premise is that in fact there are very important messages being drowned out in a chorus of irrelevant messages from ill-informed developers. Warnings of inefficiencies have been tossed about quite a bit as the curse of "bike shedding."
To understand what they mean by "bike shedding," one must know the bike shed parable. Once upon a time, a group of people got together to build a nuclear reactor to power the city. Everyone in the town said "great, we need more power," and so they got to work designing the plant. Everything was going great, the design of the reactor sailed by until one day, one of the citizens said "hey, let's build a bike shed for the workers so they don't have to come to work in cars and can get exercise." Everyone agreed until an argument broke out over whether to paint the shed blue or red. Eventually, the whole process broke down, and the plant was never built because they couldn't choose a color to paint the bike shed. The moral of the story: everyone agrees on the complex important things, but the process breaks down over arguments about irrelevant details.
I think we can all agree that this is a tragic parable, illustrating what happens when the process for decision-making breaks down.
When there is a problem of signal-to-noise ratio on a mailing list, the problem has to do with the process for accepting public input, I completely agree with this. However, I am troubled by the implication that having unmoderated mailing lists is the intrinsic problem with open source that must be solved. There is a crucial balance between rewarding quality and being open to the outsider that is the life blood of open source. You could even think of it as the "affirmative action" of the programming world: we recognize that amateur programmers who do not come from the establishment of the temples of programming in academic computer science departments or even computing careers, may have ideas that are better than the most learned highest karma achiever.
For my musician reader: Open source thrives on meritocracy: the idea that those who can do junk have more influence than those who can't do as much junk. Karma is the thing with which these individuals are rewarded. Only those with karma are able to actually make changes to the source code. It doesn't matter who you are, or what your background is, if you demonstrate good coding and community, you get karma.
String quartet rehearsal is similar, the best ideas get more weight regardless of whether the person who has them is playing the melody.
Why am I talking about string quartet rehearsal in a post about moderated programmer mailing lists? I come from a profession (professional chamber music) where "karma" is a fluid object, and unlike the programming world tends to break down when we attempt to nail it down. My string quartet has found that rather than try to decide who will be "the decider" for tough decisions, it's not just friendlier, but is also far more efficient to devote our individual energies to two essential things:
Sometimes they are crackpot, but most of the time, the reason they just seemed crackpot because they were outside the boundaries of our collective imaginations.
An example: in our first years together, we occasionally would get into endless arguments in my quartet about whether to play a particular musical section faster or slower (PHP developers: think endless namespace separator arguments). After a long time of arguing about this, it usually turned out that we were asking the wrong question, until one day we would find the right question, which was something like "how long are the phrases?" (PHP developers: the right question turned out to be "how do we solve the ambiguity between static methods and namespaced functions?"). After finding the right question, we stopped arguing nearly as much, and the music sounded much better after we all re-adjusted our thinking.
This illustrates an important distinction: the question of how fast to play was not an irrelevant "bike shedding" detail, it was a crucial part of the solution. We still had to choose a speed to play, just as the nuclear power plant people still would need a place to put their bikes. By changing the question from "How fast?" to "How long is the phrase?" we were actually solving the question of what color to paint the bike shed at the same time we solved the question of how to design access to the nuclear reactor, not ignoring it.
The best solution is for t
Truncated by Planet PHP, read more at the original (another 846 bytes)
Lately, there have been many well-intentioned but I would contend misguided ideas proposed to handle noise on public programmer mailing lists. The premise is that in fact there are very important messages being drowned out in a chorus of irrelevant messages from ill-informed developers. Warnings of inefficiencies have been tossed about quite a bit as the curse of "bike shedding."
To understand what they mean by "bike shedding," one must know the bike shed parable. Once upon a time, a group of people got together to build a nuclear reactor to power the city. Everyone in the town said "great, we need more power," and so they got to work designing the plant. Everything was going great, the design of the reactor sailed by until one day, one of the citizens said "hey, let's build a bike shed for the workers so they don't have to come to work in cars and can get exercise." Everyone agreed until an argument broke out over whether to paint the shed blue or red. Eventually, the whole process broke down, and the plant was never built because they couldn't choose a color to paint the bike shed. The moral of the story: everyone agrees on the complex important things, but the process breaks down over arguments about irrelevant details.
I think we can all agree that this is a tragic parable, illustrating what happens when the process for decision-making breaks down.
When there is a problem of signal-to-noise ratio on a mailing list, the problem has to do with the process for accepting public input, I completely agree with this. However, I am troubled by the implication that having unmoderated mailing lists is the intrinsic problem with open source that must be solved. There is a crucial balance between rewarding quality and being open to the outsider that is the life blood of open source. You could even think of it as the "affirmative action" of the programming world: we recognize that amateur programmers who do not come from the establishment of the temples of programming in academic computer science departments or even computing careers, may have ideas that are better than the most learned highest karma achiever.
For my musician reader: Open source thrives on meritocracy: the idea that those who can do junk have more influence than those who can't do as much junk. Karma is the thing with which these individuals are rewarded. Only those with karma are able to actually make changes to the source code. It doesn't matter who you are, or what your background is, if you demonstrate good coding and community, you get karma.
String quartet rehearsal is similar, the best ideas get more weight regardless of whether the person who has them is playing the melody.
Why am I talking about string quartet rehearsal in a post about moderated programmer mailing lists? I come from a profession (professional chamber music) where "karma" is a fluid object, and unlike the programming world tends to break down when we attempt to nail it down. My string quartet has found that rather than try to decide who will be "the decider" for tough decisions, it's not just friendlier, but is also far more efficient to devote our individual energies to two essential things:
Sometimes they are crackpot, but most of the time, the reason they just seemed crackpot because they were outside the boundaries of our collective imaginations.
An example: in our first years together, we occasionally would get into endless arguments in my quartet about whether to play a particular musical section faster or slower (PHP developers: think endless namespace separator arguments). After a long time of arguing about this, it usually turned out that we were asking the wrong question, until one day we would find the right question, which was something like "how long are the phrases?" (PHP developers: the right question turned out to be "how do we solve the ambiguity between static methods and namespaced functions?"). After finding the right question, we stopped arguing nearly as much, and the music sounded much better after we all re-adjusted our thinking.
This illustrates an important distinction: the question of how fast to play was not an irrelevant "bike shedding" detail, it was a crucial part of the solution. We still had to choose a speed to play, just as the nuclear power plant people still would need a place to put their bikes. By changing the question from "How fast?" to "How long is the phrase?" we were actually solving the question of what color to paint the bike shed at the same time we solved the question of how to design access to the nuclear reactor, not ignoring it.
The best solution is for t
Truncated by Planet PHP, read more at the original (another 846 bytes)
The problem with mailing lists is that they are a free for all, it doesn’t matter who posts, everybody at every level gets to see the post.
In the real world, communications pass through a hierarchy of people, escalating as necessary, passing from person to person up the chain.
This means that, given enough time, any mailing list starts to have a large noise:signal ratio, at least for any given person’s take on the list;
they want to read what they want to read, and don’t need to be distracted ignoring the stuff they don’t want to read.
There is an unspoken — some what hap-hazard — hierarchy among the community, which with some thought, I believe, could be defined, refined
and utilized to our advantage. As an example:
- Active internals contributors with access to internals CVS (contributions of code and useful discussions)
\
- Active internals contributors without access to internals CVS (patch submitters, useful discussions)
- Inactive internals contributors with access to internals CVS (previous contributions of code and useful discussions)
\
- Active non-internals, PHP contributions (docs, phpweb, PEAR)
- Active community leaders
- Active project leaders
- Active linux distro maintainers
\
- General Users with a high understanding
\
- Genernal users with little understanding (newbies)
If we take each of these, and assign them a number:
L1 - Active internals contributors with access to internals CVS (contributions of code and useful discussions)
\
L2 - Active internals contributiors without access to internals CVS (patch submitters, useful discussions)
L2 - Inactive internals contributors with access to internals CVS (previous contributions of code and useful discussions)
\
L3 - Active non-internals, PHP contributions (docs, phpweb, PEAR)
L3 - Active community leaders
L3 - Active project leaders
L3 - Active linux distro maintainers
\
L4 - General Users with a high understand
\
L5 - Genernal users with little understanding (newbies)
Now, what if, at any level, you could only see (by default) 1 level below you (and all levels above you). For example: L1 can see L2, L2 can see L3 etc.
This immediately means that you only see stuff that might be relevant to you; however, as a community, we then lose the ability for newcomers to contribute good ideas; because they would start out with zero karma. To help solve this issue, we adjust karma based on responses:
ScenarioIn this case, only the thread in question is bumped up, however given enough L2/L1 (weighted) direct responses over different threads, a L3 user can gain karma and eventually become a L2 user (and obviously this applies to anyone moving up the chain)
In this way, threads (and by this mechanism, users also) can organically make their way up the tree as they gain traction, are discussed at each level and moved up.
I believe it would be possible to have a ”’single”’ mailing list that could span everything from internals right down to php-general, but this is probably not desired! It would however allow the users of any list to, regardless of their experience in the tree, contribute without weighing down the list.
FeaturesIn this way, we can, in some ways, automate the karma, and in someways advance it through o
Truncated by Planet PHP, read more at the original (another 795 bytes)
9 months after the 1.2 release, I just published a long overdue release of the SabreAMF library.
The package mainly contains bugfixes. Upgrading is highly recommended.
Special thanks to Ionut Stoica for creating a Drupal Module, and Asbjørn Sloth Tønnesen for the bugfixes and patches. Enjoy!
Earlier this week, Google launched a campaign to make the web faster. It appears to be a call for improving the quality of web sites in general, but with a focus on performance.
The project includes an article on “PHP performance tips”, which is bordering on being ridiculous. There are of course lots of blog posts with similar non-sense around the web, but since this is being endorsed by Google, it’s fair to assume that people might take it at face value. That’s unfortunate, as almost none of it is true. The PHP Team responded back with this message, wherein they refute the ungrounded non-sense.
What’s more troubling however, is the whole approach to performance optimisation as a matter of “knowing the secret handshake”. Optimisation is far more complex than that, and spending time on these “optimisation tricks” are rarely worthwhile and might often lead to unmaintainable code, if applied too early. It’s a fine line, because there are of course certain things that you shouldn’t do (Such as hit the database within a tight loop, if you can send one query instead), but there are likewise lots of things that are a complete and utter waste of every body’s time. It’s a pity that this article failed to keep those two separated.
Performance optimisation is not magic. The real way to deal with it, is to measure and analyse. It is almost impossible - even for a highly skilled programmer - to anticipate exactly where there might be bottle necks in a program. Using a profiler, gives you real numbers to relate to, rather than wild guesses and superstition.
For PHP scripts, there is the freely available Xdebug extension, which provides detailed information on both memory usage and execution time on a per-function basis. It’s easy to install and with the simple WebGrind as a frontend, you’re up and running in no time.
<script src="http://ads.aws.sitepoint.com/adjs.php?region=137&did=adz&adtype=horizontal" type="text/javascript">
Earlier this week, Google launched a campaign to make the web faster. It appears to be a call for improving the quality of web sites in general, but with a focus on performance.
The project includes an article on “PHP performance tips”, which is bordering on being ridiculous. There are of course lots of blog posts with similar nonsense around the web, but since this is being endorsed by Google, it’s fair to assume that people might take it at face value. That’s unfortunate, as almost none of it is true. The PHP Team responded back with this message, wherein they refute the unfounded nonsense.
What’s more troubling however, is the whole approach to performance optimisation as a matter of “knowing the secret handshake”. Optimisation is far more complex than that, and spending time on these “optimisation tricks” are rarely worthwhile and might often lead to unmaintainable code, if applied too early. It’s a fine line, because there are of course certain things that you shouldn’t do (such as hit the database within a tight loop, if you can send one query instead), but there are likewise lots of things that are a complete and utter waste of every body’s time. It’s a pity that this article failed to keep those two issues separate.
Performance optimisation is not magic. The real way to deal with it, is to measure and analyse. It is almost impossible — even for a highly skilled programmer — to anticipate exactly where there might be bottlenecks in a program. Using a profiler gives you real numbers to relate to, rather than wild guesses and superstition.
For PHP scripts, there is the freely available Xdebug extension, which provides detailed information on both memory usage and execution time on a per-function basis. It’s easy to install and with the simple WebGrind as a front-end, you’ll be up and running in no time.
<script src="http://ads.aws.sitepoint.com/adjs.php?region=137&did=adz&adtype=horizontal" type="text/javascript">
Pádraic:
Thanks for taking the time to discuss this with me on Twitter last night. I’m the Associate Publisher for Wrox, I’m the person usually behind @wrox on twitter.
After meeting with the editor who ran the PHP list for us, you’re right. The titles of these PHP6 books, some of the references to PHP6 in the books, what isn’t covered in the books, all prove we made a mistake, something went wrong. But how, why?
Elizabeth (and thanks for her measured response) is correct in part of her assessment that books take a long time to write and publish. I’m sure that when the editor and authors started these books in Spring 2008, they’re thinking was that 6.0 would indeed be a stable release by early 2009 (if not sooner) and they were aiming for that. But clearly along the way we dropped the ball on checking references to things like the non-existent “6.0.0 stable.”
In the Beginning PHP6, MySQL, Apache book, I can actually understand the rationale not to cover Unicode there. Given that Unicode is primarily valuable to someone internationalizing a site or localizing it for multiple languages – topics that I wouldn’t consider “Beginning” level – I can see why it wasn’t covered. (Before becoming associate publisher, I was actually our ASP.NET editor for most of the last 5 years and we don’t for example cover internationalization/localization in our Beginning ASP.NET 3.5.) So we want to have a book that Beginning level customers understand will work with PHP6 if that’s the version they’re using, but we didn’t communicate right what that meant in this context where there weren’t major new v6 features at the level we thought a beginner would need.
The professional book stumps me more. It’s hard for me to understand how that book doesn’t have a chapter on Unicode. It looks like an oversight by everyone involved in the book.
So where do we go from here and get better than this to eventually prove we’re worthy of better than when @bicatu says “That reminds me why I've never bought a Wrox book?”
First, I’ve asked the team involved with Beginning PHP6 scheduled to ship to the printer this week to pull that book back, to read your post and the subsequent twitter discussion and to make sure we aren’t making the same mistake a third time. I want the author and editors to provide a level of confidence that the PHP6 features that should be covered are, that the discussion of the current state of PHP6 is accurate, and the that the title, subtitle, and marketing copy on the book and online accurately reflects what is and isn’t covered.
Second, publishing the ri
Truncated by Planet PHP, read more at the original (another 1839 bytes)
Notepad with GtkSourceview is a program developed in Php-Gtk using Glade.
To use you must have installed on your pc Php-Gtk, just do a search on the internet so you can discover.
is a modified version of notepad made from kksou But with gtksourceview and use its property for the editing of code in this case was set php.
It almost happened, but it didn't for now. Originally we planned to release today. But again a few issues came up, even with Johannes deciding that sleep is for the weak, it just seemed unwise to announce the release today. So we pushed things back a few days, so the new date is June 30th (meaning it will be a Tuesday release). This also gives the documentation team, who have been expanding the 5.3 docs like crazy, a few more days to beef things up even more. Now is really high time to ensure that you have a PHP 5.3 compatible release of your software ..
6. Extract the tarball, and change to the directory it creates:
tar -vxzf php-6.0.0.tar.gz
cd php-6.0.0
3. Scroll down to the Complete Source Code section, and click on the appropriate link to download
the latest tar.gz package.
The most recent stable versions that were in effect at the time of this book's writing were:
PHP: Version 6.0.0
Apache: Version 2.2.9
MySQL: Version 5.0.67
Future editions of this book will address changes and improvements in these programs as they become
available.
Truncated by Planet PHP, read more at the original (another 1324 bytes)
Gestern war ich zu Gast bei der DOAG Regionalgruppe Rhein-Main, um etwas über "PHP5 und Oracle" zu erzählen. Der Vortrag richtete sich an DBAs, für die die Webwelt eine recht neue Welt ist und zeigt auf, warum gerade PHP eine passende Sprache für (businesskritische) Webanwendungen ist und weshalb PHP5 (seit einigen Jahren) auch sehr gut mit Oracle zusammenarbeitet. Den Vortrag werde ich im September noch mal bei der DOAG Regionalgruppe in Hamburg halten.
PHP5 und OracleView more PDF documents from mayflowergmbh.
Question from one of the PHP-GTK members:
"I looked at your submission for RocketDMS on php-gtk.eu, and from the screenshots on your site, the app does not look like php-gtk at all. Is it
really done in PHP-GTK ?"
Reply:
Absolutely 100%! It uses gtk 2.0 (2.10) and uses libwimp giving it a native windows look
and feel. The screenshots are from Windows XP.
Mike
Via reddit: The goto documentation got an xkcd overhaul. :)
I was emailed this a short while ago - thought it worth sharing
<quote>
Five years ago, Packt published its first book, ‘Mastering phpMyAdmin for Effective MySQL Management’. In the years that followed, Packt has published over 200 books on many different subjects and technologies.
We think it’s important to take the time to celebrate and thank the people who have made this possible. Therefore as our way of saying thank you for your support over the last five years, we have decided that over the next few weeks, Packt will be offering new and existing customers’ five exclusive offers.
The PEAR Installer Manifesto is one of the eBooks that we are offering to our readers. This book shows users the power of this code management and deployment system to revolutionize their PHP application development.
To download a free PDF copy of this book, simply visit [www.packtpub.com] and login to your account, or create one if you don’t already have one, and scroll down to your download area. Here you will see a link to the eBook, which you can download as many times as you like. In addition to this book, you can also download other eBooks on various technologies for free.
You can find more information on this offer by visiting [www.packtpub.com]
</quote>
RocketDMS is a multi-user document management system. This is a native windows application that provides easy storage, tracking, search and retrieval of electronic, scanned and physical documents. Built in scanning and full text searching. RocketDMS can be used as a GUI for Subversion and can be used with existing subversion repositories (>=1.6).
Thanks its dedicated community, symfony has been chosen as a finalist for the 2009 Sourceforge Community Choice Awards in no less than three categories!
Best Project
Best Tool or Utility for Developers
Best Project for the Enterprise
Some other PHP projets are also finalists: phpMyAdmin, FLOW3, Joomla, TYPO3, and vtiger CRM.
If you like symfony, or if you just like PHP, or if you just want to be kind with us, please, consider voting for symfony: [sourceforge.net]
At the Barcamp 2009 Alex, Michele, Michel, Markus, Sven and I continued a project that had already begun at the Barcamp 2008 - Creating an LDAP structure for internal Mayflower use and implementing a basic tool set for the administration.
A new LDAP scheme was created, a maintenance tool based on Zend Framework and Dojo was created and the tool was embedded as addon in the current PHProjekt 5
I'm changing jobs! Well, at the very least I'm leaving Filemobile.
It was for this job I moved from Hilversum, the Netherlands to Toronto, Canada. A very scary move for me at the time, but it turned out to be one of the best experiences of my life. I've ramped up my English, and went through the entire process of working out an idea to a successful company. As an owner I'll definitely still stay involved though, just no longer full-time.
Although moving to a new country can be intense, it would have been a lot more difficult if it wasn't for my co-workers, who've acted as both my friends and family. I doubt I'll find a work environment as fun as Filemobile. (If you live around toronto, they are looking for smart people!).
But after 3 years, it's time for something new. I'm excited to move somewhere else again, but haven't yet figured out the next step in my career path. If you have any advice or looking for someone with web development skills, definitely let me know! (resume). I'll be available for contract work, and I'll relocate wherever you are, if needed :).
Today, at the longest day of the year at the summer solstice, I am making a bit change to my life. If you're following me on twitter you probably already know what I'm up to. For everybody else, I am going to say good bye to Skien in Norway, and move to London (the one in England, and not the one in Ontario). Norway has been my home for the past five years, and I've had a great time exploring the nature as well as working at our office in Skien. Skien is a nice place, but ... not the most interesting of cities in the world. From today I will be living in London to see what life will bring me there. I am both sad to leave Norway, but I am also excited to live in a cool new place like London. I'll have awesome house mates (Hi, Mr. Þorbjörnsson, Ms. Cherry and Mr. Ray!!), and something new to put my energy in. I will continue to work as project leader for eZ Components for eZ Systems and continue to make great software with Alexandru, Tobias, Kore and Sebastian. If you are about in London, let me know! We could go for a pint or something. See you there!
Over at phpdeveloper.org I was pointed to a blog post talking about MySQLi and stored procedures. That reminded me about a small thing I recently did: When using MySQLi's multi_query to send queries which return multiple result sets you have to use a rather unintuitive API which can certainly be improved.
Recently I sat down and cooked up a small improvement for that, being an iterator fan I, of course, had to use an iterator for that and implemented the following class:
<?php
class MySQLi_ResultsetIterator implements Iterator {
private $mysqli;
private $counter = 0;
private $current = null;
private $rewinded = false;
public function __construct(mysqli $mysqli) {
$this->mysqli = $mysqli;
}
private function freeCurrent() {
if ($this->current) {
$this->current->free();
$this->current = null;
}
}
public function rewind() {
if ($this->rewinded) {
throw new Exception("Already rewinded, rewinding multiple times is not allowed!");
}
$this->freeCurrent();
$this->counter = 0;
$this->rewinded = true;
}
public function valid() {
$this->current = $this->mysqli->store_result();
return (bool)$this->current;
}
public function next() {
$this->freeCurrent();
$this->counter++;
$this->mysqli->next_result();
}
public function key() {
return $this->counter;
}
public function current() {
if (!$this->current) {
throw new Exception("valid() not called");
}
?>
This iterator is wrapping all that's needed an then can be used like that:
<php
$mysqli = new MySQLi("localhost", "root", "", "test");
$query = "SELECT 1,2 UNION SELECT 3, 4;".
"SELECT 'hi world' UNION SELECT 'foobar'";
if ($mysqli->multi_query($query)) {
foreach (new MySQLi_ResultsetIterator($mysqli) as $key => $result) {
echo 'MySQL Resultset #'.(1+$key).":\n";
while ($row = $result->fetch_row()) {
printf(" %s\n", $row[0]);
}
}
}
?>
The output will be something like
MySQL Resultset #1:
1
3
MySQL Resultset #2:
hi world
foobar
And is, in my opinion, way nicer than the classical way, which you can see on the multi_query docs page.
That code is the first revision of that idea, I'll try to improve it and port it over to C so that some future version of PHP will include it. As a disclaimer: If you plan on using this class be aware that a future PHP might bundle a class having that exact name so use your own name
Feedback welcome.
Some seriously good news here. It took several years of waiting, but, it finally happened. PHP-FPM project is officially BSD-licensed now, which means, that it has good chances to become a part of official PHP distribution.
PHP-FPM is “deciphered” as “PHP FastCGI Process Manager” and is a patch for php to greatly improve FastCGI SAPI usage in production. It adds a bunch of additional features to php’s fastcgi such as: easy php-process daemonization (with ability to specify uid/gid/chroot/log-file), safe php-processes restart (without losing requests), custom error-handling and accelerated file-upload support (requires additional support from web-server).
There’s not much documentation in english, currently, but, again, there is a good chance that it will be added really soon.
Four thousand words that distill what you really need to understand to build scalable multiuser servers: Server Design by Jeff Darcy.
I would love to have a 'Throwable' inteface in PHP, so I opened my very first feature request.
I realize this is mostly an OOP purist request, as it won't provide any real functionality.
If you agree, vote!
I had to relaunch a web site using Serendipity with a new Drupal installation. The old site had about 100 blog posts and lots of comments we did not want to loose. After some googling, i found this excellent blog post on creating drupal nodes programmatically and this useful resource on drupal node fields. i knocked up the following script that does the job. Just copy this to s9y-import.php and place it in your web root and call it in your web browser. Please back up your database in case something goes wrong (believe me, if you have no backup, it will go wrong!). You might want to read the code comments to know about the current limitations.
Read the full post to see the source code.
Memcached::OPT_COMPRESSION - -1001
Memcached::OPT_SERIALIZER - -1003
Memcached::SERIALIZER_PHP - 1
Memcached::SERIALIZER_IGBINARY - 2
Memcached::SERIALIZER_JSON - 3
Memcached::OPT_PREFIX_KEY - -1002
Memcached::OPT_HASH - 2
Memcached::HASH_DEFAULT - 0
Memcached::HASH_MD5 - 1
Memcached::HASH_CRC - 2
Memcached::HASH_FNV1_64 - 3
Memcached::HASH_FNV1A_64 - 4
Memcached::HASH_FNV1_32 - 5
Memcached::HASH_FNV1A_32 - 6
Memcached::HASH_HSIEH - 7
Memcached::HASH_MURMUR - 8
Memcached::OPT_DISTRIBUTION - 9
Memcached::DISTRIBUTION_MODULA - 0
Memcached::DISTRIBUTION_CONSISTENT - 1
Memcached::OPT_LIBKETAMA_COMPATIBLE - 16
Memcached::OPT_BUFFER_WRITES - 10
Memcached::OPT_BINARY_PROTOCOL - 18
Memcached::OPT_NO_BLOCK - 0
Memcached::OPT_TCP_NODELAY - 1
Memcached::OPT_SOCKET_SEND_SIZE - 4
Memcached::OPT_SOCKET_RECV_SIZE - 5
Memcached::OPT_CONNECT_TIMEOUT - 14
Memcached::OPT_RETRY_TIMEOUT - 15
Memcached::OPT_SEND_TIMEOUT - 19
Memcached::OPT_RECV_TIMEOUT - 15
Memcached::OPT_POLL_TIMEOUT - 8
Memcached::OPT_CACHE_LOOKUPS - 6
Memcached::OPT_SERVER_FAILURE_LIMIT - 21
Memcached::HAVE_IGBINARY - #&UNDEFINED;#
Memcached::HAVE_JSON - #&UNDEFINED;#
Memcached::GET_PRESERVE_ORDER - 1
Memcached::RES_SUCCESS - 0
Memcached::RES_FAILURE - 1
Memcached::RES_HOST_LOOKUP_FAILURE - 2
Memcached::RES_UNKNOWN_READ_FAILURE - 7
Memcached::RES_PROTOCOL_ERROR - 8
Memcached::RES_CLIENT_ERROR - 9
Memcached::RES_SERVER_ERROR - 10
Memcached::RES_WRITE_FAILURE - 5
Memcached::RES_DATA_EXISTS - 12
Memcached::RES_NOTSTORED - 14
Memcached::RES_NOTFOUND - 16
Memcached::RES_PARTIAL_READ - 18
Memcached::RES_SOME_ERRORS - 19
Memcached::RES_NO_SERVERS - 20
Memcached::RES_END - 21
Memcached::RES_ERRNO - 26
Memcached::RES_BUFFERED - 32
Memcached::RES_TIMEOUT - 31
Memcached::RES_BAD_KEY_PROVIDED - 33
Memcached::RES_CONNECTION_SOCKET_CREATE_FAILURE - 11
Memcached::RES_PAYLOAD_FAILURE - -1001
Just a little teaser before we all head out to countryside for the midsummer weekend:
Yes, you're seeing the software versions right. The screenshot is from the "About Midgard" screen of Ragnaland, a hybrid setup of Midgard's MidCOM MVC framework from Midgard1 (MidCOM 8.09) and Midgard2 running in an App Builder instance (Midgard 9.09).
Still requires some tweaking and bug fixes, but consider the possibilities:
I’ve seen a lot of methods used to take a website temporarily off-line for maintenance. Most involve a using PHP to disable the site or renaming the index file. There is however a far better method of doing this, by placing the following in the vhost file or in an .htaccess file in the document root:
Redirect 503 /
This way you are sure no part of the site is used. Also by returning a 503 http response, search-engine crawlers will not reindex your site right at the moment it is down. You can use ‘ErrorDocument’ to place a different text than the apache default.
A couple of days ago I came home from one of the best PHP conferences in the world, Dutch PHP Conference 2009 with again a very elite list of speakers.
Thursday, June 11 was tutorial day. A whole day dedicated at learning new things by the greatest PHP minds in the world.
I attended the "Zend Framework Workshop" by Matthew Weier O' Phinney, Chief Architect at Zend Framework.
I went to see this tutorial session to see all the goodies that are put in Zend Framework 1.8 and to learn how to do stuff better. Great stuff like Zend_Tool, Zend_Application and other Zend Framework components are worth checking out.
As it appears, I have to look into the Zend_Acl adapter using a configuration file or an external source and contribute my solutions to the Zend Framework wiki.
Afterwards a Belgian delegation went down-town Amsterdam to have dinner at an Italian place and a drink afterwards at "Leidse Plein".
Day one was a very hectic day for me since I was scheduled to speak at 10:30am. But we'll get there in a minute.
Before the opening keynote of Cal Evans, Director of PCE at Ibuildings, an awesome animated movie was shown to the public.
Cal Evans talked about what everyone could expect at the conference, what the rules of engagement were and what tags to use during the conference (a very important note).
Andrei Zmievski opened the conference officially talking about "PHP: people, code and ideas". Too bad I had to flee the scene half way the presentation to set up my gear for my own talk about SPL.
I hosted a talk called "SPL, not a bridge too far" where I discussed on a low level (according to some, a bit too low) the funky features SPL brings to the table. And looking at the comments left on joind.in I actually got people interested in using SPL in their future development projects.
Too bad I cut it short, like most people mentioned, because there's a whole lot to tell about SPL. Thanks everyone for you feedback, I will definitely keep it mind to make my presentation better.
Ben Ramsey showed us that "Grokking the REST architectural style" is worth thinking about when dealing with REST web services. He also talked about ATOM as a protocol, and he really got me interested in it to find out more. Thanks Ben, it was awesome.
Matthew Weier O' Phinney impressed us all again with another talk about "Contribute" and what we developers could do to make a difference.
For everyone involved in open-source projects, a must see presentation and again lots of kudos to Matthew for bringing this point to the attention of the masses.
Unfortunately I missed Stefan Esser's talk about "Secure Programming with the Zen
Truncated by Planet PHP, read more at the original (another 7573 bytes)
We just released FluentDOM 1.0. The package contains the two classes (FluentDOM and FluentDOMStyle) and a lot of examples.
FluentDOM is a test driven project. The tests are included in the package of course.
We decided to use The MIT License for the project. Test it, use it und please give us some feedback.
So yesterday I had a quick interview with a journalist from the Nenagh Guardian - my local paper - about this OpenStreetMap (OSM) mapping malarky.
As most of you will probably know OSM is to printed atlases from AA, Ordnance Survery etc, as wikipedia is to encyclopedias. People can contribute data to the project through a variety of activities: going out and actually mapping an area with a sat nav or gps unit [even a mobile phone with GPS in it such as an iphone, nokia n95 or whatever], tracing data off Yahoo [and other] aerial imagery, filing bugs on the openstreetbugs website or literally drawing in information via the walking papers map making website. And better again, this is about providing free geographic data such as street maps to anyone who wants them.
Anyway…I mentioned how the OpenStreetMap map of Nenagh is more complete than even the latest commercially available maps for Garmin and Google Maps and listed off a few ways how OSM could be used commercially: by real estate agents, courier companies, how being able to pin-point where all the amenities are would be useful for tourists, and so on.
Compare the Open Street Map of Nenagh with the Google Map of the area - as you can see, there’s still quite a bit of work to be done - Millers Brook needs to be marked as such along with the various groves, avenues etc that comprise that estate. Plus all the amenities, shops [perhaps even their opening hours] and the Shannon Development Industrial Centre still need to be added - as I’m sure are some other small portions of the town that I’ve unknowingly neglected.
It’s fair to say that this will never be finished - existing housing estates will be extended, there will always be urban development plans that when implemented would also need to be included on the map.
It would also be cool to have the new “Nenagh Cycling Hub” rendered on the opencyclemap.org website.
I discovered the OpenStreetBrowser site to be a great test of the data that myself and others have entered - it’s also a great way of demonstrating just what can be done with OSM data.
If you happen to spot something that I’ve missed please either drop me a comment or use the openstreetbugs website.
On a related note: it would be good to see a PEAR/PHP based client/component for interfacing with the OpenStreetMap server so that interesting apps utilising that data could be implemented on the LAMP stack - something to go alongside the Services_GeoNames package from pear

At this years Dutch PHP Conference I presented a PHP Security Crash Course for beginners and a session about secure programming with the Zend Framework. You can download all the slides from here.
PHP Security Crash Course for beginners
Secure Programming with the Zend Framework
Enjoy the slides and shoot any questions or improvement ideas my way…
Much has been written on Dependency Injection lately, mostly by Padraic Brady (1, 2) and Fabien Potencier (1, 2, 3, 4, 5). My subjective feeling tells me there are now more PHP DI containers out there than CMS or ORMs implemented in PHP, including two written by myself (an overengineered and a useful one). Its an awesome pattern if used on a larger scale and can (re-) wire a complex business application according to a clients needs without having to change much of the domain code. It aims at a complete seperation of object instantiation and dependency tracking from the business logic.
Beginning with version 1.8 Zend Framework is able to integrate any of these DI containers into its Zend_Application component easily. The Application component intializes a set of common resources and pushes them into the MVC stack as additional Front Controller parameters. Technically a Zend_Registry instance holds all these resources with their respective resource names as keys. The resources are accessible inside the Front Controller and the Action Controller classes. Assume the resource 'Db' is initialized in your application, you can access it with:
$front = Zend_Controller_Front::getInstance();
$container = $front->getParam('bootstrap')->getContainer();
$db = $container->db;
// or:
class FooController extends Zend_Controller_Action {
public function barAction()
{
$container = $this->getInvokeArg('bootstrap')->getContainer();
$db = $container->db;
}
}
This is pretty much dependency injection already, but the default registry approach suffers from two serious problem: New instances can only be added to the Container by implementing new Zend_Application resources and these instances cannot be lazy loaded. All resources used by Zend_Application are always loaded on every request. But the application container implementation was developed with Dependency Injection in mind and is not tied to the use of Zend_Registry. Only three magic methods are required by any container that wants to be Zend_Application compliant: __get(), __set() and __isset(). Each instantiated resource is pushed via __set() into the container. If required by another resource, __isset() is used to check wheater a resource with the given name exists inside the container and __get() is used to retrieve the instances from the container.
Some month ago I extended Yadif, a lightweight PicoContainer-like DI container for PHP written by Thomas McKelvey, with several features that make it a very powerful DI container in my opinion. It has a detailed documentation and examples on the GitHub Page if you want to check it out. I extended Yadif to be Zend_Application compliant in a way that the application-wide Zend_Application resources can be used as dependencies for objects that are lazy-loaded from the container. Skipping the tech-talk, here is an example. First we have to replace the default Container with Yadif:
$objects = new Zend_Config_Xml(APPLICATION_PATH."/config/objects.xml");
$container = new Yadif_Container($objects);
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/config/application.xml'
);
// Set Yadif as Container
$application->getBootstrap()->setContainer($container);
$application->bootstrap()
->run();
Assume you run Zend_Application with a "Db" and a "Cache" resource. These resources are loaded on every request. The objects configured in Yadif however are not instantiated until they are requested for the first time from the container. We can merge these two worlds and make use of the Application resources inside the Yadif Configuration "objects.xml", which looks like:
<?xml version="1.0" ?>
<objects>
<myModel>
<class>MyModel</class>
<arguments arg1="db" arg2="cache" />
</myModel>
</objects>
Instantiating a myModel
Truncated by Planet PHP, read more at the original (another 691 bytes)
Bugzilla isn't really the best place for contributing and discussing new ideas for a software project. Like Ubuntu and openSUSE before us, the Maemo community now also has a better tool for this: Maemo Brainstorm.
Maemo Brainstorm, developed as part of our efforts to the April 09 Sprint is a new web service that follows the model of Drupal's IdeaTorrent, but with a particular Maemo flavor.
Users can propose new ideas:
Users can also comment and propose solutions for ideas:
The ideas then enter "Sandbox", from where moderators can put them through the Brainstorm workflow:
After voting, popular ideas may then be chosen to be implemented by a team of moderators.
In addition to normal IdeaTorrent-like functionality as described in the Task page on Maemo Wiki, there are some adaptations for the maemo.org environment, including:
Some work is still being done on Brainstorm, including a dedicated search for this area of the site. In the meanwhile, please go and submit your favorite ideas, and vote for the ideas others have submitted. You can also follow the categories you're interested in via their RSS feeds, or the progress of your own ideas via the Dashboard.
And be sure to report any issues or ideas you have about Brainstorm itself!
Technorati Tags: brainstorm, maemo, midgard, moderation, ideatorrent
A while ago I was sent a review copy of “Learning JQuery 1.3” by Jonathan Chaffer and Karl Swedberg, as published by Packt. I’ve now had a chance to read it objectively and compare it against the original “Learning JQuery” which Packt also sent me to review about a year ago. That earlier edition covered a much less mature version (version 1.1.3.1 to be precise) of this popular Javascript framework.
Aimed at web developers and designers with a basic understanding of html and CSS (and some level of comfort with Javascript), the later book is thicker than the original - it weights in at some 440 pages compared to the 360 pages that were required for the first. A new chapter, “Developing Plugins” covers how to write plugins for the framework and how to “share it with the world” - naming conventions, documentation style and other advice are included. There is also a new “Quick Reference” appendix which just begs to be reproduced in “Cheat-sheet” format for pinning up on your wall. Chapters already present in the earlier book are more detailed and read better.
The subject matter is expertly covered and unless you were aware of the changes in jQuery 1.3, compared to the older version that the original was focused it would be difficult to tell which portions of the book are new - the revision and updates to the original are seamless.
Quite rightly, Swedberg and Chaffer do not explain all differences between jQuery 1.3 and its predecessors - they rightly assume that if you’re reading “Learning JQuery 1.3″ then you don’t need to be informed of exactly how jQuery 1.3 differs from the version they previous covered. The book flows better because of this and remains very easy to understand because of this approach.
There is no hint of the selector engine in 1.3 being any different than what was already covered. The language used for explaining the different concepts to the reader is more precise, especially so in the Events chapter and this makes understanding the concepts being covered much more easy - for this reason alone buying the revised edition is well worth the money.
The book doesn’t focus on new additions that were freshly added to jQuery 1.3 but also ones that had been added to jQuery since the first edition was published; JSONP, which was introduced in jQuery 1.2 is covered in the chapter on AJAX, as is the more low-level $.ajax() method; it also mentions which features have been removed from jQuery since the first edition was published - XPath being one such example. The listing of development tools has also been reworked, as has the Online Resources section. These listings mention resources that are current and up-to-date.
I remember mentioning in my review of the first book (trying hard not to use the word ‘original’ again!) that until a later edition of it was released that you wouldn’t be able to find a better book on the subject. I stand by that assertion - the only book that covers jQuery better than the first edition of “Learning jQuery” is the second edition of the same.
Yesterday we held our PHP BBQ event at Munich, well it was no BBQ as the weather forecasts predicted rain,which came in the evening, but a nice evening in a beer garden.
We had more than 30 people there, some leaving early, sme arriving late, covering quite different kinds of participants: PHP core developers, professional PHP users, people doing PHP stuff as hobby, friends and PHP community veterans like Till Gerken. Many people didn't know each other or didn't see each other or some time so we had lot's of discussions, and most of them even weren't about PHP and even many non-IT things were covered, which I find always great. If you want an impression check Ulf's photos. I really hope this makes a good foundation for more regular PHP meetups.
There will be a few more events of this kind this week in Germany, so go there if you can, don't be shy and have fun.
PHP BBQ dates:
Untitled from Paul Reinheimer on Vimeo.
Thanks to the efforts of Daniel O’Connor, the PEAR website is getting nicer and better. Bug RSS feeds support Baetle now, the PEAR proposal system - PEPr - works again and many small improvements and fixes found their way on the site.
Some people emailed me about a blog post I wrote some time ago about a dependency injection container done in PHP 5.3. I have published on Github the small version of it (Twittee), but not the "working" version.
Today, I took the time to publish it on Github. Pimple is a small dependency injection container, with all the features you need for a usage in real projects.
Feel free to use it, fork it, and enhance it for your next PHP 5.3 project.
And don't forget to give PHP 5.3 a try as the PHP core team has just published the third release candidate, and they hope to release the final version by the end of June.
Frequently, you do client work and if you are fortunate enough, you can setup a development environment on your own server or your laptop (or whatever), tinker with the files, and templates, and so on — until it's all done.
And whenever you are done, it's time to move files.
Sounds easy? It sort of is!
ChecklistHere's a small check list of things to keep in mind when you move an installation.
You may need to fix up the configuration file in order to adjust all database related settings. It's located in app/etc/local.xml.
Certain directories will need to be made writable. Writable in this case means that the webserver has to be able to write into it. Since most of the standard PHP setups are with mod_php, this will be the user www, apache or www-run (in most cases). If you (or your provider) runs php-cgi, chances are that this is not necessary.
You may have to ask an administrator to set this up. If the administrator is not available, you can always chmod 777 these, but for obvious reasons this may be risky in a shared environment.
The following is a list of directories (and contents) which need to be made writable:
app/etc/var/media/And in case you want to use MagentoConnect, there are additional directories to make writable. Please see this blog post for more info.
URLs, URLs, URLs. You were working on localhost all this time and now you think you can move it over just like that? Wrong!!! ;-) But all you need to do is edit the following keys in the core_config_data table:
web/unsecure/base_urlweb/secure/base_urlIf you have any additions, please leave a comment!

The PHP BBQ Tour organized by Ulf Wendel and various PHP Usergroups in Germany will stop in Karlsruhe. For those of you living near Karlsruhe, it’s definatly worth to join us. There will be food, drinks and I’m sure it’ll be a great evening. Information can be found here

Liip is happy to announce that we are now the official Swiss Mahara Partner! Mahara is an Open Source
ePortfolio system.
In many respects Mahara is a "sister" application to Moodle, providing students with a learning environment that they themselves own, giving them them the ability to showcase their work and collaborate with their peers. However, Mahara is also well suited as a social networking system, running out of the box without Moodle.
Mahara was originally funded by the New Zealand government's Tertiary Education Commission, and has grown into a thriving open source product that is increasingly being adopted worldwide. It makes a lot of sense for Liip to be a partner, both because we're already the official Moodle partner in Switzerland, and Mahara fits very well into our existing list of projects we work with, and because Penny Leach, one of the original core developers, is now working at Liip.
We are very much looking forward to providing services around Mahara!
Shortly after my lunch I saw the following tweet from David Pogue, technology columnist for the The New York Times.

Given Pogue’s large following, I was disappointed by the advice he gave.
A secure password on a laptop isn’t to keep semi-trusted people off of it. It’s to keep it protected in the event that the hard drive is lost. Arguably, the drive could be removed and read without booting it, removing all password protection, but a good password combined with disk encryption can help protect data from theft.
Pogue argues that he doesn’t need a password for security, but any information that is stored on file servers or worse, in his keychain, is accessible with that simple password he is using. Failing to have a secure password not only places his data at risk, but the data of those he might know or work with.
Even if gaining physical access (e.g. finding the computer or stealing it) would grant a person a huge advantage, this is not an excuse to make the password so incredibly simple. And for one of the most well-known technology columnists to suggest otherwise to his 444,666 followers is negligent, bordering on criminal.
Twitter is everywhere nowadays. Odds are eventually you will want to tweet
from PHP. No need to use one of the numerous PHP Twitter libraries, as
tweeting is as simple as using the PHP built-in file_get_contents()
function:
function tweet($message, $username, $password)
{
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => sprintf("Authorization: Basic %s\r\n", base64_encode($username.':'.$password)).
"Content-type: application/x-www-form-urlencoded\r\n",
'content' => [http_build_query(] array('status' => $message)),
'timeout' => 5,
),
));
$ret = file_get_contents('http://twitter.com/statuses/update.xml', false, $context);
return false !== $ret;
}
Pretty easy, no? Using the tweet() function is of course a piece of cake:
tweet('From PHP, yeah...', 'fabpot', 'Pa$$');
As an added bonus, the function returns true if everything went fine, or
false otherwise.
As we talk about Twitter, you can follow me.
FluentDOM got an own webpage at [fluentdom.org] .
You can now find nightly builds at [nightly.fluentdom.org] . A PHPUnit log file and the code coverage report for the latest nightly build is provided, too.
Status UpdateWe added a FluentDOMStyle class. This class extends FluentDOM and adds support for manipulation of the style attributes.
$items = FluentDOMStyle($xhtml)->find('//div');
$items->css(
array(
'text-align' => 'center',
'color' => 'black'
)
);
This one reminds me on my past - after seeing it, I feel very happy that I do not do any contracting work any more. I still don’t know if I should laugh or cry. It might be old - but nevertheless worth to watch it.
(English - with German subtitles)
via Guido Muehlwitz
I thought the topic of offensive presentations at professional tech conferences was beat to death before, but apparently there are still some out there who don't get it. Recently, the GoGaRuCo incident stirred up controversy, and now this monstrosity has occurred.
In a nutshell, the keynote speaker at Flashbelt, Hoss Gifford, gave a presentation that included actions and images that would make even Howard Stern do a double-take. The highlights of the talk, according to Courtney Remes, as recounted here, are:
Yeah, seriously. WTF, indeed.
- He opens his keynote with one of those "Ignite"-esque presentations — where you have 5-minutes and 20 slides to tell a story — and the first and last are a close-up of a woman's lower half, her legs spread (wearing stilettos, of course) and her shaved vagina visible through some see-thru panties that say "drink me," with Hoss's Photoshopped, upward-looking face placed below it.
- He later demos a drawing tool he has created (admittedly with someone else's code) and invites a woman to come up to try it. After she sits back down, he points out that in her doodles she's drawn a "cock."
- Then he decides he wants to give a try at using the tool to draw a "cock" (he loves this word) — and draws a face, then a giant dick (he redraws it three times) that ultimately cums all over the face.
- A multitude of references to penises and lots of swearing — and also "If you are easily offended, fuck you!"
- And then, to top it off, a self-made flash movie of an animated woman's face, positioned as if she's having sex with you, who gradually orgasms based on the speed of your mouse movement on the page.
Hoss exploits this shared narrative in his work to great effect, and will use his inaugural Flashbelt presentation to analyze a series of projects that build on each other's successes and failures to deliver increasingly rich experiences. And he'll say ` F**k ' a lot.
His idea of "increasingly rich experiences" differs from mine, apparently.
Interestingly enough, it was his response and the response of his supporters that reveals the deeper issues. There are still so many out there who think that they are entitled to act like douchebags because they *can,* and that everybody else should let it go. Get over yourselves, I say. You're nowhere near as cool as you'd like to think you are. And you shrugging it off and alienating a good portion of your audience (men and women alike) is like me building a website that requires IE8 only.
I applaud the collaborative efforts and professionalism of the well thought out response by the conference organizers and the geek girls -- they are truly making progress, I think. In a way, though, it really saddens me. It saddens me that this conversation and effort even has to take place.
I think that idiots like Mr. Gifford do not represent a good portion of male techies in the world, and certainly he represents none of the men I know in the PHP world. So basically, I know I'm preaching to the choir on this one, but for those gentlemen out there that don't get it, IT'S REALLY NOT THAT DIFFICULT.
In case you're not sure where the "appropriate" line for your professional presentation is, here are a few pointers to help you decide.
1- Witty, pertinent content: GOOD. Pictures of naked women, or really anything sexually charged: BAD.
2- If you would feel uncomfortable giving the presentation to your little sister or Aunt Linda, CHANGE IT.
3- The audience and the conference organizers are your CLIENTS. They're paying you good money to educate and share your knowledge. Offending and embarrassing them and yourself is a BAD IDEA.
4- EDGY does not mean PORN.
5- You obviously have intelligence and something interesting to say. DON'T HIDE BEHIND BULLSHIT.
6- It's called EMPATHY. LOOK IT UP.
If you *still* don't get it, and you're not sure if your presentation is questionable, approach some women in tech with your presentation and get their opinion. We are out there, trust me. No, we won't chastise you for being ignorant. We will appreciate the fact that you cared enough to ask.
Today is my last day at The Bivings Group. Yesterday was my last effective day; as I write this, I’m flying over West Virginia on my way to a friend’s wedding in California.
Starting June 22nd, I’ll be working for Applied Security. I’ve learned a lot at The Bivings Group, and worked on a lot of great projects, including The Pickens Plan. I’ll miss the friends I made, but I’m glad that I’ll be able to see them again at the developer’s group meetings and conferences.
Good luck to the folks at The Bivings Group. See you soon.
I think this is different from the last one, since this one has three openings, instead of a single senior one.
Contact information:
Carl Kenny, Yoh IT
408.654.9192 Extn:25
carl.kenny [at] yoh [dot] com
A small, but promising company in Sunnyvale is seeking a Sr. Software Engineer with the following skills:
Projects that the candidate will be working on depending on their mix of skills are:
Contact Urmila Bhide, Talent Space, Inc., 408-330-1905
Today I like to present a new projekt: FluentDOM
It provides an easy to use, jQuery like, fluent interface for DOMDocument.
The idea was born in a workshop of Tobias Schlitt about the PHP XML extensions at the IPC Spring in Berlin.
The last few days Bastian Feder and I implemented it. That's how it looks in action:
require_once('../FluentDOM.php');
echo FluentDOM($xml)
->node(
FluentDOM($samples)
->find('//b[@id = "first"]')
->removeAttr('id')
->addClass('imported')
)
->replaceAll('//p');
We are aware that here are some other projects with similiar concepts. But none of them matched our requirements (XML targeted, XPath selectors, namespace support, ...).
You can take a look at the current version in Bastian's public SVN.
svn://fluentdom.org/trunk/FluentDOM
DPC - 0 Interview with Christian Wenz from Paul Reinheimer on Vimeo.
DPC Day 0 - Rob from Paul Reinheimer on Vimeo.
As author of Xdebug, people ask me often the question how to handle the case in teams when there is one development server and multiple developers working on the same project on that server. Xdebug only allows you to specify one IP address to connect to (through xdebug.remote_host) while doing remote debugging. It does not automatically connect back to the IP address that runs the browser the request the PHP scripts because of security reasons. You don't want everybody on the Internet to be able to run a debugging session against your code for example. There is no problem if all developers are working on a different project, because the xdebug.remote_host setting can be made for each directory (through Apache's .htaccess functionality). However, for the case where multiple developers work on the same code, the .htaccess trick won't work as the directory in which the code lives is the same.
Now,
in order to solve the above mentioned issue, you will need to run a DBGp
proxy. DBGp is the protocol, designed by ActiveState and myself to facilitate
communication between an IDE (such as Komodo, or any of the other
listed clients)
and PHP+Xdebug. A DBGp proxy is a bit of software that acts as a
redirector for DBGp streams. In order to make things work for multiple
developers and one source base, you set Xdebug's xdebug.remote_host
setting to the machine on which the DBGp proxy runs. This is most likely
going to be on the same machine that acts as development server, so that
the xdebug.remote_host setting should be set to "127.0.0.1"
(i.e. localhost). The proxy server the listens for IDE connections. An
IDE needs to register itself with the DBGp proxy by using the proxyinit
command. This command requires an "idekey" that is a
unique identifier for each client (IDE). Every developer should have its
own unique idekey (I usually just pick my name), and this idekey should
be configurable in the IDE. For Komodo, it's at
Edit->Preferences->Debugger->Connection->"I am running
a debugger proxy and Komodo should use it"->"Proxy
Key". In Komodo you also need to select "a system-provided
free port" in the same configuration panel. When initiating the
debugging session from the browser with either
XDEBUG_SESSION_START=session_name as GET/POST/COOKIE parameter, or
export XDEBUG_CONFIG="idekey=session_name" from the comment
line, make sure to change "session_name" to the idekey as
configured in your IDE. (See the documentation on
how to set this up). The Xdebug Firefox
extension also has a setting for this. You have to configure
Xdebug's xdebug.remote_host
setting to the IP address of the machine that the proxy runs at. Xdebug
itself does not see a difference between either the proxy and a normal
IDE. But the proxy itself now knows because of the configured idekey on
how to forward the requests and responses to the correct client.
You can find the DBGp proxy code as part of the python remote debugging package that ActiveState provides. By default it listens for IDE registrations at port 9001, and for Xdebug connections at port 9000. To run the proxy, do:
tar -xvzf Komodo-PythonRemoteDebugging-5.1.3-28369-linux-x86_64.tar.gz cd Komodo-PythonRemoteDebugging-5.1.3-28369-linux-x86_64 cd bin ./pydbgpproxy
This outputs:
INFO: dbgp.proxy: starting proxy listeners. appid: 30430 INFO: dbgp.proxy: dbgp listener on 127.0.0.1:9000 INFO: dbgp.proxy: IDE listener on 127.0.0.1:9001
Running a DBGp proxy also allows you to avoid NAT issues where (as seen from PHP+Xdebug on the server) all connections seem to come from the same IP (because your internal network is NATted). In this case, you can simple run the dbgp proxy on your NAT machine, configure xdebug.remote_host setting to the IP address of your NAT machine, and configure the IDEs to connect to the proxy running at :9001.
As a last note; there is a patch to allow the connect-back-to-requesting-IP-address functionality that is not available directly in Xdebug. This patch, written by Brian Shire and Lucas Nealan of Facebook made its way into Xdebug 2.1. However, great care should be taken by using this functionality. It does not make the NAT situation as outlined above work however.
Oof!
I like giving presentations. I really do. But this has been quite a conference season this year; certainly my busiest ever. Four conferences in four different states, and nine presentations. And the year isn't even half over yet...
Here's what I've been up to:
DPC -1 from Paul Reinheimer on Vimeo.
DPC -1 from Paul Reinheimer on Vimeo.
DPC -1 from Paul Reinheimer on Vimeo.
The German Oracle User Association (DOAG e.V.) has published a statement (in German) about the acquisition of Sun/MySQL by Oracle and its impact for Oracle users. You can find the statement here.
Oh and btw, I'll give a session about "PHP5 & Oracle" at the local Oracle usergroups in Frankfurt on June, 23rd and Hamburg on Sep 14th. The main goal is to promote the usage of PHP5 in Oracle environments (and how you can leverage PHP's potential in Enterprise environments) as there are good Oracle database connectors for PHP5 available. See you there!
Hello!
i am Mte90 and i have actually 18 years. I'm a web programmer principally but when i have decide to abandon Windows on my notebook i have opted for Sidux (debian sid). But in windows i was a vb.net programmer and the .net framework it isn't for linux. I have decided to develop in this good language!
I begin the italian translator of this site for the italian!
I develop for the cms that i use in the php language. The name is New-Cms and is a flat cms.
I like jquery and retain that this iste is a good point to learn this language!
Hello everybody!!!
Today I was writing some Selenium unit tests for our PHPUnit test suite and needed to check if a certain navigational tab was active. Situation in html:
I needed to check if Button 1 was active. The problem was that with simple xpath constructs like //span[@class='active']/input do not work since the class may have multiple values.
The rescue was the contains function: //span[contains(@class, 'active')]/input[@id='someId'] as parameter to assertElementPresent().
Update 2009-06-09Jakob Westhoff has a better solution to this problem.
If you need to regularly connect to a lot of different servers like I do, you probably use SSH to connect to them, and you also probably use your personal SSH identity file to ease the connection.
Some time ago, I re-discover a neat trick to simplify the connection by using
the .ssh/config file. I don't know why I forgot about it, but as it seems
that a lot of people around me do not know about this file either, here is a
small post on how it can be used to your advantage.
Let's say you have a host at 1.2.3.4 you need to connect to and the username
you need to use is fabien. Each time you want to connect to it, you need to
type something like the following:
$ ssh fabien@1.2.3.4
Simple enough, even if you need to remember the remote user you need to use for each server. However, if you need to specify a specific key, it becomes more verbose:
$ ssh -i /Users/fabien/keys/myserver.key fabien@1.2.3.4
That's difficult to remember, quite tedious to write and error prone. Instead, I want to be able to just type:
$ ssh myserver
It's quite easy. Create a .ssh/config file under your home directory and put
something like this inside:
Host myserver HostName 1.2.3.4 User root IdentityFile /Users/fabien/keys/myserver.key
That's all there is to it. Now, connecting to the server is as easy as typing:
$ ssh myserver
And it works everywhere SSH is involved. For instance, when you use scp to
copy a file:
$ scp localfile.txt myserver:/tmp/
It is also a great way to not give sensitive information in configuration
files. For instance, in a symfony project, the properties.ini file can
contain the information to connect to the production servers used for
deployment. Instead of having to hardcode the real host name, the login and
the password like this:
[production] host=www.myserver.com port=22 user=someusername pass=somepassword dir=/var/www/mysite/
You can simply reference the name you gave in the config file and keep the
details secret on your local machine:
[production] host=myserver port=22 dir=/var/www/mysite/
Unix is really powerful thanks to little things like this one. By the way, if you want to know more about the Unix history, you can read the really interesting "Unix turns 40: The past, present and future of a revolutionary OS" article published on ComputerWorld.com earlier this month.
Why spend valuable time coding everything by hand? Using a framework is a great way to save time and effort on your next project—you’ll have a firm foundation to build upon, there will be pre-built modules to perform tedious coding tasks, and if you’re a learner, it’s a great way to learn about good coding practice. PHP’s massive popularity means that developers have a wide variety of frameworks to choose from. We’re sure you can find one amongst these 16 to meet your needs.
Agavi: This PHP 5-based framework started off as a fork of the popular Mojavi project. While it can be used as a web site construction kit, its primary focus is on building fully-fledged applications.
Akelos: Akelos is a PHP port of a Ruby on Rails framework for building web applications. It avoids complex configurations, making it ideal for use on simpler web servers. There’s a healthy community around this one!
CakePHP: The very well-known CakePHP is easy for coders of all skill levels to use. It’s based on the same principles that guide Ruby on Rails, and its heavy focus on rapid deployment methods make it a great choice for developers who are squeezed for time (see SitePoint’s beginner’s CakePHP tutorial to get started).
CodeIgniter: EllisLab’s CodeIgniter has won wide praise for its small footprint and speed, and has become a favorite amongst many developers. There’s extensive documentation and a large community of users to help you out.
eZ Components: OK, so we’re stretching the definition of framework here. eZ Components, as the name suggests, is a library of individual components for common tasks. If you’re familiar with the ezPublish CMS, you might have seen some of these components before!
Fuse: Fuse is based on Ruby on Rails and CakePHP, but has had many features added by the development team to make the most stable platform they could. There are frequent updates—development on version 2.0 is underway!
Horde: This mainstay of the PHP framework world grew from the Horde webmail and groupware suite. If you’re a developer who speaks a language other than English, you may be interested in the fact that the framework is designed specifically to be localization-friendly.
Kohana: Kohana, originally based on CodeIgniter, puts its focus on being small, fast, and secure.
Truncated by Planet PHP, read more at the original (another 5323 bytes)
The LCD screen from my macbook broke a while back, much to my regret Apple's warranty didn't cover it at the time and was going to charge $900 for it.
I was pretty set on making it useful again, so a few days ago I ordered a new LCD screen myself. It was quite an undertaking to replace it, because it was needed to take the entire thing apart, top to bottom.
It took me 4 hours, and 12 minutes including dinner and going to the neighbours to replace a screwdriver. Here's a 12 second version of it:
Sorry, your browser does not yet support the html <video> Try it with the latest (beta) version Firefox, Opera or Safari.
If you plan to try this yourself, know what you're getting into.. Make sure you have a steady hand and it helps if there's someone around to hold stuff together. Make sure you get good screwdrivers and be very careful with the cabling. I also found it handy to use tweezers.
I got the instructions from IFixit, which has some great guides.
After all that, I ended up with 1 screw I was unable to fit back in, a few damaged wifi antenna cables (still worked!) and I discovered a few places of broken plastic, which were likely from the first time it got damaged.
A few weeks ago, Helgi and I attended PHP|Tek 2009 in Chicago, as both representatives of echolibre and The PEAR Group.
This post will briefly discuss the formation of a Recommended PHP Standards Group, as put forward by a meeting of PHP developers at the conference. As would be expected, a bit of controversy surrounds this proposal, but my hope would be that it would be accepted and grow within the global PHP community in the coming years.
As posted by Travis Swicegood, a group of community project representatives came together to discuss naming standards for PHP 5.3 and above. (I would like to take the opportunity to publicly thank the staff of the PHP|Tek conference for providing us with a large meeting room with little more than 2 hours notice).
So, what’s this all about?With PHP 5.3 being closer to a stable release, the inclusion of namespaces and packaging within projects will take on a whole new meaning for large projects. People representing The PEAR Group (PEAR2), The Zend Framework, Cake PHP, Solar PHP, Agavi and unofficial representatives of Symfony and Phing met together and we discussed standards that could benefit each of the projects and the community in general.
Attending wereBeing a PEAR representative with Travis, Helgi and Brett we brought to the table the feedback and problems that we have been facing over the past year and a half with namespacing standards discussions, Matthew Weier O’Phinney from the Zend Framework brought their issues, same for Agavi, Solar, Cake and Symfony (Stefan is an unofficial representative). We brewed and stormed our issues, brought solutions and came up with a standard for namespacing and package structure.
Sneak PreviewHere are a few hints about the standards (outlined on this page) which cover things like namespace packaging structure, exceptions, abstract class naming, interface naming, and concrete class naming.
NamespacesAll packages should be named:
<vendor>\<package_or_component>\<ClassName>
Example:
1 2 3 4 5 | <?php
namespace pear2\text_diff\Diff;
namespace zend\controller\FrontController;
namespace cake\models\DatabaseModel;
?> |
All of the above mentioned projects consented to this standard as of PHP 5.3. What this means to users and developers is that the barrier for entry from one framework to another becomes greatly reduced and the interoperability of packages between projects is tremendously improved.
A few of my friends and associates may have heard me talk about the media server I've been running in my basement; I used to automatically transfer content from my tivo to a hard-disk in my basement so that I had more space for recordings on the tivo. Since most of the recordings that I want to keep are now available via Hulu, I haven't had much call to use it in the last 6 months.
So, what is CouchShare? It's a UPnP server that can share content from folder to an XBox 360 on your network.
It's written in PHP (and requires a tiny PHP extension to enable multicast support) and is written using the eventing framework that is part of the Alexandria codebase.
I wrote the code back in 2007 and it has served me well for a couple of years; it felt like it was about time I got off my backside and shared it with the world.
It is by no-means a polished bit of code; I think it's probably the sloppiest code I've written in quite some time, and it may well need a couple of tweaks to make an easier application out of it.
DPC Day -4.5 from Paul Reinheimer on Vimeo.
PHP 5.3 is just around the corner with a lot of great new features. However, even if I'm really excited about this new release, I won't make yet another PHP 5.3 feature list; I will rather look at the future of PHP. PHP core developers met at php|tek and discussed the future of PHP. And it is really great to see that they plan lots of wonderful features; let's set aside the Unicode stuff.
They published some notes from the meeting, and here is my personal list for things I find really interesting:
Add __cast() magic method that will be called for all casts. If the
__toString() method is there it will get used for string types first.
Consider making a "callable" type.
Make ArrayObject and ArrayAccess accepted everywhere regular arrays
are.
Add traits support.
Add type hinted return values, scalar type hints.
Make function call chaining possible (f()() if f() returns a function),
and array dereferencing (f()[0]).
C#-style properties with getters/setters:
class Foo
{
public $bar
getter { return $this->bar; }
setter { $this->bar = strtolower($value); }
;
}
Three weeks after I present my research about advanced post exploitation in hardened PHP environments at SyScan in Singapore and Taipei, I will present a similar session at this year’s Blackhat Briefings 2009 in Las Vegas. The session will be a little bit different from the one at SyScan because I will have a few more minutes to present. If you want to see some PHP memory corruption voodoo in action and cannot attent SyScan you should come to Las Vegas.
Session: State of the Art Post Exploitation in Hardened PHP Environments
When an attacker manages to execute arbitrary PHP code in a web application he nowadays often ends up in hardened PHP environments that not only make use of PHP’s internal protections like safemode, openbasedir or disable_functions but also make use of Suhosin and operating system, filesystem or libc level security mechanisms like ASLR, NX, hardened memory managers or unix file permissions.In such a situation taking over the server becomes a challenge and requires PHP shellcode that is able to use local PHP exploits to get around these protections. This talk will show the problems arising from the different protection mechanisms for PHP shellcode, will give an insight into the internal memory structures of PHP that are required to write stable local exploits and will demonstrate how a special class of vulnerabilities in PHP that also exists in standard functions enables PHP shellcode to get around most of these protections.
See you in Las Vegas between 29rd and 30rd.
One of the biggest decisions you can make for any project is the environment it which the project will be written.
Most developers mistake the word environment for the word “technology” or “software”. For example, you develop in a “JSP environment”, or a “LAMP environment”. This is a crucial mistake that is made time and time again, and unfortunately, it hurts companies because the decision makers either make the same mistake, or they listen to those making the mistake.
I’ve said numerous times, that you can use any language to do anything. Yes, there are practical limits, using C to write a dynamic website isn’t a great idea, nor is using PHP for password cracking. Each language has it’s own strengths and weaknesses; good developers however, know what these are and work with their strengths and work around their weaknesses. This post isn’t going to focus much on languages; I figure everybody reading has already chosen PHP and knows why.
What I will say is this: Ruby, Python, PHP, Perl, Java and .NET all bring the same capabilities to the table (some things are easier in some, and some more difficult in others). You can create any solution you want in each of these languages, in an efficient, well thought out, well developed way. Yahoo! could be written in Python. How do we know this? because Google uses it. Microsoft uses .NET for it’s web presence, and while you might not like to use it, it still stands up to more stress than most of the websites on the internet.
With this in mind, I then would say that the language capabilities themselves, are the least important factor in choosing your environment.
This then brings me neatly to what else that environment encompasses. These, to me, fall into three categories. People, knowledge and penetration.
Access to PeopleTo put it bluntly, if you can’t find the people to write your code, you’re screwed. While you may know what you’re doing, and you have enough people now: your team will need to grow. If you can’t find people around you to hire, then what?
There are estimates that for every 100 PHP developers, there are 42 Perl developers, there are 12 Python developers and 4 Ruby developers. (see: here)
Some will say that this is because there is a lot of bad PHP developers. I will agree to a point, but that point is that there are just so damn many, that there are still more great developers to pick from than with other languages.
Access to KnowledgeWhile this one is more subjective, I believe that the sheer number of PHP developers generate far more useful knowledge from which to learn, cherry pick ideas and utilize them. Add to that the extensive number of books, and our excellent php|architect magazine; as well as the training and teachings provided by MTA, Zend and ibuildings, we have more going for us than most every other language with, I think, the exception of Java in terms of professionally backed learning.
Market PenetrationSimply put, the availability of PHP as a platform is there from the cheapest virtualhost, to the most expensive dedicated systems. It has gained wide acceptance from smaller companies, because it is cheap and reliable, and from enterprise companies such as IBM, Oracle and even Microsoft because they see that the ability is there for PHP to operate in that space and a huge number of developers willing to make that happen.
ConclusionNo other language can claim this trifecta, sure, there are a lot of .NET and Java developers, but a lot that goes on happens behind closed doors in big enterprises, and the knowledge is not shared. And while this isn’t true of Python, or Ruby, they lack in numbers and knowledge comparatively. This is why I choose PHP.
- Davey
Dutch PHP Conference Day -6, part 1/? from Paul Reinheimer on Vimeo.
This is an abstract for a chapter from a book on Quality Assurance in PHP Projects.
Although Unit Testing is a recommended practice for any software project, care has to be exercised such that testing yields the desired benefits. Bad programming practices in both test code and production code can make Unit Testing a nightmare. Maintenance of an overly complex test suite can easily become a burden to the project team.
Situations of hard to maintain test code can have extremely negative outcomes for project quality. Programmers start to ignore tests, because of their inconclusive description of what is going wrong. New features might not be tested at all, because writing tests for the current architecture considerably extends development time. In the end the project manager might decide to stop Unit Testing alltogether, because the costs outweight the benefits.
Bad practices of Unit Testing manifest in so called "Test Smells". These are an early indicator of problems for long-run maintainability and utility of a project test suite. To constantly derive a benefit from Unit Tests, a commitment for high quality tests has to be made.
This case study will discuss Unit Testing bad practices and well as Test Smells and gives hints on how to avoid them. For each test smell, examples are shown from well-known PHP Open Source projects. As a result, the reader should be aware of the possible pitfalls of Unit Testing and that any test code requires the same care that is put into production code.
Benjamin Eberlei is a Project Lead with direkt effekt GmbH and contributes to the Zend Framework and other Open Source projects.
Swati Iyer from Packt Publishing offered me a free copy of Mastering phpMyAdmin 3.1 in exchange for a review on my blog. I got the book, I read it, and here is the review.
"Mastering phpMyAdmin 3.1 for Effective MySQL Management" is a book about - phpMyAdmin. phpMyAdmin is a tool that most web developers use on a daily basis and know in and out. The existing knowledge about PMA is the hurdle that will make most devs refrain from buying the book; 75% of the information presented in the book was already in my head, having used PMA for over half a dozen years now.
Interestingly, the book still contained things that I didn't know and that are noteworthy. For example, I never heard about the multi-table query generator. Other aspects I didn't know about or only sketchily:
The last thing that really excited me was the foreign key dropdowns when using the pma-based linked table infrastructure. Surely I had already seen the dropdowns, played around with and used them, but I never knew that one could customize the format. And, what's way cooler, is that - if there are too much items for the dropdown (number configurable) - you'll get a "browsable foreign-table window" popup! Really nifty.
So I learned something new about phpMyAdmin while reading the book. It's a book for lazy train rides when you don't like to switch on your laptop. The book is 35 US$, so with the low Dollar today, it's a cheap buy for Europeans (and probably becoming cheaper over the next months). If you need it, and if you didn't get enough tips by reading this article.
Swati Iyer from Packt Publishing offered me a free copy of "Mastering phpMyAdmin 3.1" in exchange for a review on my blog. I got the book, I read it, and here is the review.
"Mastering phpMyAdmin 3.1 for Effective MySQL Management" is a book about - phpMyAdmin. phpMyAdmin is a tool that most web developers use on a daily basis and know in and out. The existing knowledge about PMA is the hurdle that will make most devs refrain from buying the book; 75% of the information presented in the book was already in my head, having used PMA for over half a dozen years now.
Interestingly, the book still contained things that I didn't know and that are noteworthy. For example, I never heard about the multi-table query generator. Other aspects I didn't know about or only sketchily:
The last thing that really excited me was the foreign key dropdowns when using the pma-based linked table infrastructure. Surely I had already seen the dropdowns, played around with and used them, but I never knew that one could customize the format. And, what's way cooler, is that - if there are too much items for the dropdown (number configurable) - you'll get a "browsable foreign-table window" popup! Really nifty.
So I learned something new about phpMyAdmin while reading the book. It's a book for lazy train rides when you don't like to switch on your laptop. The book is 35 US$, so with the low Dollar today, it's a cheap buy for Europeans (and probably becoming cheaper over the next months). If you need it, and if you didn't get enough tips by reading this article.
As announced previously by Sebastian, the crew of MAYFLOWER spent 5 days in St. Leonhard, South Tyrol (Italy), for this year's Barcamp. In the next couple of days the teams will present their projects ranging from LDAP to modules for PHProjekt 6 or phpmybirthday. Starting today with a ContactImporter.
Almost every internet user knows the problem: You manage your contacts at different services like social networks, webmail clients and so on. With an increasing number this can become quite confusing, and you never know where a specific contact is saved. Sometimes you wish you have a possibility to merge all those contacts at one central point.
The PHP Community is a fairly large, rules-free community of people who share a common interest in programming. Many of us hang out on Twitter, our own blogs, or on IRC (usually on Freenode #phpc). So some events of the day certainly caught me by surprise.
This afternoon, while hanging out in a lesser known channel, I was kicked out for no reason besides the whim of the operator, Derick Rethans. No warning, no rude comment on my part, just a joke followed by a kick. Alison Lunde was also kicked for a seemingly bogus reason. Another person was banned.
How could this be, two weeks after the “community conference,” which Derick himself attended?
I was furious. I felt betrayed, violated, attacked personally for something that shouldn’t have happened. I hadn’t been kicked out of an IRC channel since before I was a teenager; this was a personal insult and by God, I was ready to fight. I talked to a number of my friends in the PHP community and told them that this slight was beyond insulting; I was going to tear Derick a new one on my blog and wash my hands of the community forever. After all, everyone in the channel seemed to support this decision, right? They were all still there, hanging out, perhaps hoping they wouldn’t be next.
But a few hours went by, and a few things started to happen. First, a number of people in the community told me that leaving the community would hurt the community overall. Others told me they were beside themselves at Derick’s action, and wouldn’t be participating in any “elite” channels. I got a number of supportive emails. A number of people said “well if we can’t be a part of that channel, we’ll start our own” and did just that. Not to be exclusive - just to reduce the noise level.
As time went on I realized that the community really is larger than any one person. Even when one person does something inconsiderate or rude, that doesn’t and shouldn’t define the community. I was really ready to let Derick have it, to walk away, and to never be a part of the community ever again. But no one person defines the community, and no one person can shape it, no matter who they are. That’s the point of the PHP community.
Instead I’ll practice some forgiveness. Derick, you’re welcome in any channel I’m in, any time. Xdebug is fantastic and your book on dates and times is perhaps the preeminent work on the topic. Your contributions to the core of PHP and its documentation are unmatched by anyone, and with 130 presentations to your name, you certainly are accomplished. You’re a part of the community, and I welcome you.
For those wondering how to join the community, it’s easy. Show up in IRC, or come to a conference. Find your users group in your area, or join one of PHP’s many project mailing lists. If you need direction, Elizabeth Smith (@auroraeosrose) always has direction on work that needs to be done in the community. Dive in, get involved, don’t be a jerk and meet people. Put on a thick skin, watch out for toes, put on your work clothes and get involved.
Tell them I sent you.
Taking advantage of php|tek bringing a lot of people together, we had a PHP developers meeting over 2 days before the conference. Day 1 was dedicated to technical issues in PHP 5 and 6, and day 2 was spent discussing potential features, migration issues, current roadblocks, etc.
The notes from the meeting are available on the wiki. These notes are not necessarily “decisions”, but they do reflect the consensus of the group that was at the meeting and hopefully present a more structured and outlined list of things that we can follow for PHP 5.4/6.
In the past year I've
been working on a book, describing PHP's Date and Time functionality in
great detail. It's now finally out under the name "php|architect's Guide to Date and Time
Programming". Look at the pretty cover! It's actually a
picture I took some months ago from the church in Skien, where I am
still living (more about that in a later post).
The book is devoted on helping you understanding dates and times, as well as how PHP deals with it. It explains how PHP parsers and reads dates and times in strings including possible pitfalls; timezones, their history, the annoyances and how to deal with them properly; formatting and displaying dates and times; and last but not least, how to handle intervals and iterating over time. There is more information on the website where you can also buy this awesome book. And in case you're wondering "what? dates and times are really simple!", then this book is definitely for you.
Rumour is that all attendees of the Dutch PHP Conference will receive a copy with their tickets, if you're asking nicely I might even sign your copy! I'll be there to give a talk on "PHP on the D-BUS" and will show you how to talk to skype, GSM chips and other desktoppy things!
Using different editors during development is not easy. Try to remember the "delete the current line" shortcut:
Notepad++Ctrl+L NetBeansCtrl+E EclipseCtrl+D vimEsc,d,d joeCtrl+Y
By a show of hands, how many people here ever heard of SPL? How many already used it? Chances are most of you didn’t raise your hands, and some might even have a confused look on their faces. Indeed that is the sad reality when it comes to SPL, but What is SPL?
SPL, or Standard PHP Library, is a set of classes and interfaces built in to PHP since version 5.0, and as of PHP 5.3 it cannot even be disabled, so its here and for good. Its actually hard to disable it when compiling, so 9.9 out of 10 changes that you have it. But why have you not used it? The answer begins at “poor documentation” and ends in “didn’t even know it existed”, SPL has not had the “bling” about that it deserves, but this is where this article comes in, time to turn this around. So what is in SPL?
SPL makes available a few hooks for overloading the PHP Engine, such as ArrayAccess, Countable and SeekableIterator interfaces, to make your objects work like arrays. You can also manipulate other stuuf using RecursiveIterator, ArrayObejcts and various other iterators. It even has classes for specific points such as Exceptions, SplObserver, Spltorage and helper functions to overload other aspects, like spl_autoload_register, spl_classes and iterator_apply. Overall its a swiss army knife of code that can be implemented in PHP but that because of its hooks will probably perform much faster in SPL. So, what can i actually do with it then?
Overloading autoloader
You are a by the book programmer, and after __autoload came around you rewrote all your sites and remove the endless stream os includes and requires in your code to make way for lazy loading, right? So once in a while you found yourself in a jam, you product’s classes use a specific naming/directory structure and the Zend Framework classes you use have a “_” to path approach, how do you solve this? Giant __autoload that includes all logic, trial and error style? Alter you directory structure to Zend’s? No! Overload it!
The process is simple, just create your own autoload function and overload it, that way the autoload procedure will run the class through Zend’s loader, if it does not find a class, it will then run yours, and keep on going down the line until one of them finds it.
1 <?php
2
3 class MyLoader{
4 public static function doAutoload($class){
5 //autoload process
6 //use file_exists please
7 }
8 }
9
10 spl_autoload_register( "/>Truncated by Planet PHP, read more at the original (another 19995 bytes)
There is currently a heated debate spawned with the creation and subsequent announcement of a more or less final decision made by a select group of people at php|tek. Now I am a friend of openness, but I have a hard time remembering any significant existing project within the PHP community that actually changed its coding guidelines. For all I know the main CS in the PHP world originated in the Horde project, but adopted and expanded by PEAR, got adopted and expanded by Zend Framework. See the pattern?
Now PEAR is actually trying to do what hasn't been done before, change the CS in an existing community. From being heavily involved in PEAR years ago, I can tell you that all CS discussions on the mailinglist where useless. Of course there are bad CS and there are very good CS decisions. I personally have a few things to say here. But for the most part its about defining a standard and sticking to it. So handing over the bulk of the deciding to the PEAR group (not to be confused with the PHP group that has no real active responsibilities beyond being the copyright holders) was the only sane thing to do. Now they took things one step further and got a bunch more frameworks together. Awesome.
The mistake they made was to publish their findings on a mailinglist on php.net called php standards. It should have been published on the PEAR developer list. Or maybe some new mailinglist, just not one that makes it sound like anything more than a standard to be adopted by the named list of frameworks. Of course they should promote the standard, adjust the standard if needed, but keeping the actual deciding in a small circle again is the only sane approach for this. But making it sound bigger than it actually is, is not the way to go. Let it grow naturally and all will be good.
May has come and gone and for me almost half of it was spent on the road. SFO-DEN-BNA, BNA-ORD, ORD-ZRH-TXL-ZRH-ORD, ORD-SFO. To decipher that for you, I first went to Nashville to visit my friend Raquel and see the land of the honky tonks. I was surprised to find an almost full-sized replica of Parthenon there, as well as a really great ƒood/drink scene. Some highlights include Prince’s Hot Chicken Shack (I dare you to order something more than medium hotness), a great beer place called The Flying Saucer (150+ beers on the menu), and especially The Patterson House (recommended by the awesome Steph Dub), where we spent a few hours snacking on tasty bits from the menu and drinking the awesome cocktails that the bartender mixologists prepared in front of us.
Then it was off to Chicago for php|tek 2009 conference. The first two days were dedicated to the first real PHP developers meet-up since November 2005. On Monday we discussed technical issues with regard to PHP 5.3 and 6, and on Tuesday the topic shifted more towards potential features aside from Unicode to entice people to move to 6 and how to ease this migration. Overall it was a productive meeting and the notes should be posted soon. The next day I gave the opening keynote on the present and future of PHP. I managed to throw in a few inside jokes and funny photos in there to lighten up the morning mood. The rest of the conference was productive as well—there were great talks on everything from utilizing HTTP status codes to multi-level caching to a talk that Cal gave on telecommuting. After the conference hours we stopped by the Map Room a couple times for some excellent beer flights (La Folie on tap, OMG).

@tychay is not happy
After Chicago, I flew to Berlin for the International PHP Conference Spring Edition 2009. This year they accepted all 3 of my proposals, so I had my work cut out for me. Miraculously, I managed to make the German audience smile and even laugh a couple of times during my keynote. Success! The other two talks intl me this, intl me that on localizing and translating your pages, and All the Little Pieces on using PHP with memcached, mogilefs, and Gearman went well too. Funny enough, the RailsWay conference was going on at the same place—didn’t they know that Terry Chay is coming to town?! This was my first visit to Berlin, so Terry and I played tourists for a bit and went to see Checkpoint Charlie, the remaining pieces of the Berlin Wall, Brandenburg Gate, and Reichstag. It is really amazing to consider that the Berlin Wall used to be 150 km long and embedded a piece of Western Germany in the middle of Eastern one.
Finally, I had a long series of flights home, and despite a mishap at the immigration in Chicago, arrived to my apartment safely and almost on time. It was great to see old friends and new faces and to talk to the best development community out there.
For those of you who wondered where to get the I Unicode t-shirt that I wore during my keynote, I put the design up on Zazzle, so you can get your own for the next gathering of the Unicode-minded folks.
A few weeks ago at php|tek, I corralled developers from all of the major PHP frameworks into one of the conferences rooms. The idea was simple: in the PEAR Group we've been discussing our new PEAR2 Coding Standard and have come to some conclusions on how PHP 5.3 code should be handled moving forward. A standard is only a standard if people use it, though, and PEAR is not entirely representative of the community at large.
That's where this group comes in. By having official representatives from PEAR, Agavi, Cake, Solar, and Zend Framework and unofficial representation from Phing and Symfony, we had a good cross section. I went into the meeting with 3 items I wanted to pick off, which were, in order:
I had hoped that we'd make it through the first one, but fully anticipated it taking longer. About 20 minutes into the meeting, we were already moving on to the second item! We flew through the list and were all extremely energized by our productivity. We decided to form an official group of our projects to oversee the creation of this standard and work toward better, more widely adopted standards across our projects.
We also decided to setup a mailing list. Given all of our experience with the proletariat, we decided to make the list moderated. This has proven to be the biggest flash-point so far, drawing criticism from the creator of PHP, himself.
For better, or worst, I stand by my decision to vote for a moderated list. Below is what my vision is. It's my vision and mine alone, but this is where I'm coming from. I posted it earlier this morning to the internal list that we've started to discuss moving these standards forward.
I'd love to see an officially sanctioned standard come out of our work. All of us are too busy, both with real jobs and our various projects, to fight the battles that come of trying to make this a completely open process where anyone with an email address can contribute. Sad as it may be, pear-dev has demonstrated that coding standards *must* go the way of sausages and laws lest they devolve into a constant "but I think <insert favorite coding standard pet peeve> is better, and this is why..." followed by pages of well meaning, but generally irrelevant content.
My reason for wanting a standard is simple, I move among other coding communities in addition to PHP and I am constantly put in a position that I must defend PHP against criticisms that it is unmaintainable, barely useable, and only useful if the least common denominator is your sole concern. Needless to say, I think those are opinions are misguided at best, and patently wrong at worst; but then someone looks at WordPress or phpBB or <insert favorite "I'm amazed it actually runs" project written in PHP> source code and has all their criticisms validated.
As a community, we need to be able to come together and agree on a coding standard. When code is published for public consumption in a year, I would love it if the first comment on blog posts or mailing list messages announcing the new code is "wow, that's great, but you should run it through phpcs." In Python it's not uncommon for pastebin'd code or newly published code to have a response "read pep 8." They aren't trying to be mean or petty, they're just trying to guide someone down the path to good citizenship in the Python community.
Given it's frigid—even hostile in some cases—reception, it does look like having an official coding standard for frameworks and libraries is our best outcome. Hopefully, with the projects in the community we have behind this we'll be able to build up a consensus and prove our decisions the correct ones. If not, then at least we've expanded the number of projects we can easy move between out from our small enclaves to a wider swath of the PHP landscape.
Original post blogged on b2evolution.
Recently I read in AnandTech a good article on Solid State Devices (SSD). It certainly blew away many misconceptions I had about SSD.
From a professional point of view, my main interest would be how databases are affected by the following characteristics of SSD:
From this summary, it appears that the SSD is ideal for relatively static data, and we can selectively put certain parts of the database on SSD. Examples include:
For transaction processing systems it depends on the usage. Assuming the blocks in a table are updated 10,000 times a day, the data distribution of updates is even across all records, and the table fits into 100 512K blocks, then the lifetime of the SSD for those blocks would be 100 days (this might be acceptable if SSD was sufficiently cheap). And even for data warehouse applications with relatively static data, B-tree index rebalancings will cause the frequent rewrites of indexes.
It also appears that operations characterized by sequential writes such as transaction logging should continue to be placed on hard disks.
For some information on potential database performance, see these articles testing SSD with mysql, DB2 and PostgreSQL. Also see Windows 7 Support and Q&A for Solid-State Drives.
Tim O'Reilly talks about how Google bets big on html5. Sadly, without Internet Explorer support, a lot of this talk is moot to me. Not to say that I wouldn't salivate over using the new html5 canvas element. We draw a lot of flow charts graphics and it needs to run on as many browsers as possible. We don't use flash, we use Walter Zorn's excellent jsgraphics library. It's not very fast, but hey, that's why we have multi-gigahertz PCs on our desktops and on our laps.
Recently I read in AnandTech a good article on Solid State Devices (SSD). It certainly blew away many misconceptions I had about SSD.
From a professional point of view, my main interest would be how databases are affected by the following characteristics of SSD:
From this summary, it appears that the SSD is ideal for relatively static data, and we can selectively put certain parts of the database on SSD. Examples include:
For transaction processing systems it depends on the usage. Assuming the blocks in a table are updated 10,000 times a day, the data distribution of updates is even across all records, and the table fits into 100 512K blocks, then the lifetime of the SSD for those blocks would be 100 days (this might be acceptable if SSD was sufficiently cheap). And even for data warehouse applications with relatively static data, B-tree index rebalancings will cause the frequent rewrites of indexes.
It also appears that operations characterized by sequential writes such as transaction logging should continue to be placed on hard disks.
For some information on potential database performance, see these articles testing SSD with mysql, DB2 and PostgreSQL. Also see Windows 7 Support and Q&A for Solid-State Drives.
Here are the slides and sources from my session at the IPC 09 Spring in Berlin.
Recently I read in AnandTech a good article on Solid State Devices (SSD). It certainly blew away many misconceptions I had about SSD.
From a professional point of view, my main interest would be how databases are affected by the following characteristics of SSD:
From this summary, it appears that the SSD is ideal for relatively static data, and we can selectively put certain parts of the database on SSD. Examples include:
For transaction processing systems it depends on the usage. Assuming the blocks in a table are updated 10,000 times a day, the data distribution of updates is even across all records, and the table fits into 100 512K blocks, then the lifetime of the SSD for those blocks would be 100 days (this might be acceptable if SSD was sufficiently cheap). And even for data warehouse applications with relatively static data, B-tree index rebalancings will cause the frequent rewrites of indexes.
It also appears that operations characterized by sequential writes such as transaction logging should continue to be placed on hard disks.
For some information on potential database performance, see these articles testing SSD with mysql, DB2 and PostgreSQL. Also see Windows 7 Support and Q&A for Solid-State Drives.
This year I was abel to attended the 2009 php|tek conference in Chicago. This conference is hosted by MTACon, the company behind php|architect magazine, one of the most influent PHP publications in the world. php|tek is a unique event in its overall “feel” and purpose - for those that read my post on ZendCon’08 you may be able to pickup this difference yourselves. Tek is a community oriented event, as opposed to ZendCon which is much more aimed at companies. Is this good you ask? Yes, its perfect, it in no way falls short of the content in ZendCon, but on the plus side it gives one many more opportunities to mingle and meet the central PHP Core Developer Team, and most importantly, it inspires attendees to work with and give back to PHP.
Same as last year, the conference was held in Chicago, IL in the Unites States at the Sheraton Hotel, a wonderful venue that helps keep everyone close by during the conference and during “off-time”. The conference ran for three days plus a tutorial day - from May 19th to May 22nd. The day before the start one could already see many of the most well known PHP developers arriving - it appeared that the Core team was arriving early to host a PHP Dev meeting held at Microsoft. And the topic of the conference .. ? PHP 5.3.
The sessions were great, and tutorials day featured particularly interesting sessions, of which I attended a security talk to complement my PHP Security skills,as well as a Code Review Session. This session, held by Sebastian Bergamann, Stefan Priebsch and Arne Blankerts was extremely interesting, we dove deep into the code of some major frameworks and apps, like Magento, Wordpress, Habari and found some incredible (not in a good sense) pieces of code. This talk showed me a different side of things especially for certain areas of coding where I can certainly do better. It also gave me a new perspective on code reviews, which have today a much bigger importance then before.
The rest of the sessions during the event were really good, some were inspiring (Security Centered Design), some made you wish PHP 5.3 was out (PHP 5.3 - Hot or not?), some made incredible associations to drive home the importance of a good development environment (The Knight Rider Methodology to Software Development), some showcased the more obscure but very useful parts of PHP (SPL to the Rescue), some even tried to point you in a good direction (Untestable Code). There really were sessions for every kind of developer, from the “regular joe” to the php expert - at times I wished I had the method __clone implemented on myself, so I could get to all sessions. Also, alongside the event we had great UnCon Sessions and an Hackathon organized and led on by the community, with some simple but great sessions.
This leads me to the biggest feature of php|tek, and one most commonly overlooked by developers and managers alike, namely the community. This was by far the biggest difference from ZendCon, a total focus on the community and hence, a focus on geting everyone active. The PHP comunity has been in focus during the last few months. Since the news of PHP 5.3 was released we have seen an increase in activity inside the PHP community: BugHuntDays, TestFest09, documentation, patches, you name it the community has done it this year. User Groups keep growing and popping up everywhere. Just in Brazil we have had at least 5 groups started since last year. The conference fosters the
The recipe for success in this sense is not clear, was it the community oriented sessions (A guide to using and understanding the community, User Group Meetup)? The after-hour programming (PechaKucha night, Retro Gaming Night, Hackathon)? Maybe it was the breakfasts and lunches where you shared tables with all the active members of the community? The discussions around a cup of wine? I’m guessing it was a combination of all this, the sheer exposion to all this is enough to get you into the “giving back” mood. The ingredients are pretty simple, knowing where you can help, who to ask, where to read about it and a touch of “karma”. Many moments at tek were based on this, the interaction with great names of the community and a clear picture of what PHP needs. The whole experience shows you clearly that not Zend, ibuildings, IBM or Microsoft are in t
Truncated by Planet PHP, read more at the original (another 5056 bytes)