General ⇒ $this->Website :: Archives ⇒ Making cpg-inst.php docs clearer/more helpful :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index$this->Website

Archived ⇒ Making cpg-inst.php docs clearer/more helpful


flum wrote
So could you explain me there lines of your code:

$this->prefix = strtolower(basename(dirname(__FILE__)));
$this->dbtables = array('Auction');

I wish that I could. I only include them because they have been in every cpg_inst.php file that I have seen. I personally have never used them.

Frankly, the documentation for the installer that I've seen is pretty sparse. Maybe one of the experts can explain what these might be used for.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux 2.6.9/Apache 1.3.36/MySQL 4.1.18/PHP 5.1.4/CPG Nuke 9.1.0.8 (Modified)


i ain't an expert -- but the

$this->prefix = strtolower(basename(dirname(__FILE__)));

basically makes the prefix whatever you have named the module's directory when you uploaded.

if you were actually creating tables in your database, this just lists them out:
$this->dbtables = array('Auction');


please basically put an "i think" before this post Smile

SEARCH the WIKI
How to Port for Dragonfly

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache/MySQL 4.1.22/PHP 4.4.6/9.1.2.1


EDIT: oops, hadn't seen your post, yet, tuta.
SaintPeter wrote
flum wrote
So could you explain me there lines of your code:

$this->prefix = strtolower(basename(dirname(__FILE__)));
$this->dbtables = array('Auction');

I wish that I could. I only include them because they have been in every cpg_inst.php file that I have seen.


The first one is used to make it easier to have multiple instances of one module. Your tablenames will have the module folder name (lowercase) as a prefix as in cms_modulefoldername_table2. As you can see it is different from the "normal" prefix.

The second one tells the back-up system which tables to back-up for the module at hand.


Frankly, the documentation for the installer that I've seen is pretty sparse.


In fact, sometimes it's even misleading or worse just wrong Cool But at least they've tried. 😄

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache/5.0.24/5/9.1 CVS


CLICK

OK -- I have immortalized Alva's words/guidance. Also provided a link back from the Module Creation Tutorial to the above post.

It is a WIKI, I tell you! Smile

SEARCH the WIKI
How to Port for Dragonfly

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache/MySQL 4.1.22/PHP 4.4.6/9.1.2.1


tuta wrote
CLICK

OK -- I have immortalized Alva's words/guidance. Also provided a link back from the Module Creation Tutorial to the above post.

It is a WIKI, I tell you! Smile


Let's hope I was correct 😄 I talk more then I code Laughing
Some other things about the example cpginst in Wiki. The current example method declares $prefix and $db global. If you use the DF installer class they are normally not needed. The one thing that would be instructive is actually using $this->prefix in the example (apart from assigning it), but I don't see it. I know there are some better examples around, probably even in the current standard package, but I don't have the time right now to find one.
Now that I've got this off my chest and out in public I won't worry too much anymore. Laughing 😉

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache/5.0.24/5/9.1 CVS


alva wrote
Some other things about the example cpginst in Wiki. The current example method declares $prefix and $db global. If you use the DF installer class they are normally not needed. The one thing that would be instructive is actually using $this->prefix in the example (apart from assigning it), but I don't see it.


OK - take another peek and see if that is any better.

Also -- should we split this thread into a more descriptive one for this work?

Making cpg-inst.php docs clearer/more helpful

SEARCH the WIKI
How to Port for Dragonfly

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache/MySQL 4.1.22/PHP 4.4.6/9.1.2.1


tuta wrote

Also -- should we split this thread into a more descriptive one for this work?

Making cpg-inst.php docs clearer/more helpful


Done. Cool

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache/5.0.24/5/9.1 CVS

All times are UTC