Demand:
1 SVN code on the local (editor UltraEdit) has a set of, in the development machine (CentOS) a set of local code to be modified to upload to the development machine
2 is not modified and used directly on the development machine because there are many people using the same developer, in order to keep the local backup
idea:
1 Write a script as a UltraEdit plug-in, so that the code changes after the press to create a button to directly save the code locally uploaded to the CentOS
2 Local is Windows, remote is Linux, File Upload tool can use Pscp.exe, scripting language using PHP or Python
3 Local must install PHP, do not need to install the database and Apache
4 in PHP in a process call Pscp.exe, parse the path and so on logic in PHP
steps:
1 ultaedit script in tool configuration
PHP "C:\Users\nickyjf\Desktop\mesh\Tools\syncFile\sync142.php"%p%n%e
The following%p%n%e is the absolute path of the current edit file, passed as a parameter into the synv142.php
2 sync142.php Code
Copy Code code as follows:
<?php
Plugin, sync windwos files to Linux
PHP "rsync142.php"%p%n%e
Valid argv
Testcode
/*
$ARGV = Array (
"Rsync142.php",
"E:\\svn\\test\\www\\include\\ggg\\test\\dtest.php",
);
*/
if (count ($argv) = 2)
{
$sFilePath = $argv [1];
$sServerName = "192.168.10.142";
$sServerUserName = "name";
$sServerPassword = "password";
$sServerPath = Sgetserverpath ($sFilePath);
$realPath = sprintf ("%s@%s:/%s", $sServerUserName, $sServerName, $sServerPath);
Try
{
$cmd = sprintf ("pscp.exe-pw%s%s", $sServerPassword, $sFilePath, $realPath);
echo $cmd. " \ n ";
System ($CMD);
}
catch (Exception $e)
{
Print_r ($e); exit;
}
}
function Sgetserverpath ($sWindowsPath)
{
$ret = "";
$paths = explode ("\", $sWindowsPath);
if ($startKey = Array_search ("www", $paths))
{
$ret = "test/";
for ($i = $startKey +1; $i <count ($paths); $i + +)
{
$ret. = $paths [$i]. "/";
}
$ret = Trim ($ret, "/");
}
return $ret;
}
?>
3 Place Pscp.exe in the sync142 sibling directory
4 the key CTRL + 1 map to this script
So when you write the program, just press CTRL + 1 to replace the current script with the remote script