Reply to Re: [PHP] include remote class

Your name:

Reply:


Posted by Greg Donald on 05/10/05 23:53

On 5/10/05, Andy Sandvik <andy@extantsolutions.com> 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/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация