<?php
/**
* @version $Id: main.migrator.php 2006-05-25 23:00
* @package Migrator
* @copyright Copyright (C) 2006 by Mambobaer.de. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_VALID_MOS') or die('Restricted access');
$max_php_run = ini_get("max_execution_time");
if ($max_php_run <> 0){
$run_time = intval($max_php_run/2);
}else{
$run_time = 15;
}
// $run_time = 15;
$autoinc = 1;
$drop = 1;
$exists = 1;
$sql_compat = "MYSQL40";
$gzip = 1;
$full_inserts = 1;
$delaypersession = 5;
$backup_path = "/administrator/components/com_migrator/dumps/";
DEFINE('_MIG_DATE_FORMAT_LC2', "%d.%m.%Y %H:%M");
/*$core_tables = array ($mosConfig_dbprefix."banner",
$mosConfig_dbprefix."bannerclient",
$mosConfig_dbprefix."bannerfinish",
$mosConfig_dbprefix."categories",
$mosConfig_dbprefix."contact_details",
$mosConfig_dbprefix."content",
$mosConfig_dbprefix."content_frontpage",
$mosConfig_dbprefix."content_rating",
$mosConfig_dbprefix."core_acl_aro",
$mosConfig_dbprefix."core_acl_groups_aro_map",
$mosConfig_dbprefix."core_log_items",
$mosConfig_dbprefix."core_log_searches",
$mosConfig_dbprefix."menu",
$mosConfig_dbprefix."messages",
$mosConfig_dbprefix."messages_cfg",
$mosConfig_dbprefix."modules",
$mosConfig_dbprefix."newsfeeds",
$mosConfig_dbprefix."poll_data",
$mosConfig_dbprefix."poll_date",
$mosConfig_dbprefix."poll_menu",
$mosConfig_dbprefix."polls",
$mosConfig_dbprefix."sections",
$mosConfig_dbprefix."users",
$mosConfig_dbprefix."weblinks"
);
$exclude_tables = array ($mosConfig_dbprefix."components",
$mosConfig_dbprefix."core_acl_aro_groups",
$mosConfig_dbprefix."core_acl_aro_sections",
$mosConfig_dbprefix."groups",
$mosConfig_dbprefix."mambots",
$mosConfig_dbprefix."modules_menu",
$mosConfig_dbprefix."session",
$mosConfig_dbprefix."stats_agents",
$mosConfig_dbprefix."template_positions",
$mosConfig_dbprefix."templates_menu",
$mosConfig_dbprefix."usertypes",
$mosConfig_dbprefix."weblinks"
);
*/
function mosGetMySQLVersionShort(){
if (!function_exists("mysql_get_server_info")){
$mysql_s=PMBP_I_NO_RES;
}else{
$mysql_s=@mysql_get_server_info();
}
$mysql_s = substr(str_replace(".", "", $mysql_s)."00000", 0, 5);
return $mysql_s;
}
function mosGetSizes($size) {
if ($size<1024)
$size=number_format(Round($size,3), 0, ',', '.')." B";
elseif ($size < 1048576)
$size=number_format(Round($size/1024,3), 2, ',', '.')." KB";
elseif ($size < 1073741824)
$size=number_format(Round($size/1048576,3), 2, ',', '.')." MB";
elseif (1073741824 < $size)
$size=number_format(Round($size/1073741824,3), 2, ',', '.')." GB";
elseif (1099511627776 < $size)
$size=number_format(Round($size/1099511627776,3), 2, ',', '.')." TB";
return $size;
}
function readBackupDir($dirname, $sort = false){
$data_path = "";
$filelist = array();
if(is_dir($dirname)){
if ($dirhandle = opendir($dirname)){
while (false !== ($dirfile = readdir($dirhandle))){
if ($dirfile != "." && $dirfile != ".."){
$path_parts = pathinfo($data_path."/".$dirfile);
$file_ext = strtolower($path_parts["extension"]);
if (($file_ext == "sql") || ($file_ext == "html") || ($file_ext == "gz") || ($file_ext == "dat")) $filelist[] = $dirfile;
}
}
if ((count($filelist) > 0) && ($sort)) rsort($filelist);
return $filelist;
}
}else{
mkdir($dirname, 0777);
}
}
function makeHeaderTableDef($item, $bkp_time, &$SQLDump, $tab_count, $dump_type, $tab_struct){
global $autoinc, $drop, $exists, $sql_compat, $gzip, $full_inserts, $mig_version;
$crlf = "\r\n";
$header = "";
if ($drop) $xdrop = "x";
if ($exists) $xexists = "x";
if ($autoinc) $xautoinc = "x";
$header.= "# ===============================================================$crlf";
$header.= "# $crlf";
$header.= "# "._BBKP_HEAD_1."$crlf";
$header.= "# Version: ".$mig_version."$crlf";
$header.= "# http://www.mambobaer.de$crlf";
$header.= "# "._BBKP_HEAD_4."$crlf";
$header.= "# $crlf";
$header.= "# "._BBKP_HEAD_2." : $item $crlf";
$header.= "# "._BBKP_HEAD_3." : ".strftime(_DATE_FORMAT_LC3, $bkp_time)."$crlf";
$header.= "# "._BBKP_HEAD_7." : $tab_count $crlf";
$header.= "# "._BBKP_HEAD_9." : $dump_type $crlf";
$header.= "# $crlf";
$header.= "# "._BBKP_ENVIRONMENT."$crlf";
$header.= "# "._BBKP_SQL_SERVER." : ".@mysql_get_server_info()."$crlf";
$header.= "# "._BBKP_SQL_CLIENT." : ".@mysql_get_client_info()."$crlf";
$header.= "# "._BBKP_PHP_VERSION." : ".phpversion()."$crlf";
$header.= "# $crlf";
$header.= "# "._BBKP_SETTINGS."$crlf";
$header.= "# "._BBKP_DROP.": [".$xdrop."]$crlf";
$header.= "# "._BBKP_EXISTS.": [".$xexists."]$crlf";
$header.= "# "._BBKP_DB_AUTO_INC.": [".$xautoinc."]$crlf";
$header.= "# "._BBKP_DB_STRUCT.": [".$tab_struct."]$crlf";
$header.= "# "._BBKP_DB_COMP.": ".$sql_compat."$crlf";
$header.= "# $crlf";
$header.= "# ===============================================================$crlf$crlf";
$SQLDump->writeFile($header);
}
function makeTableDef($base, $table, &$SQLDump){
global $database, $autoinc, $drop, $exists, $sql_compat;
$crlf="\r\n";
$create = "";
if ((mosGetMySQLVersionShort() >= 40100) && ($sql_compat != 'NONE')) {
$database->setQuery('SET @@SESSION.SQL_MODE="'.$sql_compat.'"');
$database->Query();
}
$result = $database->setQuery("SHOW CREATE TABLE `".$table."`");
$rows = $database->loadrow();
$create_query = $rows[1];
if (strpos($create_query, "(\r\n ")) {
$create_query = str_replace("\r\n", $crlf, $create_query);
}elseif (strpos($create_query, "(\n ")) {
$create_query = str_replace("\n", $crlf, $create_query);
}elseif (strpos($create_query, "(\r ")) {
$create_query = str_replace("\r", $crlf, $create_query);
}
if ($drop != "") {
$create = "DROP TABLE IF EXISTS `".$table."`;".$crlf;
}else{
$create = "";
}
if (!strpos($create_query, "CREATE TABLE")){
if ($exists != "") {
$create.= str_replace("CREATE TABLE", "CREATE TABLE IF NOT EXISTS", $create_query);
}else{
$create.= $create_query;
}
没有合适的资源?快使用搜索试试~ 我知道了~
Joomla 1.0 升级到 Joomla 1.5 用的组件
需积分: 10 7 下载量 130 浏览量
2009-08-29
12:05:51
上传
评论
收藏 38KB TGZ 举报
温馨提示
共60个文件
php:41个
htm:9个
html:5个
Joomla 1.0 升级到 Joomla 1.5 用的组件 [migrator] 描述 默认joomla 35个表, 如果你装其他com.....则需要这个组件对应的插件! 在joomla 1.0里安装,生成sql 然后下载.... 在你安装 joomla 1.5的时候, 在安装示例的地方选择你下载来的这个sql 就可以了,记得 表前缀, 默认是 jos_ 哦...
资源推荐
资源详情
资源评论
收起资源包目录
migrator_rc3.tgz (60个子文件)
legacy
legacy.php 9KB
toolbar.migrator.html.php 2KB
index.htm 0B
admin.migrator.html.php 9KB
toolbar.migrator.php 994B
main.migrator.php 33KB
class.migrator.php 5KB
migrator.info.html 3KB
resources
add.english.html 827B
3pd.english.html 884B
done.english.html 427B
index.htm 0B
default.english.html 2KB
tests
enumerator_test.php 786B
plugin_test.php 930B
tasklist_test.php 685B
index.htm 0B
taskbuilder_test.php 962B
language
english.php 6KB
index.htm 0B
tables
000migrator.sql 140B
index.htm 0B
migrator.xml 4KB
migrator.class.php 11KB
images
info_f2.png 2KB
info.png 2KB
logo.png 9KB
index.htm 0B
plugins
messages.php 709B
newsfeeds.php 960B
poll_date.php 717B
configuration.php 3KB
templates_menu.php 773B
bannerclient.php 709B
content.php 10KB
core_acl_aro.php 922B
modules_menu.php 743B
core_acl_groups_aro_map.php 801B
categories.php 1KB
content_frontpage.php 765B
core_log_items.php 747B
messages_cfg.php 765B
users.php 837B
content_rating.php 747B
contact_details.php 1KB
backlink_migration.php 4KB
sections.php 954B
poll_data.php 717B
poll_menu.php 717B
menu.php 4KB
modules.php 721B
index.htm 0B
banner.php 1KB
core_log_searches.php 765B
weblinks.php 954B
polls.php 936B
index.htm 0B
admin.migrator.html.php 1KB
admin.migrator.php 8KB
dumps
index.htm 0B
共 60 条
- 1
资源评论
wowbatman
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 自动驾驶-状态估计和定位之Error State EKF.pdf
- STM32F103ZET6+北斗
- 程序流程图的说明及图形示例
- FDN5618P-NL-VB一款SOT23封装P-Channel场效应MOS管
- Go语言基础(变量和基本类型).zip
- 基于CYCLONE2 (EP2C8Q) FPGA 设计PLL锁相环设置时钟Verilog源码Quartus工程文件.zip
- FDN372S-NL-VB一款SOT23封装N-Channel场效应MOS管
- date0425111111111111111111111
- 包含贪心算法的定义及python代码部分实现
- 自动驾驶-状态估计和定位之扩展卡尔曼滤波.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功