 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Lorna Mitchell's Blog: PHP and JSON
by Chris Cornutt February 11, 2010 @ 10:55:06
Lorna Mitchell has taken a look at using JSON in PHP applications in a new post to her blog. More specifically, she looks at how to get it working and a downfall or two that comes with it.
This is a quick outline on working with JSON from PHP, which is actually pretty simple to do. This post has some examples on how to do it and what the results should look like. JSON stands for JavaScript Object Notation, and is widely used in many languages (not just JavaScript) for serialisation. It is particularly popular for use in web services.
She gives an example of the translation between a PHP array (of subarrays) out into a JSON message complete with grouping. She does mention one problem that using this data format has, though - the lack of typing information that comes along with the message details. That can mean the difference between an array being pushed in on the sending side and an object (from json_decode) coming out the other side. As noted in the comments, though, there's a second parameter for json_decode that tells it to force the output as an array instead (along with a mention of another helpful constant in PHP 5.3 - JSON_FORCE_OBJECT).
voice your opinion now!
json example object array webservice
Richard Thomas' Blog: Solar Framework Shorts - The Road to Solar 1.0
by Chris Cornutt February 08, 2010 @ 08:37:23
In another of his "Solar Shorts" Richard Thomas talks about the road to Solar 1.0 as broken down into three points that will lead up to the framework's 1.0 release.
If you haven't taken a look at the Solar Framework in the past now is the time to do so as the three biggest complaints about Solar are on the road to be resolved.
Some of the things that might have made you skip over the framework in the past are being worked on right now:
- Solar has been in perpetual alpha/beta forever..
- Documentation, all the cool Frameworks have cool docs.
- Examples, sometimes the easiest way to learn is to study a working application
For more information about the Solar framework, head over to SolarPHP.com and grab the latest copy.
voice your opinion now!
solar framework stable manual example
Juozas Kaziukenas' Blog: Service Layer in Web applications
by Chris Cornutt December 01, 2009 @ 10:40:42
In a new post to his blog Juozas Kaziukenas takes a look at one of the pieces of "glue" that makes up the typical web application - the service layer.
During this year I invested quite a lot for a search of a good ways to architecture a big application and make it simply good. Quite a while ago Matthew Weier O'Phinney introduced service layer in one of his great talks about models, since then service layer become one of the key architectural component one my applications. Here I'm going to show a few examples and use cases where it's very useful.
He looks at the "old style" of data interaction that several applications use as compared to injected objects and information more structured applications have put to use. He also outlines a practical use of the service layer structure - thinking of it as a layer allowing to you connect to a service, either local or remote, without the rest of the application needing to know about it.
voice your opinion now!
service layer web application example
Alexey Zakhlestin's Blog: Ode to mb_ereg functions
by Chris Cornutt November 30, 2009 @ 14:38:52
Alexey Zakhlestin has written an ode to the mb_ereg functions - a set of regular expression based functions that are more than just for unicode strings:
There is a common misunderstanding, that mb_ereg_* functions are just unicode counterparts of ereg_* functions: slow and non-powerful. That's as far from truth as it can be. mb_ereg_* functions are based on oniguruma regular expressions library. And oniguruma is one of the fastest and most capable regular expression libraries out there. Couple of years ago I made a little speed-test.
He talks about some of the options you can give it (ignore case, find-longest, multiline) and modes (grep, java, perl, etc). A few code examples are also included.
voice your opinion now!
mbereg function example
Lorna Mitchell's Blog: Conference Biography Help
by Chris Cornutt November 20, 2009 @ 11:14:49
Following some of the suggestions from the php|architect folks about getting your ideas accepted at conferences, Lorna Mitchell has posted some of her thought process behind coming up with a good conference bio.
To get to this point, I started with a list of things I should include. My job, my blog, my community activity, my technical interests. [...] I then turned my points into sentences, and emailed the result to a few people to read. [...] I always take this approach even when I know I'm probably making a hash of it, if I'm asking for someone's input, I take the time to attempt it myself and send them the result.
She also notes that proofreaders are always a big help, catching some of the small things that you might gloss over and could make your bio. You can get a few other ideas and examples here, here or here.
voice your opinion now!
conference biography example
Danne Lundqvist's Blog: Site architecture based on Zend Framework
by Chris Cornutt October 12, 2009 @ 12:32:45
In a new post to his blog Danne Lundqvist compares two sites he used the Zend Framework for - a tourism guide for Dublin and the Swedish/English Fuengirola guides. He looks at three elements of the sites - the backend, search functionality and the frontend setup.
Basing three different sites, even though they are very similar, using two different languages gives me the possibility to try out several parts of Zend Framework. It also requires a good design both in the backend and frontend to keep it maintainable. I thought maybe some people would be interested in a basic overview of the different parts needed to put everything together.
He mentions his use of these components for various parts of the site:
- Zend_Db/Zend_Db_Table
- Zend_Locale/Zend_Translate for the translation functionality
- Zend_Form for the interface
- Zend_Search_Lucene for searching
- Google Maps API
- jQuery for Javascript support
voice your opinion now!
zendframework example architecture
Pawel Turlejski's Blo: What's wrong with PHP closures?
by Chris Cornutt October 06, 2009 @ 13:16:18
In a recent post Pawel Turlejski takes a look at what he thinks is wrong with PHP closures as compared to syntax in a few other languages.
PHP 5.3, along with many other features, introduced closures. So now we can finally do all the cool stuff that Ruby / Groovy / Scala / any_modern_language guys can do, right? Well, we can, but we probably won't... Here's why.
He compares the PHP syntax for using closures/lambda functions with the abilities of Groovy and Scala. He does point out out that the ArrayObject wrapper does allow you to work a bit more fluently with the array's contents, but it's still not quite the same. According to him:
I'm sure closures will find their uses in the PHP world (like delayed execution or automated resource management), but IMHO replacing traditional loops and array operations is not one of them.
voice your opinion now!
closure groovy scala array example
Brandon Savage's Blog: Accessing Databases with PDO A Primer
by Chris Cornutt October 05, 2009 @ 11:56:37
Brandon Savage has posted the next part in his "Beginner Pattern" series sharing some of the basics of PHP with his readers. In this new article he looks at the PDO functionality and how it can be used to connect to and read from a MySQL database.
PDO offers a number of enhancements and improvements over the various database libraries (e.g. mysql_*, mysqli_*, pg_*), the biggest one being consistency. Still, the high level of code that involves direct use of the various database libraries means that PDO still isn't as widely accepted as it should be. This primer will show the various uses of PDO, and outline some of the benefits.
He gives two bits of example code - one showing a transaction and the other a normal MySQL connection without any kind transaction wrapper around it as an example of "the old way" to do things.
voice your opinion now!
pdo beginner example database
|
Community Events
Don't see your event here? Let us know!
|