Context URL is a very little and fast module. It gives you the opportunity to use the complete page url as Context condition: you can check if the URL string matches a given shell wildcard pattern, also described in fnmatch PHP function.
So you can use wildcard * and []. Take a look at this: fnmatch.
Context URL is descended (uses code) from Context PHP, a more powerful and flexible module for Context management.
You can use it instead of a more sophisticated module like Domain Context if you want to check the domain URL. You can use, also, in place of Context plugin from path because it doesn't give you the possibility to check the complete URL but only the page part.
Commits for Context URL:
http://drupal.org/node/1387780/commits
Project Page:
http://drupal.org/sandbox/gianfrasoft/1387780
Versions:
Drupal 7
How this module is different from other similar projects:
Context URL offers a very easy approach to context definition by accessing page URLs, easyer and faster then domain module's.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | drupalcs-result.txt | 3.02 KB | targoo |
| #1 | syntax.txt | 3.77 KB | nick_schuch |
Comments
Comment #1
nick_schuch commentedYour result when running it through code sniffer (also attached): http://ventral.org/pareview/httpgitdrupalorgsandboxgianfrasoft1387780git
You will need to setup a branch called 7.x-1.x instead of using the master branch.
A README.txt should be included with your module.
Comment #2
gianfrasoft commentedThank you very muck @nick_schuch,
I committed a new version with a README.txt file included and some upgrade.
Bye.
Comment #3
gianfrasoft commentedok to go
Comment #4
targoo commentedIt appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.
Comment #5
targoo commentedManual review :
1) contexturl.info
Clean your info file by removing :
version = "7.x-1.x-dev"
core = "7.x" (appear twice)
project = "contexturl"
Comment #6
gianfrasoft commentedThank you targoo.
I did it.
Comment #7
gianfrasoft commentedI think it's time to go online...
Comment #8
patrickd commentedI'm sorry, don't RTBC your own issues
Comment #9
krylov commentedHi,-
please
1. remove duplicate
core = "7.x"
from contexturl.info
2. please write README.txt
Comment #10
gianfrasoft commentedRemoved duplicate
core = "7.x"
from contexturl.info
New commit is online.
Thanks.
Comment #11
Anonymous (not verified) commentedMy manual review :
1) You are still working in the master branch, you're not supposed to create a subfolder called 7.x-1.x
Get a look at : http://drupal.org/node/1066342
2) The README file is not well formatted, it is supposed to be a UNIX file format with 80 columns.
3 ) Do not include the LICENSE file, it will be automatically added by drupal
4) The .info file is not well written. Version and project tag should not be there
See there http://drupal.org/node/542202
Comment #12
gianfrasoft commentedHi, Quentin Albrand, and thank you very much for your attention.
About your first comment: I'm not a good Git user (I'm a Window's user) but my project stays on a directory structure like this:
\7.x-1.x\contexturl
I really don't understand how do the subfolders' structure have to be...
Please, help me...
Comment #13
patrickd commentedbranches have nothing to do with folders or their structure, please read the documentation about how to use git on drupal.org
Comment #14
gianfrasoft commentedI created a Branch. I hope I did a good job.
Please, take a look... Thanks!
Comment #15
serjas commentedto access the files, i have to go 3 level after branch .. is that permitted? (http://drupalcode.org/sandbox/gianfrasoft/1387780.git/tree/refs/heads/7....)
Comment #16
sreynen commentedHi gianfrasoft,
As #15 suggested, you need to move the files up to the same directly your .git is in, so the repository is a list of the files in your project, not a container directory.
Comment #17
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
Comment #18
gianfrasoft commentedSorry, my problems with git is the only reason why I can not close this project.
I'll try again.
Comment #19
mxtPlease, release this as full project: I'm using subpathauto and context modules, but no context can be set with urls like node/*/sub-page.
I think this module can resolve this issue (can't it ?)
Thank you very much
PS: I've also evaluated this sandbox project: http://drupal.org/node/1475274 but seems that there is no more activities there...
Comment #20
gianfrasoft commentedYes, it does exactly what you say.
I have some problem with Git configurations and have no time to solve it... sorry.
I'll try to do something next week. Any help would be appreciated.
Comment #21
mxtOk, I've tried to test your module, here's the results:
$current_url = $_SERVER['HTTP_HOST'].request_uri();in your execute() function, because it check all the url (ok, this is by design) but how do you manage it when you deploy your site from development to stage to production? You have to change the url in every ambient? For example:
I think this module should limit the url checking only for the last part (using for example
$current_url = request_path();) and leave to Domain Context module the management of complete urls.However this is a very useful module: thank you for working on it!
Hope this help
Good work!
Comment #22
decipheredI have tested the latest copy of the module and it's not currently working, however I did supply a patch (as I actually need this module) to get it back on track as well as extended an offer to help mentor the developer to get the module ready to release.
Comment #23
mxtThank you Deciphered!
FYI in the meantime I'm using Context Request Path that works like a charm.
Can we hope for an integration between these two modules? For example the feature to check ALL the full url or only the final part could be an option to choose from.
Thank you very much
Comment #24
decipheredMXT,
My specific need is only achievable with the Context URL module, so I can't really comment on integration with the two, and it's really up to the two developers to discuss that prospect, but in general I'm all for collaboration.
Comment #25
gianfrasoft commentedThat's right! It's a limit, I know: you have to change context rules every time you move your site to another host but I don't want Context URL to be limited to specific domain.
One of the greatest opportunity offered by this module is to rule domains!
Differently, I agree when you say that the module have to manage better multivalues in $options['pageurl']. I'll create a patch asap.
Thank you!
Comment #26
gianfrasoft commentedOk, so I changet title and categoty to this task.
Comment #27
klausiProject applications are tasks. Only reviewers should assign project application issues to themselves. The project application title should reflect the module/theme name.
You need to set the status to "needs review" if you want to get a review, see http://drupal.org/node/532400
Comment #28
gianfrasoft commentedSorry! I mixed up the task I was working on at the same time!
@MXT, I'll work on your request just after my module will go online!
Thank you, @klausi.
Comment #29
gianfrasoft commentedI updated project to a new stable version.
Thank you, Stuart Clark!
Comment #30
decipheredI've left one last set of notes on coding standards, just regarding whitespace in a few of the files.
There's a few other minor issues via Coder, but I think this is definitely in a releasable state.
I would recommend some reading of Git workflow as there seemed to be quite a bit of confusion, tagging a sandbox release and such, but good work otherwise. Happy enough to mark it as RTBC.
Comment #31
deciphered@MXT,
Looking back at your comments on #21, I have to completely disagree, the reason I wanted this module was that I don't want the complexity of the Domain module but I want a way to switch certain reactions based on the domain of the URL for the purposes of environment switching.
For example, with this module plus my recently released Contextual variables module I can set a reaction on www.mysite.com* that will disable the Environment indicator from showing up and I didn't need to resort to the complexity of the Domain Access module to do it, simply a Context condition and reaction.
If anything, I would vote that this module should only deal with the domain part of the URL as for me the path can be managed via the existing reactions, but I see no reason to reduce that functionality when it doesn't hurt anyone.
Comment #32
mxt@Deciphered,
in my #23 I've already proposed to add an interface option that could resolve the impasse: a simple radio-button like this for example:
[] check ALL the full url (domain included).
[] check only the final part of the URL (request_path).
Could this be the solution to meet all needs and make this module really complete?
Comment #33
gianfrasoft commentedI think this could be an interesting enhancement for the module for what you could open an issue on module's page (please, do it!).
Here the discussion is about the module validation and I hope you would support it: I'll give my time to support all the requests from the community because my interest is to make my module even more useful.
Thank you very much for your suggestions!
Comment #34
stborchertHi Gianfranco.
It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Your branch should be named "7.x-1.x" (so you need to delete the branch "7.x-1.0" as well).
Additionally you've already created a tag named "7.x-1.0" which is basically an indicator for the first stable release (which is not ready yet).
Leaving this behind the module looks very clean and very (!) usefull.
Comment #35
gianfrasoft commentedThank you. Now I changed default branch and deleted all tags. Please, check...
Comment #36
kscheirerIt wasn't clear to me form the project description what your module does - especially since Context already supports path matching. I think you could use a few examples on how it works instead of just referring to fnmatch.
Comment #37
kscheirerWhat is on the first line of your README? I see it in my browser as
\feff.These kinds of comments are useless - either put something helpful in there or just delete them :)
There's a typo in your plugin, "forumula" should be "formula".
Instead of $_SERVER['HTTP_HOST'] I think you can use the global $base_url variable. The boolean logic in your execute() function is a little messy, you could definitely clean that up, but it seems like it would work. You should also remove the master and 7.x-1.0 branch, and just work out of your 7.x-1.x branch only. When you are ready for a point release (7.x-1.0) - that's a tag that you make from the 7.x-1.x branch.
These are mostly minor issues though, except for maybe the git branches, but I don't see any critical problems.
Comment #38
kscheirerThis may be a duplicate of Context Domain, although context domain doesn't seem to have a release? Not sure how to handle that.
Comment #39
gianfrasoft commentedOk. As I wrote in project description:
I think this is clear. In other words, using Domain Context means to put thousands of PHP commands in your project, using Context path plugin means that you have the possibility to check only the page part of the URL.
Tou can suggest me a different description, my english isn't great... sorry. But my module is in sandbox since 1 year and now it works very well...
Comment #40
gianfrasoft commentedI changed file format to UTF8 without BOM.
Do you think this is a problem?
Ok, corrected!
In my test installation, based on Microsoft IIS, sometimes $base_url is empty. I couldn't solve this problem but I see on Internet there are other people with the same problem. So I can't use the variable. But I don't think this might be a problem for the publication of my module...
I need to go online, after that I can plan to refactor the module and write a better code. After all you can see there are lots of conditions...
Ok, I'm going to do it...
Comment #41
gianfrasoft commentedNo, it is not!
From description:
Domain is a very big module: why do I have to install Domain if I can install a faster and smaller module like Context URL and do the same in a more and more easy way?
Comment #42
gianfrasoft commented@kscheirer
Thank you for everyting you did for this module.
I see on GIT one only branch and in Readme file disappeared \feff char. Any other consideration from you will be welcome.
Bye.
Comment #43
kscheirerThanks for the extra info, you already have RTBC from me :)
Comment #44
chx commentedThanks for your contribution, gianfrasoft!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #45.0
(not verified) commented.