Help Rebuild OsCommerce
Moderator: General Moderators
According to onion2k's dns Gantt chart, we should start design the DB!
http://www.ooer.com/onion/dnsGantt2.png
feyd | we don't need a massive image breaking the page layout.
Where we are standing in the DB design?
PHP5/OOP:
I think that we should write it with a super-class:
dns_superclass.php
dns_db_class.php
index.php
I think that it's the best way for OOP.
http://www.ooer.com/onion/dnsGantt2.png
feyd | we don't need a massive image breaking the page layout.
Where we are standing in the DB design?
PHP5/OOP:
I think that we should write it with a super-class:
dns_superclass.php
Code: Select all
<?php
Class DNS_super_class
{
var $sql_core;
var $theme_core;
//...
}
?>Code: Select all
<?php
Class DNS_db_class
{
var $dns_superclass;
//...
?>Code: Select all
<?php
require_once "dns_superclass.php";
require_once "dns_db_class.php";
$dns_superclass = new DNS_super_class;
$dns_superclass->sql_core = new DNS_db_class;
$dns_superclass->sql_core->dns_superclass &= $dns_superclass;
?>ok wrote:and btw - your code is php4, not 5 :p- Right now I use PHP4 because my hosting company only supports it...
what is the implementation of that code in PHP5?
Code: Select all
<?php
class DNS_super_class
{
public $sql_core;
public $theme_core;
//...
}
?>Hello,
After a though week I eventually have time to work on DNS...
I can see that according to the gantt chart the DB design should be ready, so...
I have an initial design:
Explanation:
dns_error:
This table contains E,W and N level errors.
`error_id` - Error id, i.e 100 - module not found.
`error_level` - Error level, i.e Notice, Warning, Error... (like in PHP).
`message` - The reference to the message in the local file. This reference will be used to the local file of the log and the print.
`log` - Log the error. 0-No, 1-Yes.
`print` - Print the error to the screen. 0-No, 1-Yes.
`stop_execution` - Stop the execution of DNS. If print set to 1, this also should set to 1. 0-No, 1-Yes.
dns_config:
This table contains default configuration.
`type` - The config type, i.e default_theme, default_local, default_time_zone, site_url...
`value` - The value set to the type, i.e default_theme=dns_default, site_url=dns.com...
dns_groups:
This table contains all dns groups.
`id` - Group ID
`name` - Group name
`admin_system` - Group members can administrate dns or not. 0-No, 1-Yes.
Note: Additional permissions can be added to this table after the `admin_system` column!
dns_members:
This table contains all dns members.
If you don't understand what this table does, reply.
dns_sessions:
This table contains all active sessions.
`session_id` - The session set by PHP.
`session_user_id` - The user id that 'own' this session. (If not logged, set to -1).
`session_start` - time() when the session started.
`session_end` - time() when the session will expired.
`session_user_ip` - The user ip.
`session_is_logged` - 0-Not logged, 1-Logged.
After a though week I eventually have time to work on DNS...
I can see that according to the gantt chart the DB design should be ready, so...
I have an initial design:
Code: Select all
CREATE DATABASE `dns`;
-- ----------------------------------------------------------------------------------
CREATE TABLE `dns_config` (
`type` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL default '-1',
PRIMARY KEY (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------------------
CREATE TABLE `dns_error` (
`error_id` int(10) NOT NULL default '0',
`error_level` varchar(2) NOT NULL default '',
`message` varchar(255) NOT NULL default '',
`log` tinyint(1) NOT NULL default '1',
`print` tinyint(1) NOT NULL default '0',
`stop_execution` tinyint(1) NOT NULL default '0',
KEY `error_id` (`error_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------------------
CREATE TABLE `dns_groups` (
`id` int(5) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`admin_system` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- ----------------------------------------------------------------------------------
CREATE TABLE `dns_members` (
`id` mediumint(8) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`real_name` varchar(255) NOT NULL,
`group` smallint(3) NOT NULL default '0',
`password` varchar(255) NOT NULL,
`secret_question` varchar(100) NOT NULL,
`secret_answer` varchar(100) NOT NULL,
`email` varchar(150) NOT NULL default '-1',
`joined` int(10) NOT NULL default '0',
`ip_address` varchar(16) NOT NULL,
`time_offset` tinyint(2) NOT NULL default '0',
`theme` varchar(255) NOT NULL default '-1',
`local` varchar(32) NOT NULL default '-1',
PRIMARY KEY (`id`),
KEY `name` (`name`),
KEY `mgroup` (`group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- ----------------------------------------------------------------------------------
CREATE TABLE `dns_sessions` (
`session_id` char(32) NOT NULL default '',
`session_user_id` mediumint(8) NOT NULL default '0',
`session_start` int(11) NOT NULL default '0',
`session_end` int(11) NOT NULL default '0',
`session_user_ip` char(15) NOT NULL default '0',
`session_is_logged` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`session_id`),
KEY `session_user_id` (`session_user_id`),
KEY `session_user_ip` (`session_user_ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
dns_error:
This table contains E,W and N level errors.
`error_id` - Error id, i.e 100 - module not found.
`error_level` - Error level, i.e Notice, Warning, Error... (like in PHP).
`message` - The reference to the message in the local file. This reference will be used to the local file of the log and the print.
`log` - Log the error. 0-No, 1-Yes.
`print` - Print the error to the screen. 0-No, 1-Yes.
`stop_execution` - Stop the execution of DNS. If print set to 1, this also should set to 1. 0-No, 1-Yes.
dns_config:
This table contains default configuration.
`type` - The config type, i.e default_theme, default_local, default_time_zone, site_url...
`value` - The value set to the type, i.e default_theme=dns_default, site_url=dns.com...
dns_groups:
This table contains all dns groups.
`id` - Group ID
`name` - Group name
`admin_system` - Group members can administrate dns or not. 0-No, 1-Yes.
Note: Additional permissions can be added to this table after the `admin_system` column!
dns_members:
This table contains all dns members.
If you don't understand what this table does, reply.
dns_sessions:
This table contains all active sessions.
`session_id` - The session set by PHP.
`session_user_id` - The user id that 'own' this session. (If not logged, set to -1).
`session_start` - time() when the session started.
`session_end` - time() when the session will expired.
`session_user_ip` - The user ip.
`session_is_logged` - 0-Not logged, 1-Logged.
