tags:

views:

35

answers:

2

Hello,

In my application at some point, I have to call the Propel library version 1.2 ( which is located at directoryA), and at another point, I need to call the Propel library version 1.3 ( which is located at directoryB).

How to do this?

Edit: I need this because a component I use uses an older version of a library that I use as well.

A: 

When do you need which one? If you can answer this maybe you solved your problem.

fabrik
That's because a component I use uses an older version of a library that I use as well.
Ngu Soon Hui
+1  A: 

This is not possible, because both versions of Propel have classes with the same name (such as "Propel"). PHP does not allow redefining (or undefining) classes.

The best thing to do is to encourage the makers of the component that uses Propel 1.2 to upgrade. Alternatively, you can try it yourself, as the Propel interface did not actually change very much.

Edit: There are of course cumbersome workarounds: one is turning the component that depends on Propel 1.2 into a separate service of some sort, that could be in theory separately invoked from the internet. Then, use virtual() (if you're on Apache) to make a separate request to this component. This will start a new PHP session in a new Apache thread/process, so there's no naming conflicts. If you need to query the component only a few times per page request, the overhead might be ok.

skrebbel