 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Johannes Schluter's Blog: mysqlnd plugins and json
by Chris Cornutt September 14, 2011 @ 11:04:48
Johannes Schluter has shared a handy mysqlnd plugin that he's written up that does two common things at once when you're pulling data from your database and pushing it into JSON - a mysqlnd_query_to_json function.
In my spare time I'm currently writing a shiny Web 2.0 application where I'm heavily using AJAX-like things, so what I do quite often in this application is, basically this: Check some pre-conditions (permissions etc.) then select some data from the database, do a fetch_all to get the complete result set as an array and run it through json_encode; Of course that example is simplified as I'm using the Symfony 2 framework for this project. [...] So I wrote a mysqlnd plugin.
His plugin (that he admits is "a hack") gives you the mysqlnd_query_to_json function that automagically transforms the results from the passed in query into JSON output. He notes some things lacking - like Unicode encoding and no MySQL bitfield support.
voice your opinion now!
mysqlnd json plugin convert result
Chris Jones' Blog: More on PHP and Oracle 11gR2 Improvements to Client Result Caching
by Chris Cornutt March 04, 2011 @ 09:56:33
Chris Jones has posted more information to his Oracle blog about the caching and other improvements that come along with the Oracle 11gR2 release that can be used in PHP applications.
Oracle 11.2 brought several improvements to Client Result Caching. CRC is way for the results of queries to be cached in the database client process for reuse. [...] PHP OCI8 as a "client" of the database can use CRC. The cache is per-process, so plan carefully before caching large data sets. Tables that are candidates for caching are look-up tables where the network transfer cost dominates.
Like many of the other server-side tools Oracle has to offer, it's pretty simple to enable this caching. Before you had to add a custom bit to your query to tell it to enable the caching. Now it's as simple as setting it up on the CREATE or ALTER for the table - nothing extra for the developer to do.
voice your opinion now!
oracle caching client result create alter
Kevin Schroeder's Blog: What to make of TIOBE's PHP results
by Chris Cornutt March 03, 2011 @ 12:20:29
Kevin Schroeder has some of his own thoughts on the recent results of the TIOBE index ranking the popularity of programming languages. PHP has slopped down two spots, replaced by Python and C++. He looks at the data TIOBE has to back it up and can't seem to find a reason why.
I decided to take a look and see what was going on behind the scenes by reading on the index definition to see if I could understand what happened. After reading through the definition I still don't know what happened, or even why it happened.
He goes through how the index data is created - search results from the top 6 hits in Alexa for each language result - and how he, basically, found nothing out of the ordinary. He points out that, because of inconsistencies like this, the TIOBE index shouldn't be regarded as much more than a loose guide. Since it's based on hard-coded search strings, it'll never be a true judge of "popularity" overall.
voice your opinion now!
tiobe popularity result drop python c
Chris Jones' Blog: PHP OCI8 and Oracle 11g DRCP Connection Pooling in Pictures
by Chris Cornutt February 22, 2011 @ 10:44:46
Chris Jones has posted some "pictures" of the performance that an Oracle database sees when it uses the connection pooling versus the normal connect/allocate sort of connection with the Oracle OCI8 driver for PHP. As you can see, the differences in memory consumption are huge.
Here is a screen shot from a PHP OCI8 connection pooling demo that I like to run. It graphically shows how little database host memory is needed when using DRCP connection pooling with Oracle Database 11g. Migrating to DRCP can be as simple as starting the pool and changing the connection string in your PHP application.
He also describes the differences between the pooled and non-pooled connections (to the developer it's as easy as putting ":pooled" in the connect string) in his graphs, and notes that using the pooling doesn't just have to be for large site - smaller sites can benefit too.
voice your opinion now!
oci8 oracle connection pooling performance graph result
W3Techs.com: Highlights of web technology surveys, Nov. 2010 3/4 of all websites are based on PHP
by Chris Cornutt November 03, 2010 @ 10:19:30
According to a new article on the W3Tech.com site today, around three quarters of all websites are based on PHP. They've run their own survey to gather the results about the use of several different languages like ASP.NET, Java, Ruby and, of course, PHP.
Our server-side programming language survey shows that a very remarkable 74.9% of websites use PHP, slightly increasing in the last year. ASP.NET technologies (presumably mostly C#) come in second, and a few percentages are left for Java. That's about it. The variety of programming languages used to develop websites is surprisingly small, considering that everyone and his dog develops websites these days. There is a lot of talk in the IT blogoshere about alternative languages such as Ruby and Python, but their real world usage is tiny compared to PHP.
They talk about some of the contributing factors to these numbers including the wide use of various PHP-based content management systems, the balance of high traffic versus low traffic sites and some breakdowns according to operating system, geographical area and a hint at how their survey operates to find the systems using PHP.
voice your opinion now!
survey usage result programming language website
Andrey Hristov's Blog: Replacing mysqli's Connection, Result and Statement classes
by Chris Cornutt July 09, 2010 @ 10:31:03
On his blog today Andrey Hristov has a quick post that talks about two methods to extend the functionality that the mysqli extension offers in PHP with your own custom code.
Have you ever though about extending mysqli's classes. It's pretty simple to subclass the connection class mysqli. However, subclassing mysqli_result and mysqli_stmt is not so obvious, actually I though that it's even not possible. However, never say never! After discussing mysqli's OO interface for an hour yesterday [...] I found out how one can plug his own classes.
Two code examples are provided - one for extending the mysqli_result and the other extending the mysql_stmt class. You can find more about these and other classes the mysqli extension has to offer in this section of the PHP manual.
voice your opinion now!
replace mysqli connection result statement class extend
Stoimen Popov's Blog: preg_match Give Names to the Matches
by Chris Cornutt July 06, 2010 @ 11:01:48
In a quick post to hos blog today Stoimen Popov points out a handy feature of the preg_match function in PHP (in PHP 5.2.2 and higher) to be able to name the results of the regular expression match.
In PHP 5.2.2+ you can name the sub patterns returned from preg_match with a specific syntax. [...] This is extremely helpful, when dealing with long patterns. [...] Although it may look difficult to maintain, now you can simply name the sub patterns of preg_match and to call them with their associative array keys. This is more clear when writing code and it's definitely more maintainable.
The key is to use a special syntax as a part of the expression's pattern. This replaces the numeric keys of the matches with values you define, making it simpler to use the results (instead of having to work with numbers that don't match much of anything). Code and expression examples are included.
voice your opinion now!
named result match pregmatch regularexpression
PEAR Blog: The new Group has been elected!
by Chris Cornutt August 11, 2009 @ 07:51:10
According to this new post on the PEAR blog, the new PEAR Group has been officially elected:
I am more than glad to announce the arrival, the announcement of the new PEAR Group for 2009 and 2010. With a few fresh faces in the Group, this year looks very promising with the mix of both new blood and experienced PEAR Group members.
Those selected include Chuck Burgess, Ken Guest, Christian Weiske and Brett Bieber. The PEAR Group helps to guide the PEAR project as a while and push out initiatives like the updated package manager - Pyrus.
voice your opinion now!
election result pear group
Johannes Schluter's Blog: MySQLi Resultset Iterator
by Chris Cornutt June 22, 2009 @ 11:12:11
Johannes Schluter has posted a look at a handy little script that shows an interface between the returned MySQLi results and an SPL iterator.
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.
The class extends the standard Iterator and provides the interfaces to work through the results of the query in your choice of Iterator-supporting looping structure. Example code for the class and its usage are both included.
voice your opinion now!
iterator result mysqli
|
Community Events
Don't see your event here? Let us know!
|