Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make require statements work more seamlessly #1

Closed
GoogleCodeExporter opened this issue Jun 9, 2015 · 2 comments
Closed

Make require statements work more seamlessly #1

GoogleCodeExporter opened this issue Jun 9, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link


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
Copy link
Author

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

  • Changed state: Started
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant