anamikabir / solr-php-client

solr-php-client
Other
0 stars 0 forks source link

Make require statements work more seamlessly #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

in Service.php

require_once('Apache/Solr/Document.php');
require_once('Apache/Solr/Response.php');

It's much easier to use the library if it's something like:

require_once(dirname(__FILE__) . '/Document.php');
require_once(dirname(__FILE__) . '/Response.php');

Original issue reported on code.google.com by pwola...@gmail.com on 27 Jan 2009 at 7:02

GoogleCodeExporter commented 8 years ago
On the one hand, I'm against this because it's not in the preferred style and 
standard of Zend Framework or 
PEAR. Libraries like this are intended to be on the include path so that 
through their Class naming 
conventions and file structures they can take advantage of the __autoload magic 
function for dependency 
injection.

On the other hand, I AM already doing require_once's to save the 10-20ms or so 
of overhead using 
__autoload since my Service class will directly use both other classes in most 
of its use cases. In addition I 
have fielded a number of email complaining about my "broken" requires.

So, for the sake of convenience to the user I'm willing to break with the 
preferred conventions. I'll commit a 
change shortly

Original comment by donovan....@gmail.com on 28 Jan 2009 at 4:20

GoogleCodeExporter commented 8 years ago
Fixed in http://code.google.com/p/solr-php-client/source/detail?r=4

Original comment by donovan....@gmail.com on 28 Jan 2009 at 5:25