61 lines
1.6 KiB
PHP
61 lines
1.6 KiB
PHP
<?php
|
|
//sdf fff
|
|
error_reporting(E_ALL);
|
|
ini_set("display_errors", 1);
|
|
require_once('superadm/php/inc_functions.php');
|
|
echo("sl");
|
|
global $db, $blnDev, $vDomaine;
|
|
echo($arrConFTP['host']);
|
|
echo("<br>");
|
|
echo($arrConFTP['path_preprod'] );
|
|
echo("<br>");
|
|
echo( $arrConFTP['path_prod']);
|
|
echo("<br>");
|
|
|
|
if(1==2){
|
|
/* Connect using basic FTP */
|
|
$ftpConnection = ftp_connect($arrConFTP['host']);
|
|
/* Login to FTP */
|
|
$login_result = ftp_login($ftpConnection, $arrConFTP['user'], $arrConFTP['pass']);
|
|
ftp_pasv($ftpConnection, true);
|
|
// $arrRetour2[] = fxUploadFolder($arrConFTP['path_preprod'] . '/css', $arrConFTP['path_prod'] . '/css', $ftpConnection);
|
|
$arrRetour = fxUploadFolder($arrConFTP['path_preprod'] . '/sl', $arrConFTP['path_preprod'] . '/sl2', $ftpConnection);
|
|
print_r($arrRetour);
|
|
}else{
|
|
|
|
$file = '/domains/ms1inscriptiondev.interne.ca/public_html/t.php';
|
|
$remote_file = '/domains/ms1inscriptiondev.interne.ca/public_html/t2.php';
|
|
|
|
|
|
|
|
// login with username and password
|
|
|
|
|
|
|
|
|
|
|
|
// connect and login to FTP server
|
|
$ftp_server = "127.0.0.1";
|
|
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
|
|
print_r( error_get_last() );
|
|
$login = ftp_login($ftp_conn, "ms1inscription", "ms1911");
|
|
print_r( error_get_last() );
|
|
$local_file = 't2.php';
|
|
$server_file = 'u.php';
|
|
|
|
// download server file
|
|
if (ftp_get($ftp_conn, $local_file, $server_file, FTP_ASCII))
|
|
{
|
|
echo "Successfully written to $local_file.";
|
|
}
|
|
else
|
|
{
|
|
echo "Error downloading $server_file.";
|
|
}
|
|
print_r( error_get_last() );
|
|
// close connection
|
|
ftp_close($ftp_conn);
|
|
|
|
|
|
|
|
} |