Fork me on GitHub

Spaghetti-o Code???  Bottom

  • Hi

    I've been given the task to wrap my head around postnuke and write some code. While I can appreciate the nature of the project and it's broad scope, I feel the learning curve has been more steep than necessary. I have a few questions related to this:

    1) why was postnuke not written in object oriented fashion? hunting down an elusive function in dozens of included files and included-in-included files is an unnecessary tedium ... not to mention the global variables ...

    2) has anyone published some PhpDocs for postnuke? (like javaDoc) this would help....

    thanks

    -FRizzo
  • PN has evolved and gone through many design changes. Unfortunately each stage was never quite completed before the next was started. That is why it looks so complex.

    There are two main module types: old and API-compliant.

    The former type (News, Downloads, etc) uses many includes and duplicated code to work. These also use globals for many of their functions.

    The new module type (htmlpages, FormExpress, Blocks, etc) leave the includes to the API. These modules are called up by the module API and in turn may call up their own and other module APIs without a single 'include'. The also do not need to use globals.

    The old style modules interact with the theme using globals. The new style modules don't interact with the theme at all.

    This will bring us on to the next style of module. The latest versions will interact with the templating engine being developed now (I know nothing about its progress though). This will require another rewrite to fix the modules up for that theming/templating engine. I fully expect many modules to be left behind though, as they are so complex to change. However, using just the third-generation modules should result in simpler code within the modules.

    -- Jason

    PS The API-compliance was meant to ring-fence the core code so that a module does not have to worry about what is or is not included - everything it should need would be available by default.

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