Feed aggregator
Gonzalo Ayuso's Blog: Using Monkey Patching to store files in CouchDb using the standard filesystem
Gonzalo Ayuso takes his "CouchDb as a filesystem" approach one step further (see the previous post about it here) with this new post talking about monkey patching to store files into the CouchDb server using the normal PHP file handling functions.
Since PHP5.3 a new design pattern is available for us: Monkey Patching. With this pattern we can override PHP's core functions with a home-made functions in a different namespace (another example here). That's means if I have fopen function in the above example, PHP uses the filesystem function "fopen" but if we set a namespace in our example, PHP will search first the function within the current namespace.By defining the new interface inside of a namespace (with functions to override the default PHP file handlers) you can have the rest of the code call the same functions (fopen, fread, etc) but they'll do different things. In this case it handles them as push and pull to the CouchDb instead of the normal filesystem. You can grab the source for this example here.
Kevin Schroeder's Blog: You want to do WHAT with PHP? Chapter 4
Kevin Schroeder has another new post to his blog today with an excerpt from his "You Want to Do WHAT with PHP?" book. This new post is a section from the fourth chapter looking at stream handling.
Communication is key to building applications now and for the future. While it is not something that I think that everyone should do, I have not seem many applications that make good use of streams in PHP. Streams can be immensely useful in the right situations, but a lot of developers are not really aware of how streams can be used. [...] While I don't think you will end up basing your application around streams it is a really good idea to know how streams work.The sample code (and description) talk about changing the properties of a stream on the fly. He shows how, with a fgets loop checking the input, he can catch a command from the already running script and change the compression setting on the currently open stream. The compression changes the stream's data from plain text to a binary format as handled by the streams functionality.
TechTatva.com: [How To] Setup Cherokee with PHP5 FPM
On the TechTatva.com site today there's a new tutorial posted about getting the Cherokee web server set up and running PHP5 FPM. It's a few simple steps to install and a few clicks around the GUI to get things configured.
In this "how to" we will see how to setup cherokee on Ubuntu with PHP5-FPM (FastCGI Process Manager). Although the cherokee CookBook claims that "If PHP-fpm binaries are found, those will be prioritized over the regular binaries." it turns out that the latest stable version of cherokee in Launchpad gives errors while enablingA few calls to "apt-get" install some packages (Cherokee and php5-fpm) and changes to the Cherokee configuration - handled through its web-based interface - are all that's needed to add a new behavior rule to the default vServer to link to the PHP5-FPM install (as FastCGI).
Zend Developer Zone: Zend Framework is a BOSSie Award Winner
According to this new post on the Zend Developer Zone, the Zend Framework has won itself a BOSSie award (from InfoWorld) in the "best open source application development software" category. Matthew Weier O'Phinney has this to say about the award:
I am one of the privileged few to have worked with Zend Framework since before the original public pre-alpha release. [...] What [Mike Naberenzy] showed me at the time captured my imagination: the company with the best known name in the PHP industry was building an application framework, and the code I was seeing was simple, straight-forward PHP. It was the first time I'd seen a framework I was actually interested in using -- even if it was in its early, early infancy. I knew at that moment that I wanted to be involved in the project.He mentions some of the things that "shook up" the development world when those first versions of the Zend Framework came out - like the PHP5 requirement and the CLA you had to sign to contribute.
Other BOSSie award winners include jQuery, Apache Hadoop, Git and Go.
ThinkPHP Blog: Contributing to Zend Framework
On the ThinkPHP blog today there's this new post talking about open source contribution and, more specifically, making contributions to a popular PHP project - the Zend Framework.
Who hasn't ever started writing his own Framework/CMS? It is considered best practice for learning purposes, but going through all the security stuff can be stressful and boring at the same time. That's where most devs start to contribute to big Open Source-projects like Typo3 or the Zend Framework, because they are already experienced working with it and yet evolving another system on the market or even getting people to contribute seems like an unachievable task.They talk about the evangelizing that all of the Zend Framework tutorial posts do to further the cause of ZF use and how they can help introduce beginners to the framework even easier than them trying to submit bugfixes right from the start. They also talk about the process of contributing back to the Zend Framework - signing a CLA, reading the standards, grabbing the code from the subversion server and checking out the bug tracker for things to get in and fix (and write unit tests for, of course).
Developer.com: Getting Started with Memcached Distributed Memory Caching
On Developer.com today there's a new article talking about memcache and how you can implement it in your application to provide a performance boost for applications in a distributed environment.
As distributed system is part of the Memcached definition, you can install Memcached on various servers to make a larger caching server. In this way, Memcached helps reduce database loads to a minimum, resulting in faster and more responsive Web applicationsThey take some time to explain what memcache is - a simple to use caching system that reduces the dependency on other data sources - and how to get it installed (via the package manager of your choice). They suggest times on when and when not to use it as well as some of the security implications you'll need to worry about when implementing it. There's also a bit of sample code to help you get started in your application. You'll need the memcached extension to make it all work, though.
My interview at dot KDE
Jos Poortvliet did an interview with me for dot KDE in this summer's aKademy and it has been online for a while now. In it we discuss things like Midgard as a storage engine for desktop applications, and Maemo's open QA process for Downloads applications. Some excepts:
At maemo.org we have an appstore for FOSS applications on the Maemo platform. This appstore is enabled by default on all Nokia N900s so we wanted to have some quality control. We had to create our own appstore approval process, compatible with the FOSS philosophy. Now any developer can submit an app, and anyone can test and vote. The whole process is completely transparent, auditable and visible. And it also provides a feedback channel from testers and users to the developers!...
Midgard is a data storage service. Whether you write desktop or web applications, instead of coming up with your own file format, you just use Midgard. You can work more easily and object-based. Users have many different devices these days, so Midgard has strong replication features to synchronize between different systems. Midgard is built on top of GObject; we provide bindings to a bunch of different languages so developers can choose the tools they like - PHP, Python, Javascript. Currently (as in now, while we're talking) Qt bindings are being developed here at Akademy.AjaxRay.com: Extending Zend Form Element to create customized Phone number field
On the AjaxRay.com site today there's a new tutorial for the Zend Framework users out there with a library they can use to extend Zend_Form for custom phone number fields.
When taking Phone number as user input, we can worn users about phone number format by setting a hint/description and can validate using Regular Expression. [...] Now, if we try provide this feature in Zend Form, that's possible. We can create three individual Zend_Form_Element_Text objects and join there value together to make the phone number. But, in this case, validating them together is a hassle.Instead of separate fields, the library they create makes it simple to handle them as a whole field. It works as a helper for Zend_Form and lets you set things like the separator between the text fields, a "format" string and a validator to apply to their fields (in the example code, it's the "digits" validator). Sample code is included to show you how it fits in your form.
Site News: Blast from the Past - One Year Ago in PHP
- Community News: PHP Cache Accelerator for Windows
- Joomla Blogger: Update: Joomla 1.6 Release Plan
- Developer.com: Build your own MVC Framework: Making Headway
- Lorenzo Alberton's Blog: Create a video preview as animated GIF with FFmpeg and PHP SPL
- David Kent Norman's Blog: Drupal on Snow Leopard
- Davey Shafik's Blog: Fixing ZDE 5.5 on Snow Leopard (Crashing & Text Selection Bugs)
- Web Development Blog: Sending e-mails via SMTP with PHPmailer and Gmail
- NETTUTS.com: CodeIgniter From Scratch: Day 5 '" CRUD
- Blue Parabola Blog: Magento Feature Analysis Series, Part 7: Order Management Offering
- Samuel Folkes' Blog: Where Has All The PHP Gone?
- Daniel Krook's Blog: Technology of the day: Zend Server
- The Bakery: Clearing Up Some Confusion on the Release Versions of CakePHP
- Benjamin Eberlei's Blog: Enums in PHP
- Dagfinn Reiersol's Blog: Don't refactor without unit tests
- DevShed: Sanitizing Strings with Filters in PHP 5
Gonzalo Ayuso's Blog: Using CouchDb as filesystem with PHP
In a new post to his blog Gonzalo Ayuso shows an interesting use for the CouchDB tool - using it as a filesystem for cross-server handling of things like images or other binary resources.
One of the problems I need to solve in my clustered PHP applications is where to store files. When I say files I'm not speaking about source code. I'm speaking about additional data files, such as download-able pdfs, logs, etc. Those files must be on every node of the cluster. [...] CouchDb has two great features to meet or requirements with this problem. It allows us to store files as attachments and it also allows to perform a great and very easy multi-master replica system.He shows how use two libraries he's created to connect to the CouchDB instance and, based on this structure, be able to insert the content - a text file in this case - pull it back out, get the meta data about it and even move it to another location in the structure.
Web Builder Zone: The different kinds of testing
On the Web Builder Zone (from DZone) Giorgio Sironi has posted a new article that talks about the different kinds of testing you can do on your application - both on the frontend and backend.
Automated testing supports your constant effort in design and refactoring, and besides that ensures that your application actually works in a reliable and repeatable way. [...] In this article I'll describe the different categories of testing, as applied to a Zend Framework 1 application, but this classification pertains to every web application based on object-oriented programming. Since this kind of applications is obviously PHP-based, PHPUnit will be the tool of choice along with some of its standard extensions.He looks at five different types of testing you can do on your application:
- Unit testing
- Pragmatic unit testing
- Functional testing
- Integration testing
- Acceptance testing
Not all of these can be done with PHPUnit on the backend, but they (mostly) have automated tools of their own like Selenium for frontend interface testing.
Zend Framework is a BOSSie Award Winner
Josh Holmes' Blog: Scaling WordPress on Microsoft
Josh Holmes, just coming off of presenting at OpenCa.mp in Dallas, has posted his entire presentation to his blog for anyone that missed it and wants to catch up. He spoke about scaling WordPress on the Windows platform. He also includes a lot of content in the post that he wasn't able to get to during the presentation.
Now, on to my session itself. This was a fun session. I only had 30 minutes and I had about 3 hours of material so I've got a ton of stuff in these notes that I didn't cover in the session itself. The session is a take off a session that I did at MODxpo back in the spring. The talk itself is about 3-5 minutes of slides and the rest is all demos.If you're looking for the actual slides, they're over on slideshare, but the real content - including the demos (and screenshots of them) are included. He talks about the Windows Platform Installer, the WinCache library and Windows Azure Data Storage.
Speaking at PHPNW 2010
I’m excited to announce I’ll be speaking at PHPNW Conference, to be held October 9th, 2010 in Manchester, UK. I’ll be doing my talk, “Developing Easily Deployable PHP Applications“, which I also did in July at OSCON. I’m working on making the talk even better based upon feedback I received, and will talk more about the various tools we use and have developed to make building SugarCRM easier.
This is my first time to this conference, but judging from the lineup of talks it is not one to miss if you are in the area. The lineup has several exciting talks about PHP development from some of the biggest names in PHP. You can register now at the conference website; early bird registration ends on September 4th.
PHPBuilder.com: Downloading and Parsing Gmail Messages in PHP
New on PHPBuilder.com today there's a tutorial showing you how to download and parse messages from Google Mail. In their case it's grabbing and parsing submissions from a form.
Some friends of mine publish a literary journal that accepts submissions via email. At their request I wrote a script to download messages from the journal's Gmail account and do some simple parsing tasks. Most of the submissions are made using an HTML form and a corresponding mailer script on their website, so I knew the precise format of the incoming messages (see Figure 1). What I didn't know was how to access Gmail in PHP.He tried out the libgmailer script first, but ran into roadblocks until he realized he could use something PHP already had - the imap functions. With these he shows how to make a connection to the Gmail servers, get the listing of messages and pull out the body for the one you want to parse.
Zend Developer Zone: Introduction to DataModeler
On the Zend Developer Zone today there's the first part of a series from Vic Cherubini about an ORM tool he's created to make pulling data from your database of choice (via PDO objects) simpler - DataModler. This first part looks at creating testable models.
DataModeler allows you to create easily testable Models that are not dependent on any datasource. The majority of your logic should take place in the Model, and not the Controller (making your application even easier to test as data sources can be mocked). I try to keep my code as simple as possible, so DataModeler is fairly small.He talks about how the DataModler tool uses dependency injection and how one primary namespace (DataModlerModel) contains the bulk of the code. He includes code samples showing how to create a simple mode, give the attributes data types and access them via magic "set" and "get" methods. For more information on this ORM tool, check out the latest source on github.
Contributing to ZendFramework
Who hasn't ever started writing his own Framework/CMS? It is considered best practice for learning purposes, but going through all the security stuff can be stressful and boring at the same time. That's where most devs start to contribute to big Open Source-projects like Typo3 or the Zend Framework, because they are already experienced working with it and yet evolving another system on the market or even getting people to contribute seems like an unachievable task. Instead of wasting his time on yet another ACL implementation, the developer is taking part in making a software become even better, no matter if he delivers new features, reports / fixes bugs or works on documentation (another, yet an often underestimated part of contribution). It is also worth noting that every single Blog-entry and every HowTo thats put on the web also is a great deal of contribution that helps the software spreading. Beginners articles are important to put on the web since every one of us had it's beginnings and these are the sort of articles where many people decide to either use the software for a certain project or not.
As you might see, this article is not only a guide on contributing bugfixes, but also I want to motivate you to just give it a try.
... on Zend FrameworkHaving spent almost a year at the IRC support channel, I can tell they're really fun guys to hang around with. Of course, the Framework itself developed into a great piece of software. I do not want to discuss the up or downsides of a use-at-will framework, neither I want to recommend it over {put your favourite software here}. But what I can talk about is a little summary of the support channel's chatlogs. The widely annouced channel (which is #zftalk on Freenode) includes all kinds of concerns. One kind of people finds bugs, the other do have really clever ideas on improvements, but when you ask them to contribute its all the same: they either think it takes years to get into it, the others think they might be "not good enough for this". We sure won't force or threaten people to contribute, but what I can do is taking the fear out of it and demystify the thing, so later you might see that its actually just a few minutes to spend. Let me just loose a few words to the latter ones before we get into it: You can't destroy anything, and every idea of yours can also lead to a great improvement either realted to your concern or in a completely different area. We're glad that you take your time, even if you are completely new to ZF. Some beginners concerns already caused developers to write guides and articles that are still around and are linked at times in #zftalk...
... on contributing to Zend FrameworkContributing any code to ZF requires signing the CLA, which is an agreement that both you have the right to share any code you supply, and that you will not patent that code. This is to ensure that the frameworks codebase remains business friendly, and free to use for everyone. In fact you have to actually sign a paper, having done this you can just scan and mail or fax it. This is an important step, and none of your code will be used in any official package unless you did this.
The next step will be reading the coding & subversion standards. If you already had a look at actual ZF components code you should be familiar with the standards. Once you took a short insight (you probably wont be able to just remember all of this at once), you can check out the official SVN repository. Notice, that you, even having signed the CLA and being confirmed, do not have commit rights. So you might now ask yourself how to contribute then? All magic is taking place in the bugtracker, ZF's official Jira. All bug tickets, additions and improvements are filed as tickets here. So if you find a bug, report it here, and soon there will be a discussion in the comments section of a ticket.
Mostly all of these people, being listed by their reallife names, are also to be found on different names in the support channel, so feel free to ask them any ticket-related stuff.
The code itself will be submitted as a patch file (svn diff > patchFile), and uploaded in the Jira-Ticket. This might also be done by people who do have commit rights, but one might not be sure how to fix a problem, or any question might be left. This method of code management then leaves it to the original package developer to decide whether a change should be made or it should be thought over again (might have side effects on other packages and so on).
The last yet very important point is unit tests. ZF makes heavy use of th
Truncated by Planet PHP, read more at the original (another 1916 bytes)
Big step forward in Modular Database Applications with DataObjects
Community News: Day Camp 4 Developers
If you're a developer are are looking on a way to brush up on some of your "soft skills" in your career of choices, you should check out this day long camp being organized by Cal Evans - Day Camp 4 Developers.
Invest a Saturday in your career. Learn the skills you need from your five camp counselors. We promise no wallets or lanyards. This one-day, technology agnostic, online conference will feature 5 sessions in a single track. You participate in this live conference from the comfort of your own home or office. (or anywhere you have internet connectivity) In addition, you will be able to download all of the sessions after the conference for off-line review.The event will last all day - seven hours on a Saturday - and can be accessed from anywhere you have a computer to run the GoToWebinar software. There's a cost of $35 USD for each attendee or $30 USD in groups of 10 or more. If you're interested check out the Day Camp 4 Developers site or just go on and register! You can see the schedule here.
