It would be great if we could add a configuration setting that would allow admins to specify an alternative location for the phsCAS directory. It is problematic to have it in Drupal's root directory because it makes it a little more difficult to upgrade core in some instances. In addition, it is starting to become common practice for modules to add their libraries to the sites/all/libraries directory. Having a setting would allow us to install CAS to the libraries directory, or even specify a path outside of the document root.
Thanks,
Chris
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | cas-85794-10.patch | 0 bytes | metzlerd |
| #12 | cas-857954-9.patch | 5.29 KB | metzlerd |
| #8 | cas-857954-8.patch | 5.13 KB | cpliakas |
| #5 | cas-857954-6--2.patch (6.x-2) | 2.18 KB | realityloop |
| #4 | cas-857954.patch (6.x-3) | 1.9 KB | realityloop |
Comments
Comment #1
cpliakas commentedThe attached patch is a first attempt at the configuration setting. The variable defaults to "sites/all/libraries/CAS", however there is an update function that sets the variable to the old location for people who are upgrading from pre 6.x-3.x versions of the module.
Comment #2
cpliakas commentedI made a mistake and referenced the "phpCAS.php" file in various comments and help text, which obviously doesn't exist. The attached patch fixes the mis-referenced file by replacing with "CAS.php". In addition, it adds a validation handler to make sure trailing slashes are stripped if they were added by the user. This makes it consistent with the path that is calculated in the cas_library_version_get() function.
Thanks,
Chris
Comment #3
realityloop commentedYour not making use of the Libaries API module which allows this work with libraries directory in multiple places, here is my version of the patch for 6.x-3 and 6.x-2.
Tested and working at my end.
Comment #4
realityloop commentedFix to meet coding guidelines
Comment #5
realityloop commented6.x-2 patch didn't work, have updated and now it does.
Comment #6
cpliakas commentedHi realityloop.
Thanks for the input. From my perspective, the Libraries API is in an alpha state, and I would rather not make this module have a hard dependency on a third party module. I think integration with the Libraries API is a wonderful idea, but I am of the opinion that it should be optional and not required. Just my $0.02, and I would be interested to hear the maintainer's perspective.
Regardless of my opinions, great idea and good work with the patches.
Chris
Comment #7
metzlerd commentedI would agree. We need a soft dependency here. Since the module doesn't currently support putting stuff in sites/all/libraries, I'm ok with adding an if function_exists test to determine whether that library is installed, but the require_once should work a in a way that it doesn't break existing installs that have the CAS library installed just by adding it to the PHP include path. I don't really want to force people to install stuff in the library folders here.
Does that make sense?
Comment #8
cpliakas commentedHi metzlerd.
To me, the reasoning makes sense. I think the goal of the patch in #2 is to eliminate any assumptions all together since it gives the developers the option of where the CAS library resides. I re-rolled a patch that is a combination of mine in #2 and realityloop's in #4 to add Libraries API support. In addition, I modified the logic so that it works exactly as it does now by default. Judging by the response in #7, this is important. With the patch applied, users will be able to do the following:
Thanks,
Chris
Comment #9
cpliakas commentedChanging back to original title for consistency with what is trying to be accomplished in this issue.
Comment #10
realityloop commentedTested and working using libraries method
Comment #11
metzlerd commentedDid not work as it currently does by default. I'm going to try a bit of a logic rework and submit a revised patch for testing by others.
Comment #12
metzlerd commentedHere's a revised patch. I changed the code to use class_exists to detect failure. Would love to see some more testing on this in other enviornments.
Comment #13
cpliakas commentedThe addition looks fine to me. I think defensive coding like this always helps the stability of a module.
Thanks,
Chris
Comment #14
metzlerd commentedFurther testing revealed that I couldn't save any settings without revising the test to ensure that the file exists. So I made a pretty significant revision to to the strategy, here. I'll go ahead and commit these changes, since they appear to work. But additional testing would be welcome.