How to setup the "include_path" in a Linux shared host
Posted: Mon Feb 15, 2010 8:35 pm
Hello,
I seem to have a hitch on my get along when working with "namespaces". I am working on a personal web site and would like to try the "namespace" feature; however, I can't get it to work. I tried modifying the "include_path" by adding ".:/home/myname/com". This is what my files look like:
"/home/myname/com/page/BasicPage.php"
"/home/myname/public_html/index.php"
My site is hosted on a shared server, not a dedicated one. Can anyone help me out with this? Thanks in advance for your help.
I seem to have a hitch on my get along when working with "namespaces". I am working on a personal web site and would like to try the "namespace" feature; however, I can't get it to work. I tried modifying the "include_path" by adding ".:/home/myname/com". This is what my files look like:
"/home/myname/com/page/BasicPage.php"
Code: Select all
<?php
namespace "page";
class BasicPage {
private $_pageTitle;
public function __construct($pageTitle){
$this -> _pageTitle = $pageTitle;
}
// rest of the class code...
}
?>
Code: Select all
<?php
include "page";
$page = new page::BasicPage("Page Title");
// rest of the objects...
?>