Zen Cart Logo
Forums / Upgrading to 1.5.x / Backup MYSQL example Plugin ? & Where is the best place to post programmer questions?

Backup MYSQL example Plugin ? & Where is the best place to post programmer questions?

Views: 877

Results 1 to 4 of 4
20 Jun 2012, 7:48 PM
#1
mcosens avatar

mcosens

New Zenner

Join Date:
Mar 2008
Posts:
7
Plugin Contributions:
0

Backup MYSQL example Plugin ? & Where is the best place to post programmer questions?

Hi

I am using backup_mysql_plugin_v1-5 http://www.zen-cart.com/downloads.php?do=file&id=7 for building UI for a plug-in I am working on. (thanks for posting it)

I noticed that the English define file backup_mysql.php was in admin_Zen_Cart_1.5.0_Install/includes/languages/english/ rather then admin_Zen_Cart_1.5.0_Install/includes/languages/english/extra_definitions/

Is there a reason to put it in .../english/ rather then .../english/extra_definitions/ ? To me the second location seems a more symmetrical location compared to the rest of the code & it seems to work.

Where is the best place to post developer/programmer questions/discussions such things as: coding standards, PCI code requirements, what's this function really doing & other such "exciting" programmer questions?

Thanks,
Mackenzie

21 Jun 2012, 2:30 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Backup MYSQL example Plugin ? & Where is the best place to post programmer questions?

mcosens:

I noticed that the English define file backup_mysql.php was in admin_Zen_Cart_1.5.0_Install/includes/languages/english/ rather then admin_Zen_Cart_1.5.0_Install/includes/languages/english/extra_definitions/

Is there a reason to put it in .../english/ rather then .../english/extra_definitions/ ? To me the second location seems a more symmetrical location compared to the rest of the code & it seems to work.
Nothing in that file is needed on any other page than when the backup page is used, so it is not appropriate to put it into the extra_definitions folder.
Further, if you do put it into the extra_definitions folder, then defines from that file will override defines for other pages, such as HEADING_TITLE will potentially show up as "Database backup" on every page such as Customers and Orders and Languages and Configuration etc because the definitions conflict with each other.

You're misunderstanding a key architectural theme that runs through everything in Zen Cart: each page has a corresponding language file of the same name as the page itself.
ie: /admin/backup_mysql.php has a corresponding language file which is relevant to that page only, contained at: /admin/includes/languages/LANGUAGE_NAME/backup_mysql.php

If you follow the pattern you will have the best results and fewer unexpected results.

21 Jun 2012, 5:35 PM
#3
mcosens avatar

mcosens

New Zenner

Join Date:
Mar 2008
Posts:
7
Plugin Contributions:
0

Re: Backup MYSQL example Plugin ? & Where is the best place to post programmer questions?

DrByte:

Nothing in that file is needed on any other page than when the backup page is used, so it is not appropriate to put it into the extra_definitions folder.
Further, if you do put it into the extra_definitions folder, then defines from that file will override defines for other pages, such as HEADING_TITLE will potentially show up as "Database backup" on every page such as Customers and Orders and Languages and Configuration etc because the definitions conflict with each other.

You're misunderstanding a key architectural theme that runs through everything in Zen Cart: each page has a corresponding language file of the same name as the page itself.
ie: /admin/backup_mysql.php has a corresponding language file which is relevant to that page only, contained at: /admin/includes/languages/LANGUAGE_NAME/backup_mysql.php

If you follow the pattern you will have the best results and fewer unexpected results.

OK,

Does the same pattern apply to other "extra_" folders such as /boxes/extra_boxes/ & /functions/extra_functions/, that is, if I want to globally overwrite a function I place my new function in /functions/extra_functions/ but if I want function only for my plugin (called my_plugin) I can place it in /functions/my_plugin.php?

Note: I am trying to understand ZC architecture and behaviour, I would be more inclined to place functions specific to my_plugin in a folder specific to my_plugin example includes/modules/my_plugin/my_plugin_functions.php.

Is there documention other then http://www.zen-cart.com/wiki/index.php/Developers ?

Thanks you,
mackenzie

22 Jun 2012, 4:36 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Backup MYSQL example Plugin ? & Where is the best place to post programmer questions?

Edits to built-in functions must be edited directly in the existing files. There are no overrides for functions files.

NEW functions you've built can be added to the /includes/functions/extra_functions/ folder ... and all files ending in ".php" in that folder will be automatically loaded.