示例#1
0
 /**
  * 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;
     }
 }
示例#2
0
 /**
  * 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();
 }