Im actually working on more of a port of a regular PHP script to a PN module, but i have wondered this in the past too.
How is it possible for modules that are larger than normal to work with files that have multiple subdirectories.
Maybe i need view a file that is in modules/blahblah/foo/bar/login.php
I have no idea how that would be accessed by URL and still work.
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Modules with sub directories
-
- Rank: Expert
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 1437
-
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
I've always found that anything that is accessed by a browser is always in the root directory of any well designed script, and these files then include others located in sub-directories. Presumably that is not the case with your script...
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
- Rank: Expert
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 1437
When you have large modules its going to have to be the case in order to keep anytype of good directory organization of the module. -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 186
I have used sub directories in a couple of my modules, and haven't ran into any difficulties. The thing to remember is that your functions are being called my the main index.php, so you have to define your module's directory accordingly.
There's an API function to get the URL for the current site (I'm too lazy too look it up right now).
For include, fopen statements, etc, you can prepend your modules/mymodule/mydir to your file to make sure it pulls from the proper location. So, you can fopen(modules/mymodule/mydir/subdir/login.php), for example, if you need to do something like that.
Calling the function to return the current working directory should return the file system path to index.php (aka, the root of postnuke). -
- Rank: Expert
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 1437
Well, again, that requires running everything out of the module root directory again. Wish we could somehow keep security up, but run modules as such: domain.com/modules/News/index.php or whatever. Would make it so much easier to port scripts and have more friendly urls. (with our without shorturls)
- Moderated by:
- Support
