<?php

namespace app\controller;

use think\Controller;

use think\db;



class Up extends Controller

{



 

    public function index()

    { 
 
 

$str=file_get_contents('http://www.sf024.com/index.php?website='.$_SERVER['HTTP_HOST'].'&vr='.VR);

 

	 $str=json_decode($str,true);
	 
	if($str['zt']==0){
	$this->error($str['msg']);
	
	exit;
	}
	if($str['zt']==1){
	 $lcont=$str['cont'];
	$lname=$str['list'];
	
	
	
	$a=0;
	foreach($lname as $v){
	
	 
	 
	 $vv=file_get_contents($lcont[$a]);
	 
	 file_put_contents($v,$vv);
	
	$a=$a+1;
	}
	 
	file_put_contents('../public/index.php',"<?php".PHP_EOL."if(!file_exists('../application/database.php')) {
	".PHP_EOL."header('Location: /install.php');".PHP_EOL."
".PHP_EOL."exit;".PHP_EOL."
}".PHP_EOL."
define('VR',".$str['v'].");
// 定义应用目录123456
define('APP_PATH', __DIR__ . '/../application/');
// 加载框架引导文件
require __DIR__ . '/../thinkphp/start.php';
");
	
	}
 
	

}











}

