September28
I have been using Zend Framework for a few months now, and I really find the E_ALL|E_STRICT set in the bootstrap file really neat. See sample code below:
-
-
error_reporting(E_ALL|E_STRICT
);echo
$var;
//display an unset variable. A notice will appear.
-
-
//using an unset variable inside an if()-condition will also display the notice message
-
//i use this kind of checking all the time, but i think it would be better to use
-
//isset() since E_ALL|E_STRICT makes your code "cleaner"
-
-
if ($var) {
-
-
}
-
-
//we can avoid this if we use isset()
-
-
-
}
-
-
//so before using a variable, i would set it to ” on the top part of my code
-
$var = ”;
-
-
//no notice message will be displayed.
So, I can no longer use variable on the fly. I have to set it somewhere on top of my code and set it to something. Putting a comment beside it really helps too.
-
-
$str1 = ”; //Street Address
-
$str2 = ”; //Building Number
-
$str3 = ”; //Country
-
…the rest of my code…
September27
Lately, I have not been keeping track of Zend Framework due to my busy schedule. But today, I was surfing their site and found out that the guys from Zend has released a new version of the Zend Framework. The release has 93 fixes for issues from the previous version and some key improvements include the following:
- New database adapter for PDO_IBM
- Custom database profiler support
- New Google Base support with Zend_Gdata_Gbase
- Added CAPTCHA support to Zend Gdata
- Improved PDF component documentation
- Enhanced search performance
- More flexible language translation facilities
- Additional UTF-8 support for validation
- Documentation of the Zend Framework system requirements
I have been waiting for the PDO_IBM database adapter. I had a project that needed to connect to JD Edwards - back then I had to “manually” connect to it :(. Search my blog for JDE or JD Edwards, I remember posting about it a few months back.
Alrighty then, here is the release announcement and the download page.
September25
Haha! Steve Jobs, in your face! Finally, DRM-free legal music downloads - by Amazon. This is certainly better than waiting for someone to seed in Bittorrent downloads *cough* (fucking leechers!)… Can’t wait to buy old tracks - these things are so hard to find illegally.
I would have actually preferred getting my music from Amazon instead of downloading them illegally. The record industry should have thought of this years ago. Imagine 2000+ legal DRM-free mp3s? Universal and EMI could have already profited millions.
September25
iStat Pro is one of the best system monitoring tools I have found for Macs. Yeah I know, why use it when MacOS X has the Activity Monitor. But I use it because it looks better and it has this temperature monitoring tab which I find very useful - I live in the Philippines and it gets pretty hot here. And best of all, it is free with no strings attached.
September25
A nice set of free (as in free beer) icons.

Click here.
September18
A very interesting blog post from khankennels.com
… sending a POST message and getting its results. We could do it using cURL or sockets - but why work that hard. Being lazy does have its advantages after all.
I found this at phpdeveloper.org
September16
The page deals with the following:
- How to suppress auto-rendering: This is useful when you have an action that handles AJAX Requests.
- Helper Paths: When you want to specify different helper found in different modules/controllers.
- Sample Custom View Helper: Where you will place your view helper and what filename it will be called.
- Writing Custom Helpers
The Zend_view tutorial can be found here in my Wiki.
September13
I have been waiting for this. I’m sure that I will be buying a copy as soon as it is released. Written by Rob Allen and Nick Lo, the book will deal more on “real-world” applications. Manning - the publisher has an early access edition and you can read the first chapter (see bottom of this post for the links).
FYI, I had a few lines of chat with Rob Allen (Akrabat) in #zftalk! I was like: “Akrabat from akrabat.com?! /me bows”. I think anyone who started using Zend Framework just a few ago surely has read his excellent tutorial!
Zend Framework in Action is a collaboration between myself and Nick Lo. We are still writing, but Chapter 1 is available for you to download and see where we are heading with the book. Manning has an early access program where you can get access to pre-production PDFs of each chapter if you can’t wait. As a bonus for signing up early, you get to tell us what’s wrong (and what’s right!) before the prose is committed to the printed page so we can fix it and you’ll get a better final book.
In order to set expectations, I should probably point out that Zend Framework in Action is a tutorial book intended to show how to use the components of the framework together within “real world” projects. Each component is dealt with in a “what is it?”, “why use it?”, “how do you use it?”, “let’s use it in the real world” manner. It’s not an advanced exposition of each component as that would take many books!
Click here for Akrabat’s Post.
Here for the book early access edition of the book.
September12
For those who are not familiar with PHP5 OOP, I found this: HERE
There are many benefits of inheritance with PHP, the most common is simplifying and reducing instances of redundant code. Class inheritance may sound complicated, but think of it this way. Consider a tree. A tree is made up of many parts, such as the roots that reside in the ground, the trunk, bark, branches, leaves, etc. Essentially inheritance is a connection between a child and its parent.Creating a parent object
Let’s say that our intention is to create a storefront where we’ll be selling cars. A simple shopping cart allows us to sell the cars and allows consumers to browse the products, and access specific information such as pricing and a description. With this in mind we know that regardless of what we’re selling, all products have certain things in common, such as a name, description, price and photo. By inheriting the Product object we can share these common properties across unique child objects.
-
-
class Product
-
{
-
private $name;
-
private $price;
-
private $photo;
-
private $description;public function Product() {}
-
protected function setName($name) { $this->name = $name; }
-
public function GetName() { return $this->name; }
-
protected function setPrice($price = ‘0.00′) { $this->price = $price; }
-
public function GetPrice() { return $this->price; }
-
protected function setPhoto($photo) { $this->photo = $photo; }
-
public function GetPhoto() { return $this->photo; }
-
protected function setDescription($description) { $this->description = $description; }
-
public function GetDescription() { return $this->description; }
-
}
-
The Product object is quite simple, it allows us to define specific information such as a name, price, photo and description. The objects setters allow us to set these specific product properties, and by using the protected keyword we only allow these properties to be set by extending child objects. Also, the Products getters are public, which allows us to obtain specific data from an object with any PHP page that includes and instantiates it. The last thing to note about this object are the properties defined at the beginning of the class. We define these as private properties so they can’t be changed directly unless using the setters provided by the Product object, this provides more security and reliability. Let’s look at how to inherit the Product object.
September8
Here is a snippet from Zend Developer Zone:
The Zend_Pdf component of the Zend Framework is intended to allow you to create or manipulate PDF documents from within your applications. In addition to its text handling capabilities, it comes complete with
drawing features that allow you to create or manipulate graphical primitives. When working with text Zend_Pdf gives you the option of using the built-in fonts or custom TrueType fonts. Its page manipulation capabilities allow you to create new pages, remove existing pages or change the order of pages already in the document. In this tutorial my goal is to give you an overview of the capabilities of Zend_Pdf.
It has details on:
- Creating a new pdf file using Zend_pdf
- Loading/opening an existing pdf file using Zend_pdf
- Adding pages to pdfs
- Saving the pdf document
- Text drawing
- Image drawing
- Coloring drawings
- Using styles
- Rotations
- and Clipping.
It is a very good tutorial. Click here.