Classes added for Backup, FTP, File and URL, System updated

This commit is contained in:
mattpass
2020-05-10 15:44:18 +01:00
parent d0b093d7d5
commit f7962e5dc6
5 changed files with 964 additions and 0 deletions

36
classes/URL.php Normal file
View File

@@ -0,0 +1,36 @@
<?php declare(strict_types=1);
namespace ICEcoder;
class URL
{
private $remoteFile;
/**
* URL constructor.
* @param $remoteFile
*/
public function __construct($remoteFile)
{
$this->remoteFile = $remoteFile;
}
/**
* @param string $doNext
* @param $lineEnding
* @param $lineNumber
* @return string
*/
public function load($doNext = "", $lineEnding = "\n", $lineNumber = 1): string
{
// replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
$this->remoteFile = str_replace("\r\n", $lineEnding, $this->remoteFile);
$this->remoteFile = str_replace("\r", $lineEnding, $this->remoteFile);
$this->remoteFile = str_replace("\n", $lineEnding, $this->remoteFile);
$doNext .= 'ICEcoder.newTab();';
$doNext .= 'ICEcoder.getcMInstance().setValue(\'' . str_replace("\r", "", str_replace("\t", "\\\\t", str_replace("\n", "\\\\n", str_replace("'", "\\\\'", str_replace("\\", "\\\\", preg_quote($this->remoteFile)))))) . '\');';
$doNext .= 'ICEcoder.goToLine(' . $lineNumber . ');';
return $doNext;
}
}