Welcome to Geeklog Monday, October 25 2021 @ 12:11 am EDT

Geeklog Forums

$_TABLE vs. Automation


Status: offline

LWC

Forum User
Full Member
Registered: 19/02/04
Posts: 818
Let's say you want to change a certain table's name inside your plugin - currently you have to scan your entire archive and search and replace every occurence of the old one.

Which led me to think - is it even important that Geeklog itself would know about a plugin's tables? I mean, isn't the plugin in charge of everything regarding its tables - be it installing, modifying or uninstalling them?

So why do the plugins even use $_TABLE? Isn't it better to use, say, "ALTER TABLE {$_CONF_MYPLUGIN['table']} SET..." as $_CONF_MYPLUGIN['table'] could be changed in an instant in the plugin's config.php?

The only difference is that every relevant global would contain $_CONF_MYPLUGIN instead of $_TABLE.

The only reason I can think of that $_TABLE helps is if Geeklog needs to know about the plugins' tables itself.

So does it?
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 22/03/04
Posts: 1512
It is as you say, for the sake of convenience. My plugins make frequent use of regular Geeklog tables at the same time as its own tables. Accessing one array instead of two is, for me, more convenient especially when I'm writing the code.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
It also makes doing things like this much easier ...

bye, Dirk
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 29/08/05
Posts: 985
Automated backup programs would also benefit from having a single a _TABLES array.
 Quote

All times are EDT. The time is now 12:11 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content