logo       

[SMARTY] discovering the full path on shared unix host: msg#00395

php.smarty.general

Subject: [SMARTY] discovering the full path on shared unix host

Thanks for reading in advance.

I've built a Smarty app on my local box by putting
C:\Smarty in the php include_path. All works wonderfully.

When I login to my host using an ftp client, the paths I can see are

/sites/mydomain-com/html/
/sites/mydomain-com/includes/
/sites/mydomain-com/cgi-bin/

I did a phpInfo() and the php include_path is
.:/usr/local/lib/php
so in otherwords, even though there's an 'includes' folder in the domain one
level up from the html directory, it's not setup as a php include path (why
I have no idea).

I made a /smarty/ folder in the includes folder, in which I put all the
Smarty files.

I put
echo "got here";
at the top of my Smarty_extended.class.php which I put in
/sites/mydomain-com/includes/smarty/Smarty_extended.class.php.

In index.php I have
require('../includes/smarty/smarty_extended.class.php');
$smarty = new Smarty_extended;

I get nothing but a white page with "got here" in it so my includes are
obviously not finding the folder.

I've tried fiddling with the paths in my smarty_extended.class.php but I
must be missing something because it doesn't matter what I try - I still get
nothing but 'got here'.

Is there any programatical method (other than contacting the hosts tech
support) to find out the full server path to use to initialize Smarty or do
I have to sit and wait for tech support to get back to me? I tried using
relative paths, '', '.' and '/templates/', etc., but it didn't work either.
I also tried doing an ini_set("include_path",
"/sites/mydomain-com/includes/"); but that didn't seem to work either.


If this helps, here's what I have set up so far (all the directories are
either 0775 or 0777):

/sites/mydomain-com/html/index.php -- initialize smarty
/sites/mydomain-com/includes/[several php include files not specific to
smarty]
/sites/mydomain-com/includes/smarty/smarty.class.php
/sites/mydomain-com/includes/smarty/smarty_extended.class.php
/sites/mydomain-com/includes/smarty/cache/
/sites/mydomain-com/includes/smarty/templates/
/sites/mydomain-com/includes/smarty/templates_c/
/sites/mydomain-com/includes/smarty/plugins/


/* Smarty_extended.class.php */
<?php
echo "got here";
// load Smarty library files
define('SMARTY_DIR','/sites/mydomain-com/includes/smarty/');
require(SMARTY_DIR.'Smarty.class.php');

class Smarty_Tribune extends Smarty {

function Smarty_Tribune() {

// Class Constructor. These automatically get set with each
new instance.

$this->Smarty();

$this->template_dir =
'/sites/mydomain-com/includes/smarty/templates/';
$this->compile_dir =
'/sites/mydomain-com/includes/smarty/templates_c/';
$this->config_dir =
'/sites/mydomain-com/includes/smarty/configs/';
$this->cache_dir =
'/sites/mydomain-com/includes/smarty/cache/';

$this->caching = true;
}
}
?>

Thanks for any insight you may have.
Geoff


--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise