Re: include remote class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/10/05, Andy Sandvik <andy@xxxxxxxxxxxxxxxxxxx> wrote:
> im doing include('http://www.mysite.com/class.php');
> and then i create new instance but i get error - cannot instantiate
> non-existant class
> how can i get this remotely hosted class file to be defined?

If it's a PHP file sitting on a web server I doubt you will get at the
actual source using that method.  Usually when you want to show the
source of a PHP file you configure the web server to show .phps files
as PHP source.  For Apache a line like this works:

AddType application/x-httpd-php-source .phps

Also.. I'd just download the class file and read it from the local
file system.  There's a lot of overhead in including a PHP file
remotely everytime your script runs.  Even if you just cache the file
every so often it'd still be way better than a direct call every time.
 I could be wrong but I doubt the class file is changing so much so
often that you need a realtime include() like that.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux