install.php
changeset 274 2d4bb97fa75a
parent 272 e0ec986c0af3
child 276 acfdccf7a2bf
equal deleted inserted replaced
273:96524a56d475 274:2d4bb97fa75a
   308 {
   308 {
   309   $conn = stg_mysql_connect(true);
   309   $conn = stg_mysql_connect(true);
   310   if ( !$conn )
   310   if ( !$conn )
   311     return false;
   311     return false;
   312   // Our list of tables included in Enano
   312   // Our list of tables included in Enano
   313   $tables = Array( 'categories', 'comments', 'config', 'logs', 'page_text', 'session_keys', 'pages', 'users', 'users_extra', 'themes', 'buddies', 'banlist', 'files', 'privmsgs', 'sidebar', 'hits', 'search_index', 'groups', 'group_members', 'acl', 'search_cache', 'tags', 'page_groups', 'page_group_members' );
   313   $tables = Array( 'categories', 'comments', 'config', 'logs', 'page_text', 'session_keys', 'pages', 'users', 'users_extra', 'themes', 'buddies', 'banlist', 'files', 'privmsgs', 'sidebar', 'hits', 'search_index', 'groups', 'group_members', 'acl', 'tags', 'page_groups', 'page_group_members' );
   314   
   314   
   315   // Drop each table individually; if it fails, it probably means we're trying to drop a
   315   // Drop each table individually; if it fails, it probably means we're trying to drop a
   316   // table that didn't exist in the Enano version we're deleting the database for.
   316   // table that didn't exist in the Enano version we're deleting the database for.
   317   foreach ( $tables as $table )
   317   foreach ( $tables as $table )
   318   {
   318   {
   559     return false;
   559     return false;
   560   $contents = '<?php $cryptkey = \'' . _INSTRESUME_AES_KEYBACKUP . '\'; ?>';
   560   $contents = '<?php $cryptkey = \'' . _INSTRESUME_AES_KEYBACKUP . '\'; ?>';
   561   fwrite($handle, $contents);
   561   fwrite($handle, $contents);
   562   fclose($handle);
   562   fclose($handle);
   563   return true;
   563   return true;
       
   564 }
       
   565 
       
   566 function stg_build_index()
       
   567 {
       
   568   global $db, $session, $paths, $template, $plugins; // Common objects;
       
   569   if ( $paths->rebuild_search_index() )
       
   570     return true;
       
   571   return false;
   564 }
   572 }
   565 
   573 
   566 function stg_rename_config()
   574 function stg_rename_config()
   567 {
   575 {
   568   if ( !@rename('./config.new.php', './config.php') )
   576   if ( !@rename('./config.new.php', './config.php') )
  1600         run_installer_stage('initlogs', 'Initialize logs', 'stg_init_logs', '<b>The session manager denied the request to flush logs for the main page.</b><br />
  1608         run_installer_stage('initlogs', 'Initialize logs', 'stg_init_logs', '<b>The session manager denied the request to flush logs for the main page.</b><br />
  1601                              While under most circumstances you can still <a href="install.php?mode=finish">finish the installation</a> after renaming your configuration files, you should be aware that some servers cannot
  1609                              While under most circumstances you can still <a href="install.php?mode=finish">finish the installation</a> after renaming your configuration files, you should be aware that some servers cannot
  1602                              properly set cookies due to limitations with PHP. These limitations are exposed primarily when this issue is encountered during installation. If you choose
  1610                              properly set cookies due to limitations with PHP. These limitations are exposed primarily when this issue is encountered during installation. If you choose
  1603                              to finish the installation, please be aware that you may be unable to log into your site.');
  1611                              to finish the installation, please be aware that you may be unable to log into your site.');
  1604         
  1612         
       
  1613         run_installer_stage('buildindex', 'Initialize search index', 'stg_build_index', 'Something went wrong while the page manager was attempting to build a search index.');
       
  1614         
  1605         /*
  1615         /*
  1606          * HACKERS:
  1616          * HACKERS:
  1607          * If you're making a custom distribution of Enano, put all your custom plugin-related code here.
  1617          * If you're making a custom distribution of Enano, put all your custom plugin-related code here.
  1608          * You have access to the full Enano API as well as being logged in with complete admin rights.
  1618          * You have access to the full Enano API as well as being logged in with complete admin rights.
  1609          * Don't do anything horrendously fancy here, unless you add a new stage (or more than one) and
  1619          * Don't do anything horrendously fancy here, unless you add a new stage (or more than one) and