
trouble moving existing site having "self-contained" Pear packages defined within it
I am moving an existing app written years ago to a new server. It uses
Sigma Template 1.3 and Quickform 1.1.1 and PEAR.php,v 1.1.1.1 2004/02/16
The directory structure is like this:
/site
/site/html/Pear.php
/site/html/Sigma.php
/site/html/Common.php
/site/html/Quickform.php
/site/html/Quickform/
/site/Mail/mail.php
/pages/page1.php
....
In the file Quickform.php, it starts off with:
ini_set('include_path','.:..');
....
(line 23)require_once('PEAR.php');
(line 24)require_once('HTML/Common.php');
require_once '../HTML/Sigma.php';
....
This throws the error:
Warning: main(HTML/Common.php) [function.main]: failed
to open stream: No such file or directory in
C:\...\HTML\QuickForm.php on line 24
If I change:
(line 24)require_once('HTML/Common.php');
to
(line 24)require_once('Common.php');
it throws MANY more errors but the first of which is:
Warning:
defaultrenderer(HTML/QuickForm/Renderer/Default.php)[functio n.defaultrenderer]:
failed to open stream: No such file or directory in C:\..\HTML\QuickForm.php
online 1416
which is where the default renderer is referenced using
'HTML/QuickForm/Renderer/Default.php'
I want to move this site over with as little change as possible and still
work without updating it too much because updating one thing is going to
make me change many things.
I have tried installing the standard pear packages and changing the
references in the code. there is one particular error throw that calls
getBlockContent() in SIGMA that is not in the current version.
I am wondering if I shouldn't set up an Apache.conf alias for HTML to that
directory for that virtual host.
Any ideas or experience in moving an existing site sites where all the pear
packages are self-contained, is MUCH appreciated!!
Re: trouble moving existing site having "self-contained" Pear packages defined within it
"Paul" <lof [at] invalid.com> wrote in message
news:7WxOh.28213$68.27367 [at] bignews8.bellsouth.net...
|I am moving an existing app written years ago to a new server. It uses
| Sigma Template 1.3 and Quickform 1.1.1 and PEAR.php,v 1.1.1.1 2004/02/16
|
| The directory structure is like this:
| /site
| /site/html/Pear.php
| /site/html/Sigma.php
| /site/html/Common.php
| /site/html/Quickform.php
| /site/html/Quickform/
| /site/Mail/mail.php
| /pages/page1.php
| ...
you should create a site/application class and give it interfaces that point
to paths. mine looks like this:
<?
class application
{
static private $_instance = null;
static public $adminEmail = '';
static public $classDirectory = '';
static public $cssDirectory = '';
static public $currentPage = '';
static public $description = '';
static public $errorLogFile = '';
static public $fontDirectory = '';
static public $homePage = '';
static public $host = '';
static public $htdocsDirectory = '';
static public $imagesDirectory = '';
static public $includeDirectory = '';
static public $jscriptDirectory = '';
static public $lastSecurityCode = '';
static public $logo = '';
static public $mailDropDirectory = '';
static public $popUpAttributes = '';
static public $rootDirectory = '';
static public $securityCode = '';
static public $title = '';
static public $uploadBaseDirectory = '';
static public $uri = '';
private function __clone(){}
private function __construct(){}
static function getInstance()
{
if (is_null(self::$_instance)){ self::$_instance = new application(); }
return self::$_instance;
}
}
?>
in your code, you should do something like:
$site = application::getInstance();
$site->includePath = '/site/inc/';
and in your other code, reference the interface:
require_once $site->includePath . 'some.script.php'
the site/application class should be put in on file that is required by
*all* of your scripts at the beginning. when you roll out to another site
(which could have a completely different directory structure), all you have
to do is edit this required script to point the class interfaces to the
appropriate directories. i call mine 'site.cfg.php'. i also put this script
(relative.path.php) in php's include path:
<?
$parsedUri = dirname($_SERVER['PHP_SELF']);
$parsedUri .= substr($parsedUri, -1) != '/' ? '/' : '';
$relativeUri = str_replace('/', '', $parsedUri);
$relativePath = strlen($parsedUri) - strlen($relativeUri) - 1;
if ($relativePath < 0){ $relativePath = 0; }
$relativePath = str_repeat('../', $relativePath);
if (!$relativePath){ $relativePath = './'; }
?>
so, every script i have starts out like this:
<?
require_once 'relative.path.php';
require_once $relativePath . 'site.cfg.php';
?>
thus, it makes *no* difference how php is configured nor how deeply nested a
script is in your directory structure, your script will always be pointing
to the correct files you require.
hth,
me
Re: trouble moving existing site having "self-contained" Pear packages defined within it
"Paul" <lof [at] invalid.com> wrote in message
news:7WxOh.28213$68.27367 [at] bignews8.bellsouth.net...
btw, don't top-post. had i seen that, i'd have never responded! if you're
about to say 'oh, my computer's clock is just off', i'll respond '"dumbass"
still applies'.
Re: trouble moving existing site having "self-contained" Pear packages defined within it
"Steve" <no.one [at] example.com> wrote in message
news:NJyOh.674$Zf5.147 [at] newsfe04.lga...
>
> "Paul" <lof [at] invalid.com> wrote in message
> news:7WxOh.28213$68.27367 [at] bignews8.bellsouth.net...
> |I am moving an existing app written years ago to a new server. It uses
> | Sigma Template 1.3 and Quickform 1.1.1 and PEAR.php,v 1.1.1.1 2004/02/16
> |
> | The directory structure is like this:
> | /site
> | /site/html/Pear.php
> | /site/html/Sigma.php
> | /site/html/Common.php
> | /site/html/Quickform.php
> | /site/html/Quickform/
> | /site/Mail/mail.php
> | /pages/page1.php
> | ...
>
> you should create a site/application class and give it interfaces that
> point
> to paths. mine looks like this:
>
> <?
> class application
> {
> static private $_instance = null;
>
> static public $adminEmail = '';
> static public $classDirectory = '';
> static public $cssDirectory = '';
> static public $currentPage = '';
> static public $description = '';
> static public $errorLogFile = '';
> static public $fontDirectory = '';
> static public $homePage = '';
> static public $host = '';
> static public $htdocsDirectory = '';
> static public $imagesDirectory = '';
> static public $includeDirectory = '';
> static public $jscriptDirectory = '';
> static public $lastSecurityCode = '';
> static public $logo = '';
> static public $mailDropDirectory = '';
> static public $popUpAttributes = '';
> static public $rootDirectory = '';
> static public $securityCode = '';
> static public $title = '';
> static public $uploadBaseDirectory = '';
> static public $uri = '';
>
> private function __clone(){}
>
> private function __construct(){}
>
> static function getInstance()
> {
> if (is_null(self::$_instance)){ self::$_instance = new application(); }
> return self::$_instance;
> }
> }
> ?>
>
> in your code, you should do something like:
>
> $site = application::getInstance();
> $site->includePath = '/site/inc/';
>
> and in your other code, reference the interface:
>
> require_once $site->includePath . 'some.script.php'
>
> the site/application class should be put in on file that is required by
> *all* of your scripts at the beginning. when you roll out to another site
> (which could have a completely different directory structure), all you
> have
> to do is edit this required script to point the class interfaces to the
> appropriate directories. i call mine 'site.cfg.php'. i also put this
> script
> (relative.path.php) in php's include path:
>
> <?
> $parsedUri = dirname($_SERVER['PHP_SELF']);
> $parsedUri .= substr($parsedUri, -1) != '/' ? '/' : '';
> $relativeUri = str_replace('/', '', $parsedUri);
> $relativePath = strlen($parsedUri) - strlen($relativeUri) - 1;
> if ($relativePath < 0){ $relativePath = 0; }
> $relativePath = str_repeat('../', $relativePath);
> if (!$relativePath){ $relativePath = './'; }
> ?>
>
> so, every script i have starts out like this:
>
> <?
> require_once 'relative.path.php';
> require_once $relativePath . 'site.cfg.php';
> ?>
>
> thus, it makes *no* difference how php is configured nor how deeply nested
> a
> script is in your directory structure, your script will always be pointing
> to the correct files you require.
>
> hth,
>
> me
very cool idea - thanks
Re: trouble moving existing site having "self-contained" Pear packages defined within it
"Steve" <no.one [at] example.com> wrote in message
news:SLyOh.675$Zf5.82 [at] newsfe04.lga...
>
> "Paul" <lof [at] invalid.com> wrote in message
> news:7WxOh.28213$68.27367 [at] bignews8.bellsouth.net...
>
> btw, don't top-post. had i seen that, i'd have never responded! if you're
> about to say 'oh, my computer's clock is just off', i'll respond
> '"dumbass"
> still applies'.
I honestly don't know what top-post means so I did not do it intentionally.
What does top-post mean?
Re: trouble moving existing site having "self-contained" Pear packages defined within it
"Paul" <lof [at] invalid.com> wrote in message
news:4PyOh.28233$68.23893 [at] bignews8.bellsouth.net...
| "Steve" <no.one [at] example.com> wrote in message
| news:SLyOh.675$Zf5.82 [at] newsfe04.lga...
| >
| > "Paul" <lof [at] invalid.com> wrote in message
| > news:7WxOh.28213$68.27367 [at] bignews8.bellsouth.net...
| >
| > btw, don't top-post. had i seen that, i'd have never responded! if
you're
| > about to say 'oh, my computer's clock is just off', i'll respond
| > '"dumbass"
| > still applies'.
|
| I honestly don't know what top-post means so I did not do it
intentionally.
| What does top-post mean?
look at the date/time stamp on your original post. now look at the time of
my response. it appears that i, at 1:45 pm, have not only predicted that at
3:51 pm you'd have a question, but that i'd know what that question was.
further, that i'd be able to respond fully to your yet unwritten question.
finally, that i'd be able to foresee what your future post's headers would
be. geesh, that this ng server would also have the same predictive
capabilities and be able to keep all this thread together...it's beyond me!
it means 1 of 2 things. in this case, it is when one intentionally sets his
pc clock to some future time before posting a question with the intent of
his post being see at the top of a ng until other posts with a newer time
start pushing his down the list. it is fucking rude! either fix your time or
expect to get plonked! don't know what that means? fucking google!
Re: trouble moving existing site having "self-contained" Pear packages defined within it
|| I honestly don't know what top-post means so I did not do it
|| intentionally.
and, oh illogical one, you don't have to know every statute of law before
you can break one, now do you!
Re: trouble moving existing site having "self-contained" Pear packages defined within it
"Steve" <no.one [at] example.com> wrote in message
news:0WyOh.676$Zf5.33 [at] newsfe04.lga...
>
> "Paul" <lof [at] invalid.com> wrote in message
> news:4PyOh.28233$68.23893 [at] bignews8.bellsouth.net...
> | "Steve" <no.one [at] example.com> wrote in message
> | news:SLyOh.675$Zf5.82 [at] newsfe04.lga...
> | >
> | > "Paul" <lof [at] invalid.com> wrote in message
> | > news:7WxOh.28213$68.27367 [at] bignews8.bellsouth.net...
> | >
> | > btw, don't top-post. had i seen that, i'd have never responded! if
> you're
> | > about to say 'oh, my computer's clock is just off', i'll respond
> | > '"dumbass"
> | > still applies'.
> |
> | I honestly don't know what top-post means so I did not do it
> intentionally.
> | What does top-post mean?
>
> look at the date/time stamp on your original post. now look at the time of
> my response. it appears that i, at 1:45 pm, have not only predicted that
> at
> 3:51 pm you'd have a question, but that i'd know what that question was.
> further, that i'd be able to respond fully to your yet unwritten question.
> finally, that i'd be able to foresee what your future post's headers would
> be. geesh, that this ng server would also have the same predictive
> capabilities and be able to keep all this thread together...it's beyond
> me!
>
> it means 1 of 2 things. in this case, it is when one intentionally sets
> his
> pc clock to some future time before posting a question with the intent of
> his post being see at the top of a ng until other posts with a newer time
> start pushing his down the list. it is fucking rude! either fix your time
> or
> expect to get plonked! don't know what that means? fucking google!
My clock is set correctly to my local time. I have no idea why they are
posting the way they are. I have never had anyone say anything in the 10
years I've used newgroups. I wish I knew how to fix it. Thanks for your
help, anyway.
Re: trouble moving existing site having "self-contained" Pear packages defined within it
On Wed, 28 Mar 2007 13:59:11 -0500, Steve wrote:
>
>|| I honestly don't know what top-post means so I did not do it
>|| intentionally.
>
> and, oh illogical one, you don't have to know every statute of law before
> you can break one, now do you!
Do you run out of your meds towards the end of _every_ month?
PHP » alt.php » trouble moving existing site having "self-contained" Pear packages defined within it