thagenbeek / phpquery

Automatically exported from code.google.com/p/phpquery
0 stars 0 forks source link

Dependencies and File-System Mess-Up #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Just download and install.

What is the expected output? What do you see instead?
To prevent cluttering of the file system it might be taken into 
consideration to remove the zend dependencies from the phpQuery package or 
put them in a better seperated externals directory. I had no problems to 
use phpQuery without them. The basic functionality does not need them and 
if it is already installed on a system, there is no need that phpQuery 
makes the assumtion it must be copied.

The plugins itself should take care of that e.g. have their own config and 
pathes to the includes - if they need any (And maybe it is a good idea to 
distribute the plugins apart from the core.).

I would love to see more feedback on this issue since it is very much 
influenced by the Libraries Filesystem Layouts other people are using. So 
this is only from the point of view of my layout which orients itself on 
the Zend_Framework Layout:

[Library Path]/Library1/...
              /Zend/...
              /Mylib/...
              /Mylib.php (if there is a class Mylib)

So I installed phpQuery as followed:
[Library Path]/phpQuery/...
              /phpQuery.php (because there is a class phpQuery)

I removed the Zend stuff from your package. Since I do not use the plugins 
I did not run into any problems.

Original issue reported on code.google.com by artn...@gmail.com on 5 Oct 2008 at 10:22

GoogleCodeExporter commented 9 years ago
Like you interest in this issue. I will start with some facts:
 * Zend is used by Ajax which is not a plugin
 * phpQuery uses Zend according to it's standards, which is properly set include path

Now when you delete phpQuery/Zend because you have it elsewhere - everything 
works
right, because it was intended to do so. Removing Zend (selections) from 
package will
create very unpleasant task for any user who will need Ajax, because he will 
need to
download it and copy it to right place. Zend selection in phpQuery are ~400kb, 
full
Zend is 15MB.
About plugins - only 2 (1 in latest release) are distributed with core and 
those are
significant IMHO. I doubt any other plugins will be in release packages.

Now why Zend/ isn't in same dir level as phpQuery/ is ? Simulation:
Dir1
  Zend
  phpQuery
Now we have to add Dir1 to include path. Developer places Zend and phpQuery 
dirs into
his library dir, so his library dir needs to be added to include path (to 
achieve
require 'Zend/anything'). This IMHO can do a real mess up.

I'm not saying that i'm happy with actual structure, but it bypasses certain
problems. Plugins eg also can be placed ANYWHERE, because phpQuery is only doing
require 'PluginName.php'.

What do you propose ? Maybe library should use Zend in other way ? Maybe:
if (! include('Zend/foo.php'))
  include dirname(__FILE__).'../Zend/foo.php';
Than it wont be added to include path, by library, but i dont know if Zend 
itself
wont do this ;)

Original comment by tobiasz....@gmail.com on 6 Oct 2008 at 3:40

GoogleCodeExporter commented 9 years ago
Wiki page describing dependencies:
http://code.google.com/p/phpquery/wiki/Dependencies

Original comment by tobiasz....@gmail.com on 12 Nov 2008 at 11:17