Fork me on GitHub

ModuleStudio - PHP 5 only code?  Bottom

  • Been working on a codebase generated via ModuleStudio .49 - Thanks Axel, its great!

    BUT

    A caveat is it generates PHP 5 only code using "abstract" classes.

    Just FYI - feel free to correct me or point out how to force PHP 4 compatible code generation or how to manually change it easily.

    Thanks!
    NCM
  • It is PHP5 only. Modulestudio is only just at the beginning - it would be a mistake to still let be PHP4-compatible. PHP4 is dead. Not on every shared-hosting but in general. icon_wink

    --
    best regards from Kiel, sailing city

    Steffen Voss

    Member of the Zikula Steering Committee
    Read The Zikulan's Blog "If you want people to RTFM, make a better FM!"
  • True...but a great many websites are on PHP4 still - should they be? no icon_smile Are they? yes.

    Thanks for the clarification. A notice in the FAQ or requirements (I'll mention this to Axel) may be a nicety.

    Lastly,

    If anyone wants to make it work in PHP4 the following helps:

    In the PN"item"(Array)Base files change:

    Code

    abstract class PN"item"(array)Base extends PN"moduleclass"(array)

    Code

    class PN"item"(array)Base extends PNObject(array)

    Where "item" is the class name and (Array) is if its an Array class or not.

    Also, remove the "public" prefex to the "public function __toString()" part further in the document.

    This seems to work, you could also just combine different class files into a single class.

    Anyone see a downside to trying this - other than taking away the PHP5 class extensions like abstract and public, etc.? (obviously, should only be done if you absolutely require PHP4 compatibility)




    edited by: uheweb, Jun 12, 2008 - 06:54 AM
  • Actually, its more... lots of private / protected / etc variables and functiona in the Filter classes, too.

    hmm...

    I didn't use any Filter related stuff, so just commented out in pnuser.php all the FilterUtil related lines.

    Works on PHP4 now icon_smile

    I'd prefer PHP5, but this little project I'm working on needed to be PHP4 compatible.





    edited by: uheweb, Jun 12, 2008 - 07:32 AM
  • Anyone hosting with someone who doesn't have PHP5 available needs to move on to a new host. My service provider has both and it's a simple line in an .htaccess file to make 5 the default (They leave it defaulted to 4 because of the number of scripts that break under 5)

    --
    Home Page | Find on Facebook | Follow on Twitter
  • I know...I prefer 5, and all my dev stuff is 5. I uploaded a test of the module to a PHP4 only test site for a client, and thus the problem manifested.

    Before, I didn't even pay attention that it was using PHP 5 only class stuff. icon_smile
  • Note also that zikula 2 will be PHP 5 only.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Yep. Well aware, and ready for it and PHP EOL 8/8/8 :)

    As module studio was billed as a module creator for .8 (although still beta) and Zik 1.0, it took me by surprise it was PHP 5 only.

    Just now as FYI for anyone wanting to use Zik 1.0 and ModuleStudio - make sure your own and any clients PHP is up to par - or, "revert" the code back to PHP4 icon_smile

  • concerning Gsoc project,will they all be php5 only ?
  • As they will be included earliest into Zik2 I guess it will be php5

    --
    best regards from Kiel, sailing city

    Steffen Voss

    Member of the Zikula Steering Committee
    Read The Zikulan's Blog "If you want people to RTFM, make a better FM!"

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