2

I want to use a small library within the Zend Framework (simple_php_dom, for what it's worth).

Should I just stick it in library/, include it where I want to use it (like in a specific controller) like include('library/foo.php'); and have at it?

If not, how should I do it? What's the "Zend Framework" way of doing something like this?

2
  • 1
    is there a reason why you are not going to use Zend_Dom_Query? Commented Nov 23, 2010 at 23:59
  • 1
    The only reason would be that I already have the code working based on simple_php_dom. I'm hoping to "plug and play" and avoid messing around with another, albeit similar, solution. Commented Nov 24, 2010 at 0:00

1 Answer 1

1

Since the library doesnt support PEAR conventions its not really easy to hook it up to the autoloader, so i would just manually require_once it in the controller or model that uses it. If it was used extensively I might make a wrapper class to proxy calls through and autoload that (that class having the require_once).

Sign up to request clarification or add additional context in comments.

2 Comments

That's useful to know... that the autoloader needs a library to support PEAR conventions. Thx. I'll accept this after letting the question "ferment" a bit longer.
Well it doesnt have to support PEAR conventions, but you need something you can inflect from, otherwise you need to push your own autoloader, which is a lot of work given we are only talking about a single file with this particular lib.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.