Fork me on GitHub

Weirdness with pnModGetVar  Bottom

Go to page [-1] 1 - 2:

  • 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
  • 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 icon_smile

    IMHO PHP itself closes the connection at the end.

    --
    "He is not dangerous, he just wants to play...."
  • 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
  • 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!!
  • 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
  • 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!

    :)
  • 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
  • Thanks Simon... I knew you had a bunch of stuff, but I don't get out much these days. :)
  • 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
  • :)
  • Kudos

Go to page [-1] 1 - 2:

This list is based on users active over the last 60 minutes.