liu cougar

› eZ rewrite rule with lighttpd

Since setup of lighttpd in my test server, it seems working pretty fine. However, without the index.php specified in the url, it does not work. Lighttpd definitely supports rewrite rules, as I see an module named mod_rewrite in lighttpd config file. After a bit of searching around and failure and trial, I finally got it working. The [...]
24/05/2006 1:22 am (UTC)   Liu Cougar   View entry   Digg!  digg it!   del.icio.us  del.icio.us

liu cougar

› eZ rewrite rule with lighttpd

Since setup of lighttpd in my test server, it seems working pretty fine. However, without the index.php specified in the url, it does not work. Lighttpd definitely supports rewrite rules, as I see an module named mod_rewrite in lighttpd config file. After a bit of searching around and failure and trial, I finally got it working.
24/05/2006 1:22 am (UTC)   Liu Cougar   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› JellyandCustard.com: Using DirectoryIterator to List Files in PHP

From JellyandCustard.com today, there's a good example of creating and using a DirectoryIterator instance to loop through the files in a directory.

During the days of PHP4, the most common way of showing the files in a directory was like so [opendir, readdir, closedir]. However, if your PHP version has now been upgraded to PHP 5, you can take advantage of DirectoryIterator instead. This class (don't get scared) is part of the SPL library that is now bundled within PHP 5.

They describe the functionality and provide a simple example of its use. Also included are the other functions you can use with the resulting file handles to make for a cleaner interface in your script. They also include two examples of its usage with the output it would give - getting some stats on selected files.

23/05/2006 7:12 pm (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› Developer.com: PHP 5 OOP - Delegation and Custom Exceptions

Developer.com has posted the next part in their series covering object oriented programming in PHP5, this time focusing on using delegation to enhance the functionality of their prexisting DBQuery class.

At present our DBQuery object simply mimics (all be it - rather simply) a stored procedure. Once executed a result resource is returned which you must store and pass the MySqlDB object if you wish to use functions such as num_rows() or fetch_row() on the result set. Would it not be nice if the DBQuery object were able to implement the functions which the MySqlDB object implements; that are designed to work on the result of an executed query?

They explain each step of the way, giving you the code you'll need to attach to the current working script, making this delegation possible. They look briefly at tpye hinting and simple exception handling in the script before hitting you with a full-blown Exception handler class to improve your script's reliability.

23/05/2006 7:06 pm (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› OSSBlog.it: Interview with Tobias Schlitt of eZ Systems

The OSS blog as posted this new interview with one of the more prominent members of the PHP community - Tobias Schlitt.

It it, they cover a bit of Tobias' background, why he enjoys using PHP as much as he does, his position and feelings on open source software, as well as some opinions on PHP adoption and the Zend Framework.

Of course, they finish it off with the one question that every web developer (dealing with dynamic content/languages) gets asked in an interview - "What do you think of Web 2.0?" Read on to check out his answer.

23/05/2006 2:14 pm (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› PHPFive.net: Creating a dynamic Google sitemap using the PHP5 SimpleXML extension

On PHPFive.net, there's this new tutorial dealing with the creation of a dynamic Google sitemap with the help of SimpleXML - basically, the paths for Google to follow to best index your site.

This tutorial demonstates the PHP5 SimpleXML extension by using it to update a Google sitemap dynamically. It assumes that you have a basic understanding of PHP and are familiar with XML. SimpleXML represents a XML file as a native PHP object and this makes it a good deal easier to work with than either DOM or SAX. Using SimpleXML you can read, write or iterate over a XML file and access it's elements and attributes.

Whilst there are free online sitemap generator tools available on the Internet that allow you to create an XML sitemap which can be submitted to Google sitemaps. In order to better demonstrate the SimpleXML extension to you, we will do something useful and create a PHP function that will parse and prepend new entries dynamicly to a web sites Google sitemap.

He gets right down to it, illustrating what a sitemap looks like followed by a simple sample script to create it for that data. SimpleXML makes it a snap to generate the properly formatted XML and split it back out for Google's bots to consume.

23/05/2006 12:59 am (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› Kian Hui Teo's Blog: Switching between PHP 5.1.x and Zend Core for Oracle

Via this post from Christopher Jones we learn about Kian Hui Teo's blog post talking about making the switch between the normal PHP 5.1.x installation and the Zend Core for Oracle.

This situation arises as I had installed Zend Core for Oracle (ZCO), and I wanted to try out some PDO functions. As ZCO comes with PHP 5.0.5, I was stuck, and PDO is only included from PHP 5.1.x onwards, I had to install PHP 5.1.x on my Windows box so that I can play with PDO. The assumption is that we have ZCO installed and working with a Apache2 server. I share the steps here on how to install another version of PHP so that it will co-exist peacefully with ZCO.

The post outlines a process to allow both the Zend Core and a normal installation of PHP 5.1.x to live peacefully (and still be able to switch from one to the other at any time). It's actually a relatively simple ten-step process to follow, especially if you've had much experience with installing PHP from scratch. When complete, you can start up one or the other, making it easy to test scripts in both or to just use the functionality in one (as he needed with PDO).

23/05/2006 12:46 am (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› DevShed: An Introduction to Sockets in PHP (Part 1)

DevShed starts a new series today with this look at some of the easier ways to work with low-level sockets in PHP.

With reference to using sockets in PHP, in this three-part series, I'll try to cover their most crucial aspects. I'll start with the basics, such as creating, opening and closing a socket. Then I will proceed to using advanced approaches, such as implementing socket servers. Of course, I'll accompany this material with numerous hands-on examples.

At the end of this series, you should be equipped with a good grounding in how to use and manipulate low-level sockets in PHP, in order to expand your existing background of network programming.

They start of at the basest level, an illustration of using the socket functions to connect to a port on the localhost. They explain each chunk of code before moving on to something slightly more complex - developing a simple web application. It's made up of two parts: the server from the previous example (taking a string and making it uppercase to return it) and the client that will send the string. This basic example is then enhanced by a "rebirth" into a class making the creation of the socket server as easy as making a new object.

22/05/2006 3:52 pm (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› WebReferece.com: How to Use the HTTP Protocol

It's one of the most base aspects of the internet and helps to connect users to the resources they're searching for, but it's surprising how many developers out there don't know how to work with it directly. WebReference.com is here to help with that in their new tutorial looking at the basics of the HTTP protocol.

The article is actually an excerpt from the Sams book "Teach Yourself Ajax in Ten Minutes", but it's one of the better overviews that I've seen. It introduces what HTTP is and some of the base components (request, response, formats, etc). There are brief code examples along the way to help with formats of things like the headers sent back and forth.

They move on to the status codes that can be returned and what each means. With the basic knowledge of a message format under your belt, they get into an example - working with GET and POST requests via a simple form (and what it's sending).

22/05/2006 1:09 pm (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

tobias schlitt  eZ systems employee

› Summer in south italy

Yesterday I arrived here in Bari for the phpDay event (I will give an introductional talk about our PHP 5 library eZ components, soon). The trip was quite long, because I had to go to Milano first and then had another flight to Bari, but with about 4 hrs waiting in Milano. Anyway, I'm here now. After a fantastic dinner last night (man, _real_ italian food is soooooo delicious!) we have perfect weather here, today (32C and beautiful blue sky). A real pita that I forgot my digicam at home... But Fullo (one of the organizers of phpDay) is luckily taking photos... So, of to my session now. Greetings to rainy Germany and rainy Norway! ;-P

20/05/2006 11:31 am (UTC)   Tobias Schlitt   View entry   Digg!  digg it!   del.icio.us  del.icio.us

eZ publish™ copyright © 1999-2005 eZ systems as