Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some directions/questions on plugin dev
#1
Hello,

For the plugin KO Site settings (which I announced v0.1 of in the Plugins forum ) I would need some further directions on how to use PHP, because I am not very experienced with it. Any help is appreciated..

So here are a few questions, which I will update if any other come to mind:
  1. Is it bad practice to export plugin data to the rest of the site's PHP in a global variable instead of providing globally accessible functions like get_setting? If it isn't I would rather make a PHP array global than defining separate settings for it.
  2. On the other hand, will this cause problems to access on other plugin pages if these are loaded before? What hook(s) should I use to make sure the global is available to both template, components and other plugins if I use this approach? (cf. '$item' global in I18n components)
  3. Would the above impact performance positively? I'm scratching my head to find out what is the best solution to make the least file_get_contents calls as possible; the current direction I'm looking at is having an array of all the data available in the plugin's class instance for retrieval.. What do you think? (previously every call to get_setting included a call to file_get_contents)
  4. What is the best way to secure access to a PHP file? Is it safe to use $_COOKIE['SESSID'] (or someting like that)? I read somewhere that sitewide cookies were broken? Currently I am using a custom $_REQUEST token to compare to data in the logged in user.xml file; is this a good method?
  5. My plugin supports PHP 5.2+; however in the i18n file there's a message saying 'You need PHP 5.1.3+'.. Should I make this compatible?

PS @shawn_a I am in the meantime happy to announce that your suggestion (about providing a UI shim for GSCONFIG) works with KO Site Settings (as tested locally) and that v0.2. will allow any plugin developer to register his or her own custom settings through PHP. :)
Reply




Users browsing this thread: 1 Guest(s)