PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Jul 19, 2018 1:10 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Feb 15, 2010 9:35 pm 
Offline
Forum Commoner

Joined: Tue Sep 22, 2009 10:53 am
Posts: 72
Location: Texas
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"
Syntax: [ Download ] [ Hide ]
 
<?php
     namespace "page";
     class BasicPage {
          private $_pageTitle;
 
          public function __construct($pageTitle){
               $this -> _pageTitle = $pageTitle;
          }
 
          // rest of the class code...
     }
?>
 


"/home/myname/public_html/index.php"
Syntax: [ Download ] [ Hide ]
 
<?php
     include "page";
     $page = new page::BasicPage("Page Title");
     // rest of the objects...
?>
 


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.


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 6:18 pm 
Offline
Forum Commoner

Joined: Tue Sep 22, 2009 10:53 am
Posts: 72
Location: Texas
Well, after looking high and low I decided to call the hosting company and they told me that unless I get a dedicated server I cannot get that feature to work. I guess that answers the question. Although there were no replies I would like to thank those who took the time to read it.


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 9:28 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 23, 2003 3:10 am
Posts: 11470
Location: Toronto
Have you tried using set_include_path()?

Syntax: [ Download ] [ Hide ]
set_include_path(get_include_path() . PATH_SEPARATOR . '/home/myname/com');


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group