OK...so even though this is the bottom of my page and the DB connection will not be used again, I still have no need to close it? Sorry if I sound stupid about this, but I'm just trying to get the hang of module development.
It doesn't make sense to me that closing the database connection would screw up the page on the next view. Maybe I'm missing something, I'm just trying to think this out logically. Where I come from database connections need to be closed when you are finished with them...I haven't watched the DB yet to see what finally happens to that connection, but I assume it will stay open and eventually timeout. Unless of course there is some postnuke code in the footer that goes and closes everything...
Nick
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
- nestormateo responded to »Fillters in Clip« 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
Weirdness with pnModGetVar
-
- Rank: Team Member
- Registered: Jan 02, 2003
- Last visit: Oct 21, 2009
- Posts: 800
IIRC the database connection object you get in $dbconn is a reference to the object created when PostNuke is started during pnInit. If you try to close it in your module, PostNuke stops working immediately - I tried it this morning
IMHO PHP itself closes the connection at the end.
--
"He is not dangerous, he just wants to play...." -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
Quote
IMHO PHP itself closes the connection at the end.
See the ADOdb docs for more information on this. PHP3 won't automatically close the connection, however since PostNuke doesn't work with php3...
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
In my PHP classes at Zend.com, (I'm trying to remember here) I think they were mentioning that one of the good things about it was that the connection would close automatically when it was unused....but I could be mixing up a couple of topics...that training was FAST PACED!! -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
PHP in general is very good at cleaning up after itself, which is why many performance manuals tell you the use of functions such as unset() isn't needed...
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
Simon, you've been around for quite some time, and most of the work I see you doing is in support and documentation... I was wondering if you had a list of mods you've developed? (Just curious as to what you've been up to, module-wise....I think we all develop some things that don't necessarily go public.) Is the list far too long to even go there? Oh and when do you have any personal time!?! I mean...you seem like a machine!
:) -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
A list? Well, I've done a fair few things, in my spare time (whatever that is anyway). Mostly customisation of PostNuke:
I've integrated PNphpBB2 and the PostNuke profiles together
I created a blockmanagement tool that basically allows people to select the Pagesetter stories that appear in a block by title rather than id.
I've edited the PostNuke profiles to remove the extraneous stuff that I never use.
I created pnThemeStats, a module to tell an administrator how many people are using each available theme on a site
pnStatus, released recently...
And a load of other stuff I have since forgotten about. Also many many many half done things residing on my hard drive.
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
I didn't get out at all these last few days. Something to do with the release of .761 I think.
Anyway, Drak has now permitted all pnTeam members to go back about their daily lives, so I'm free, for now ;)
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide
- Moderated by:
- Support
