Xaraya / Postnuke CVS Notices - Message

Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites

View Statistics - Next Notice - Previous Notice

Directory filter : [ all ] / postnuke_official / html / modules / base [ view in CVS ]

Date Directory [filter] File(s) [view] Author [filter]
06 Aug 2002 15:47:35postnuke_official/html/modules/basepninit.php,1.8,1.9Paul Rosania
 decentralized table creation, split into relevant modules (somewhat)

Update of /home/cvsroot/postnuke_official/html/modules/base
In directory ns7.hostnuke.net:/tmp/cvs-serv15336/base

Modified Files:
	pninit.php 
Log Message:
decentralized table creation, split into relevant modules (somewhat)


Index: pninit.php
===================================================================
RCS file: /home/cvsroot/postnuke_official/html/modules/base/pninit.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pninit.php	4 Aug 2002 05:07:16 -0000	1.8
--- pninit.php	6 Aug 2002 15:47:33 -0000	1.9
***************
*** 374,619 ****
          return NULL;
      }
-     
-     // *_block_groups
-     $query = pnDBCreateTable($prefix . '_block_groups',
-                              array('pn_id'         => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '',
-                                                              'increment'   => true,
-                                                              'primary_key' => true),
-                                    'pn_name'        => array('type'        => 'varchar',
-                                                              'size'        => 255,
-                                                              'null'        => false,
-                                                              'default'     => ''),
-                                    'pn_template'    => array('type'        => 'varchar',
-                                                              'size'        => 255,
-                                                              'null'        => false,
-                                                              'default'     => '')));
-     $dbconn->Execute($query);
-         
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-     
-     $query = pnDBCreateIndex($prefix . '_block_groups',
-                              array('name'   => 'pn_name_index',
-                                    'fields' => array('pn_name'),
-                                    'unique' => 'true'));
-     $dbconn->Execute($query);
-     
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-     
-     // *_block_instances
-     $query = pnDBCreateTable($prefix . '_block_instances',
-                              array('pn_id'          => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '0',
-                                                              'increment'   => true,
-                                                              'primary_key' => true),
-                                    'pn_type_id'     => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '0'),
-                                    'pn_title'       => array('type'        => 'varchar',
-                                                              'size'        => 255,
-                                                              'null'        => true,
-                                                              'default'     => NULL),
-                                    'pn_content'     => array('type'        => 'text'),
-                                    'pn_template'    => array('type'        => 'varchar',
-                                                              'size'        => 255,
-                                                              'null'        => true,
-                                                              'default'     => NULL),
-                                    'pn_state'       => array('type'        => 'integer',
-                                                              'size'        => 'tiny',
-                                                              'null'        => false,
-                                                              'default'     => '2'),
-                                    'pn_refresh'     => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '0'),
-                                    'pn_last_update' => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '0')));
-     
-      $dbconn->Execute($query);
-         
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-                                                                                
-     // *_block_types
-     $query = pnDBCreateTable($prefix . '_block_types',
-                              array('pn_id'          => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '0',
-                                                              'increment'   => true,
-                                                              'primary_key' => true),
-                                    'pn_type'        => array('type'        => 'varchar',
-                                                              'size'        => 255,
-                                                              'null'        => false,
-                                                              'default'     => ''),
-                                    'pn_module'    => array('type'        => 'varchar',
-                                                              'size'        => 255,
-                                                              'null'        => false,
-                                                              'default'     => '')));
-     
-      $dbconn->Execute($query);
-         
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-     
-     $query = pnDBCreateIndex($prefix . '_block_types',
-                              array('name'   => 'pn_type_index',
-                                    'fields' => array('pn_type'),
-                                    'unique' => false));
-     $dbconn->Execute($query);
-     
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
  
-     $query = pnDBCreateIndex($prefix . '_block_types',
-                              array('name'   => 'pn_typemodule_index',
-                                    'fields' => array('pn_type(50)', 'pn_module(50)'),
-                                    'unique' => true));
-     $dbconn->Execute($query);
-     
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-     
-     // *_block_group_instances
-     $query = pnDBCreateTable($prefix . '_block_group_instances',
-                              array('pn_id'          => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '0',
-                                                              'increment'   => true,
-                                                              'primary_key' => true),
-                                    'pn_group_id'    => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '0'),
-                                    'pn_instance_id' => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '0'),
-                                    'pn_position'    => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '0')));
-     
-      $dbconn->Execute($query);
-         
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-     
-     // *_users
-     $query = pnDBCreateTable($prefix . '_users',
-                              array('pn_uid'         => array('type'        => 'integer',
-                                                              'null'        => false,
-                                                              'default'     => '0',
-                                                              'increment'   => true,
-                                                              'primary_key' => true),
-                                    'pn_name'        => array('type'        => 'varchar',
-                                                              'size'        => 60,
-                                                              'null'        => false,
-                                                              'default'     => ''),
-                                    'pn_uname'       => array('type'        => 'varchar',
-                                                              'size'        => 25,
-                                                              'null'        => false,
-                                                              'default'     => ''),
-                                    'pn_email'       => array('type'        => 'varchar',
-                                                              'size'        => 100,
-                                                              'null'        => false,
-                                                              'default'     => ''),
-                                    'pn_pass'        => array('type'        => 'varchar',
-                                                              'size'        => 40,
-                                                              'null'        => false,
-                                                              'default'     => ''),
-                                    'pn_url'         => array('type'        => 'varchar',
-                                                              'size'        => 100,
-                                                              'null'        => false,
-                                                              'default'     => ''),
-                                    'pn_auth_module' => array('type'        => 'varchar',
-                                                              'size'        => 64,
-                                                              'null'        => false,
-                                                              'default'     => '')));
-     $dbconn->Execute($query);
-         
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-     
-     $query = pnDBCreateIndex($prefix . '_users',
-                              array('name'   => 'pn_uname_index',
-                                    'fields' => array('pn_uid'),
-                                    'unique' => 'true'));
-     $dbconn->Execute($query);
-     
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-     
-     // *_user_data
-     $query = pnDBCreateTable($prefix . '_user_data',
-                              array('pn_uda_id'     => array('type'        => 'integer',
-                                                             'null'        => false,
-                                                             'default'     => '0',
-                                                             'increment'   => true,
-                                                             'primary_key' => true),
-                                    'pn_uda_propid' => array('type'        => 'integer',
-                                                             'null'        => false,
-                                                             'default'     => '0'),
-                                    'pn_uda_uid'    => array('type'        => 'integer',
-                                                             'null'        => false,
-                                                             'default'     => '0'),
-                                    'pn_uda_value'  => array('type'        => 'blob',
-                                                             'size'        => 'medium',
-                                                             'null'        => 'false')));
-     $dbconn->Execute($query);
-         
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-     
      // *_user_perms
      $query = pnDBCreateTable($prefix . '_user_perms',
--- 374,378 ----
***************
*** 656,703 ****
      }
      
-     // *_user_property
-     $query = pnDBCreateTable($prefix . '_user_property',
-                              array('pn_prop_id'         => array('type'        => 'integer',
-                                                                  'null'        => false,
-                                                                  'default'     => '0',
-                                                                  'increment'   => true,
-                                                                  'primary_key' => true),
-                                    'pn_prop_label'      => array('type'        => 'varchar',
-                                                                  'size'        => 255,
-                                                                  'null'        => false,
-                                                                  'default'     => ''),
-                                    'pn_prop_dtype'      => array('type'        => 'integer',
-                                                                  'null'        => false,
-                                                                  'default'     => NULL),
-                                    'pn_prop_default'    => array('type'        => 'varchar',
-                                                                  'size'        => 255,
-                                                                  'default'     => NULL),
-                                    'pn_prop_validation' => array('type'        => 'varchar',
-                                                                  'size'        => 255,
-                                                                  'default'     => NULL)));
-     $dbconn->Execute($query);
-         
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-     
-     $query = pnDBCreateIndex($prefix . '_user_property',
-                              array('name'   => 'pn_prop_label_index',
-                                    'fields' => array('pn_prop_label'),
-                                    'unique' => 'true'));
-     $dbconn->Execute($query);
-     
-     // Check for db errors
-     if ($dbconn->ErrorNo() != 0) {
-         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
-         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
-                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
-         return NULL;
-     }
-     
      // *_languages (?)
      
--- 415,418 ----
***************
*** 716,724 ****
      
      pnConfigSetVar('Default_Theme', 'SeaBreeze');
!     
!     // Install Base, Modules and Installer modules
      $query = "INSERT INTO {$prefix}_modules (pn_name, pn_type, pn_displayname, pn_description, pn_regid, pn_directory, pn_version, pn_admin_capable, pn_user_capable, pn_state) VALUES ('modules', 2, 'Modules', 'Module configuration', 1, 'modules', '2.02', 1, 0, 3);";
      $dbconn->Execute($query);
!     
      // Check for db errors
      if ($dbconn->ErrorNo() != 0) {
--- 431,439 ----
      
      pnConfigSetVar('Default_Theme', 'SeaBreeze');
! 
!     // Install Modules module
      $query = "INSERT INTO {$prefix}_modules (pn_name, pn_type, pn_displayname, pn_description, pn_regid, pn_directory, pn_version, pn_admin_capable, pn_user_capable, pn_state) VALUES ('modules', 2, 'Modules', 'Module configuration', 1, 'modules', '2.02', 1, 0, 3);";
      $dbconn->Execute($query);
! 
      // Check for db errors
      if ($dbconn->ErrorNo() != 0) {
***************
*** 728,763 ****
          return NULL;
      }
      
!     $query = "INSERT INTO {$prefix}_modules (pn_name, pn_type, pn_displayname, pn_description, pn_regid, pn_directory, pn_version, pn_admin_capable, pn_user_capable, pn_state) VALUES ('installer', 2, 'Installer', 'PostNuke Installer', 222, 'installer', '1.0', 1, 0, 3);";
!     $dbconn->Execute($query);
      
!     // Check for db errors
!     if ($dbconn->ErrorNo() != 0) {
!         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
!         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
!                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
!         return NULL;
      }
      
!     $query = "INSERT INTO {$prefix}_modules (pn_name, pn_type, pn_displayname, pn_description, pn_regid, pn_directory, pn_version, pn_admin_capable, pn_user_capable, pn_state) VALUES ('base', 2, 'base', 'Base Module', 68, 'base', '0.1', 1, 1, 3);";
!     $dbconn->Execute($query);
      
!     // Check for db errors
!     if ($dbconn->ErrorNo() != 0) {
!         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
!         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
!                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
!         return NULL;
      }
      
!     $query = "INSERT INTO {$prefix}_modules (pn_name, pn_type, pn_displayname, pn_description, pn_regid, pn_directory, pn_version, pn_admin_capable, pn_user_capable, pn_state) VALUES ('authsystem', 2, 'AuthSystem', 'PostNuke default authentication module', 42, 'authsystem', '0.91', 1, 0, 3);";
!     $dbconn->Execute($query);
      
!     // Check for db errors
!     if ($dbconn->ErrorNo() != 0) {
!         $msg = pnMLByKey('DATABASE_ERROR', $dbconn->ErrorMsg(), $query);
!         pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
!                        new SystemException(__FILE__.'('.__LINE__.'): '.$msg));
!         return NULL;
      }
      
--- 443,502 ----
          return NULL;
      }
+ 
+     include 'includes/pnMod.php';
+     include 'includes/pnBlocks.php';
      
!     // coverups for missing funcs at this point (hack!)
!     define ('ACCESS_ADMIN', 1);
!     define ('ACCESS_EDIT', 2);
!     function pnSecAuthAction() {return true;}
!     function pnUserGetLang() {return 'eng';}
      
!     // load modules admin API
!     $res = pnModAPILoad('modules', 'admin');
!     if (!isset($res) && pnExceptionMajor() != PN_NO_EXCEPTION) {
!         return;
      }
      
!     // load modules into *_modules table
!     $res = pnModAPIFunc('modules', 'admin', 'regenerate');
!     if (!isset($res) && pnExceptionMajor() != PN_NO_EXCEPTION) {
!         return;
!     }
      
!     // initialize blocks module
!     $res = pnModAPIFunc('modules', 'admin', 'initialise', array('regid' => pnModGetIDFromName('blocks')));
!     if (!isset($res) && pnExceptionMajor() != PN_NO_EXCEPTION) {
!         return;
      }
      
!     $res = pnModAPIFunc('modules', 'admin', 'setstate', array('regid' => pnModGetIDFromName('blocks'),
!                                                               'state' => _PNMODULE_STATE_ACTIVE));
!     if (!isset($res) && pnExceptionMajor() != PN_NO_EXCEPTION) {
!         return;
!     }
      
!     // initialize users module
!     $res = pnModAPIFunc('modules', 'admin', 'initialise', array('regid' => pnModGetIDFromName('users')));
!     if (!isset($res) && pnExceptionMajor() != PN_NO_EXCEPTION) {
!         return;
!     }
!     
!     $res = pnModAPIFunc('modules', 'admin', 'setstate', array('regid' => pnModGetIDFromName('blocks'),
!                                                               'state' => _PNMODULE_STATE_ACTIVE));
!     if (!isset($res) && pnExceptionMajor() != PN_NO_EXCEPTION) {
!         return;
!     }
!     
!     // initialize installer module
!     $res = pnModAPIFunc('modules', 'admin', 'initialise', array('regid' => pnModGetIDFromName('installer')));
!     if (!isset($res) && pnExceptionMajor() != PN_NO_EXCEPTION) {
!         return;
!     }
!     
!     $res = pnModAPIFunc('modules', 'admin', 'setstate', array('regid' => pnModGetIDFromName('blocks'),
!                                                               'state' => _PNMODULE_STATE_ACTIVE));
!     if (!isset($res) && pnExceptionMajor() != PN_NO_EXCEPTION) {
!         return;
      }
      
***************
*** 937,940 ****
--- 676,689 ----
      }
      
+     // Register Block types
+     pnBlockTypeRegister('base', 'finclude');
+     pnBlockTypeRegister('base', 'html');
+     pnBlockTypeRegister('base', 'menu');
+     pnBlockTypeRegister('base', 'php');
+     pnBlockTypeRegister('base', 'text');
+     $res = pnBlockTypeRegister('base', 'thelang'); // FIXME <paul> should this be here???
+     if (!isset($res) && pnExceptionMajor() != PN_NO_EXCEPTION) {
+         return;
+     }
      
      // Register BL tags
***************
*** 989,992 ****
--- 738,743 ----
                       array(new pnTemplateAttribute('name', PN_TPL_STRING|PN_TPL_OPTIONAL)),
                       'base_userapi_handleMlstringTag');
+                      
+     
      
      // Initialisation successful


Directory filter : [ all ] / postnuke_official / html / modules / base [ view in CVS ]

View Statistics - Next Notice - Previous Notice


Visit Developer Site - Browse CVS Repository Syndicate via backend.rss
(max. once per hour please)
Powered by CVSNotice 0.1.3