phpScheduleIt
May 20, 2013, 12:50:54 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: absolute directory references  (Read 5607 times)
suburbanskies
Newbie
*

Karma: 0
Posts: 3


« on: February 18, 2007, 11:22:26 PM »

I'll apologize in advance if this the wrong place for this topic.

I would like to use phpSheduleIt on our web site which uses a CMS template system, where each page is a database record. After looking through some of the php code, I believe I could place the specific php pages that are referenced by a URL (like index.php, schedule.php, etc.) into their own DB record (mysql), and leave the includes in their default install location. What makes this difficult are the relative URL's embedded in the application modules and code.

Is there a switch that can be used in the config.php file (or somewhere else) that would let me set the webroot path, or will I need to search for and modify all the relative URL's in the application? My goal is to have the schedule application fit into the content area of our site just like all our other web pages, to keep a consistent look.

Cheers
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #1 on: February 19, 2007, 09:51:47 AM »

In the code currently, all files are referenced by where they are located relative to the page you are referencing it from.  In most cases, this is done by building a full, absolute path to the file by prefixing the file name to load with the directory path of the file you are loading from.  For example,

Code:
$basedir = dirname(__FILE__) . '/..';
include_once($basedir . '/lib/Utility.class.php');
Logged
suburbanskies
Newbie
*

Karma: 0
Posts: 3


« Reply #2 on: February 19, 2007, 12:29:35 PM »

Since the CMS uses the webroot for every page load, would I be correct in assuming that I could change the $basedir variable to '/'?
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #3 on: February 20, 2007, 09:44:11 AM »

It's worth a shot, but I don't know if it will work.
Logged
suburbanskies
Newbie
*

Karma: 0
Posts: 3


« Reply #4 on: February 23, 2007, 11:25:52 PM »

I did a quick scan for include_once and found 142 occurances in 65 files (think I got that right - its late). I am going to try to change the include URL's from relative to absolute references and see if everything still works. If it does, I'll try to load the application files into the CMS system and see what I get. If this works, I'll tar the results and send it to you if you like.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #5 on: February 26, 2007, 10:04:20 AM »

Definitely
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!