/** * Yükleme işlemini gerçekleştirir * * @return FileCapsule|bool */ public function upload() { $upload = parent::upload(); if ($upload) { $upload = ['filepath' => $upload, 'name' => $this->getNewName(), 'target' => $this->getTarget(), 'ext' => $this->getExt(), 'size' => $this->getFile()['size']]; return new FileCapsule($upload); } else { return false; } }
/** * Sınıfı başlatır ve ftp ile bağlantı kurar * * @param array $connection * @param array $file * @param string $target */ public function __construct(array $connection = [], $file = [], $target = 'upload') { parent::__construct($file, $target); $this->connection = new FtpConnection($connection); $this->connection->connect(); }