Ok some of you have asked for an example for a template engine, well ive already done that.

http://www.besthostingforums.com/showthread.php?t=38800

AS for the example of curl here is a little one:

PHP Code: 
Class MyCurl
{
    private 
$handler null//Used to hold the reource from curl_init();
    
private $url null//Hold the url were fetfching
    
private $options = array();
    private 
$data '';

    public function 
__construct($url false//used when you create the object like $var = new Curl
    
{
        
$this->seturl($url);
    }
    public function 
SetUrl($url)
    {
        
$this->url $url;
    }

    public function 
SetOpt($name,$value)
    {
         if(
is_array($name))
         {
             foreach(
$name as $key => $value)
             {
                 
$this->SetOpt($name,$value);
             }
             return;
         }
         
$this->options[$name] = $key;
    }

    public function 
Init()
    {
        
$this->handler curl_init($this->url);
        
curl_setopt_array($this->handler ,$this->options);
        
$this->data curl_exec($this->handler);
    }

   public function 
GetData()
   {
       return 
$this->data;
   }
    
//Here just create your own methods such as
}

$MyCurl = new MyCurl('google.com');
$myCurl->SetOpt(CURLOPT_PORT,80);

$MyCurl->Init(); //Send the request

$data $MyCurl->GetData(); 
Thats just a basic example to get you started.

AS for the reusable code section in my First Post, all you have to do is add a function to set all the variables within the class back to there originals, you can then just use SetUrl to start a new request. and so on.
litewarez Reviewed by litewarez on . [PHP] Discussion (System Building) This thread is mainly to try and help guide the lost sheep in the right direction when it comes to PHP and building systems securely. Now you all probably think that I'm real good at PHP but I'm not, what im good at is understanding architecture. What i mean by architecture is summarized in these key points Functional/logic view Code/module view Development/structural view Rating: 5