Web Development

Making cross-sub-domain ajax (XHR) requests using mod_proxy and iframes

Posted on

One of the restrictions imposed by all browser side programming languages is that one cannot make cross-domain ajax requests. This restriction comes because of the same origin policy and even sub-domain ajax calls are not allowed. In this blog post, I will demo two methods of making cross-sub-domain ajax requests. First demo will use mod_proxy module of Apache. While the second demo will use iframe and javascript tricks for making sub-domain ajax requests. Using mod_proxy for cross-domain ajax requests By enabling mod_proxy module of apache2, we can configure apache in reverse proxy mode. In reverse proxy mode, apache2 appears be […]

PHP

PHP tokens and opcodes : 3 useful extensions for understanding the working of Zend Engine

Posted on

“PHP tokens and opcodes” – When a PHP script is executed it goes through a number of processes, before the final result is displayed. These processes are namely: Lexing, Parsing, Compiling and Executing. In this blog post, I will walk you through all these processes with a sample example. In the end I will list some useful PHP extensions, which can be used to analyze results of every intermediate process. Lets take a sample PHP script as an example: <?php function increment($a) { return $a+1; } $a = 3; $b = increment($a); echo $b; ?> Try running this script through […]

Open Source

Introducing MemChat: Open source group chat framework in PHP supporting Memcached, APC, SQLite, Flat Files and MySQL

Posted on

MemChat is an open source group chat framework for personal and enterprise level websites. Written in PHP, MemChat can be configured to run with Memcached, APC, SQLite, Flat files and MySQL as it’s storage engine. With memcached, APC and Flat files serving as temporary storages and MySQL, SQLites being permanent storage engines. MemChat uses MemBurger API for storing all the incoming messages in the storage engine. MemBurger is an open source PHP wrapper for all the storage engines mentioned above providing Collapsed Forwarding and Stale-While-Revalidate functionality. MemChat can also be configured to notify the site owners at various event handlers […]

WordPress

My learnings while building “WP-Jazzed” – A new Jazzed up wordpress theme

Posted on

Welcome the new wordpress theme “WPJazzed” for my blog. Seeing a plethora of jazzed up wordpress themes on web, I decided to start working on this new theme. In this blog post I will list my various findings while building “WPJazzed”. Why a new theme? I decided to move on with a new theme mainly because of the following reasons: Helpful Feedbacks: I received feedbacks complaining about the unorganized structure of my previous theme and I do agree with them. 90% of my blog posts were under “Web Tutorial” category, leaving tags the only way to reach posts of interest. […]

XMPP

How to use JAXL (Jabber XMPP Library in PHP) to import Gtalk contacts of any user

Posted on

JAXL is an open source Jabber XMPP Client library written in PHP. It provides a self titled class JAXL which implements XMPP protocol. It can be extended to write custom event handler for every message or presence received. Developers are using JAXL for developing real time applications. Checkout 5 exciting gaming bots you can make using JAXL. However one thing which goes un-noticed is that JAXL can also be used to import Gtalk contacts of any user. This is infact one of the very first thing which JAXL class do, after successful authentication with the Gtalk servers i.e. import the […]

PHP

Writing a custom unix style tail in PHP using Libevent API on Mac OS X 10.5.x and other platforms

Posted on

Libevent is a library which provides a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached. Many famous applications/frameworks/libraries like memcached are using libevent. In this blog post, I will demonstrate how to write a custom unix style tail script using Libevent API in PHP. Setting up the environment: Setting up libevent with PHP is a little tricky. Below are the steps, I followed to make it work on Mac OSX 10.5. However the steps should be same for any other OS you choose to code on. […]