feature:65 fix fatal error at the end of the install process, remove unused file and function

git-svn-id: http://piwigo.org/svn/trunk@20721 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100
2013-02-12 11:37:34 +00:00
parent e8bdcecfeb
commit 9722255086
3 changed files with 4 additions and 98 deletions
-55
View File
@@ -68,61 +68,6 @@ function execute_sqlfile($filepath, $replaced, $replacing, $dblayer)
}
}
/**
* Search for database engines available
*
* We search for functions_DATABASE_ENGINE.inc.php
* and we check if the connect function for that database exists
*
* @return array
*/
function available_engines()
{
$engines = array();
$pattern = PHPWG_ROOT_PATH. 'include/dblayer/functions_%s.inc.php';
include_once PHPWG_ROOT_PATH. 'include/dblayer/dblayers.inc.php';
foreach ($dblayers as $engine_name => $engine)
{
if (file_exists(sprintf($pattern, $engine_name)))
{
$engines[$engine_name]['label'] = $engine['engine'];
$engines[$engine_name]['available'] = false;
if (isset($engine['function_available'])
&& function_exists($engine['function_available']))
{
$engines[$engine_name]['available'] = true;
}
elseif (isset($engine['class_available'])
&& class_exists($engine['class_available']))
{
$engines[$engine_name]['available'] = true;
}
}
}
if ($engines['sqlite']['available'] and !$engines['pdo-sqlite']['available'])
{
unset($engines['pdo-sqlite']);
}
elseif ($engines['pdo-sqlite']['available'] and !$engines['sqlite']['available'])
{
unset($engines['sqlite']);
}
elseif (DEFAULT_DB_SQLITE=='native')
{
unset($engines['pdo-sqlite']);
}
else
{
unset($engines['sqlite']);
}
return $engines;
}
/**
* Automatically activate all core themes in the "themes" directory.
*
-41
View File
@@ -1,41 +0,0 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2013 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
$dblayers = array();
$dblayers['mysql'] = array('engine' => 'MySQL',
'function_available' => 'mysql_connect'
);
$dblayers['pgsql'] = array('engine' => 'PostgreSQL',
'function_available' => 'pg_connect'
);
$dblayers['sqlite'] = array('engine' => 'SQLite',
'class_available' => 'SQLite3'
);
$dblayers['pdo-sqlite'] = array('engine' => 'SQLite',
'class_available' => 'PDO'
);
?>
+4 -2
View File
@@ -311,14 +311,14 @@ define(\'DB_COLLATE\', \'\');
PHPWG_ROOT_PATH.'install/piwigo_structure-mysql.sql',
DEFAULT_PREFIX_TABLE,
$prefixeTable,
$dblayer
'mysql'
);
// We fill the tables with basic informations
execute_sqlfile(
PHPWG_ROOT_PATH.'install/config.sql',
DEFAULT_PREFIX_TABLE,
$prefixeTable,
$dblayer
'mysql'
);
$query = '
@@ -467,6 +467,8 @@ else
}
session_name($conf['session_name']);
session_set_cookie_params(0, cookie_path());
register_shutdown_function('session_write_close');
$user = build_user(1, true);
log_user($user['id'], false);