ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
League\Flysystem\Adapter\AbstractFtpAdapter Class Reference
+ Inheritance diagram for League\Flysystem\Adapter\AbstractFtpAdapter:
+ Collaboration diagram for League\Flysystem\Adapter\AbstractFtpAdapter:

Public Member Functions

 __construct (array $config)
 Constructor. More...
 
 setConfig (array $config)
 Set the config. More...
 
 getHost ()
 Returns the host. More...
 
 setHost ($host)
 Set the host. More...
 
 setPermPublic ($permPublic)
 Set the public permission value. More...
 
 setPermPrivate ($permPrivate)
 Set the private permission value. More...
 
 getPort ()
 Returns the ftp port. More...
 
 getRoot ()
 Returns the root folder to work from. More...
 
 setPort ($port)
 Set the ftp port. More...
 
 setRoot ($root)
 Set the root folder to work from. More...
 
 getUsername ()
 Returns the ftp username. More...
 
 setUsername ($username)
 Set ftp username. More...
 
 getPassword ()
 Returns the password. More...
 
 setPassword ($password)
 Set the ftp password. More...
 
 getTimeout ()
 Returns the amount of seconds before the connection will timeout. More...
 
 setTimeout ($timeout)
 Set the amount of seconds before the connection should timeout. More...
 
 getSystemType ()
 Return the FTP system type. More...
 
 setSystemType ($systemType)
 Set the FTP system type (windows or unix). More...
 
 listContents ($directory='', $recursive=false)
 List contents of a directory.
Parameters
string$directory
bool$recursive
Returns
array
More...
 
 removeDotDirectories (array $list)
 Filter out dot-directories. More...
 
 has ($path)
 Check whether a file exists.
Parameters
string$path
Returns
array|bool|null
More...
 
 getSize ($path)
 Get the size of a file.
Parameters
string$path
Returns
array|false
More...
 
 getVisibility ($path)
 Get the visibility of a file.
Parameters
string$path
Returns
array|false
More...
 
 ensureDirectory ($dirname)
 Ensure a directory exists. More...
 
 getConnection ()
 
 getPermPublic ()
 Get the public permission value. More...
 
 getPermPrivate ()
 Get the private permission value. More...
 
 __destruct ()
 Disconnect on destruction. More...
 
 connect ()
 Establish a connection. More...
 
 disconnect ()
 Close the connection. More...
 
 isConnected ()
 Check if a connection is active. More...
 
- Public Member Functions inherited from League\Flysystem\Adapter\AbstractAdapter
 setPathPrefix ($prefix)
 Set the path prefix. More...
 
 getPathPrefix ()
 Get the path prefix. More...
 
 applyPathPrefix ($path)
 Prefix a path. More...
 
 removePathPrefix ($path)
 Remove a path prefix. More...
 
- Public Member Functions inherited from League\Flysystem\AdapterInterface
 write ($path, $contents, Config $config)
 Write a new file. More...
 
 writeStream ($path, $resource, Config $config)
 Write a new file using a stream. More...
 
 update ($path, $contents, Config $config)
 Update a file. More...
 
 updateStream ($path, $resource, Config $config)
 Update a file using a stream. More...
 
 rename ($path, $newpath)
 Rename a file. More...
 
 copy ($path, $newpath)
 Copy a file. More...
 
 delete ($path)
 Delete a file. More...
 
 deleteDir ($dirname)
 Delete a directory. More...
 
 createDir ($dirname, Config $config)
 Create a directory. More...
 
 setVisibility ($path, $visibility)
 Set the visibility for a file. More...
 
- Public Member Functions inherited from League\Flysystem\ReadInterface
 has ($path)
 Check whether a file exists. More...
 
 read ($path)
 Read a file. More...
 
 readStream ($path)
 Read a file as a stream. More...
 
 listContents ($directory='', $recursive=false)
 List contents of a directory. More...
 
 getMetadata ($path)
 Get all the meta data of a file or directory. More...
 
 getSize ($path)
 Get the size of a file. More...
 
 getMimetype ($path)
 Get the mimetype of a file. More...
 
 getTimestamp ($path)
 Get the timestamp of a file. More...
 
 getVisibility ($path)
 Get the visibility of a file. More...
 

Protected Member Functions

 listDirectoryContents ($directory, $recursive=false)
 
 normalizeListing (array $listing, $prefix='')
 Normalize a directory listing. More...
 
 sortListing (array $result)
 Sort a directory listing. More...
 
 normalizeObject ($item, $base)
 Normalize a file entry. More...
 
 normalizeUnixObject ($item, $base)
 Normalize a Unix file entry. More...
 
 normalizeWindowsObject ($item, $base)
 Normalize a Windows/DOS file entry. More...
 
 detectSystemType ($item)
 Get the system type from a listing item. More...
 
 detectType ($permissions)
 Get the file type from the permissions. More...
 
 normalizePermissions ($permissions)
 Normalize a permissions string. More...
 

Protected Attributes

 $connection
 
 $host
 
 $port = 21
 
 $ssl = false
 
 $timeout = 90
 
 $passive = true
 
 $separator = '/'
 
 $root
 
 $permPublic = 0744
 
 $permPrivate = 0700
 
 $configurable = []
 
 $systemType
 
 $alternativeRecursion = false
 
 $safeStorage
 
- Protected Attributes inherited from League\Flysystem\Adapter\AbstractAdapter
 $pathPrefix
 
 $pathSeparator = '/'
 

Additional Inherited Members

- Data Fields inherited from League\Flysystem\AdapterInterface
const VISIBILITY_PUBLIC = 'public'
 @const VISIBILITY_PUBLIC public visibility More...
 
const VISIBILITY_PRIVATE = 'private'
 @const VISIBILITY_PRIVATE private visibility More...
 

Detailed Description

Definition at line 12 of file AbstractFtpAdapter.php.

Constructor & Destructor Documentation

◆ __construct()

League\Flysystem\Adapter\AbstractFtpAdapter::__construct ( array  $config)

Constructor.

Parameters
array$config

Definition at line 89 of file AbstractFtpAdapter.php.

90 {
91 $this->safeStorage = new SafeStorage();
92 $this->setConfig($config);
93 }
$config
Definition: bootstrap.php:15

References League\Flysystem\Adapter\AbstractFtpAdapter\setConfig().

+ Here is the call graph for this function:

◆ __destruct()

League\Flysystem\Adapter\AbstractFtpAdapter::__destruct ( )

Disconnect on destruction.

Definition at line 609 of file AbstractFtpAdapter.php.

610 {
611 $this->disconnect();
612 }

References League\Flysystem\Adapter\AbstractFtpAdapter\disconnect().

+ Here is the call graph for this function:

Member Function Documentation

◆ connect()

League\Flysystem\Adapter\AbstractFtpAdapter::connect ( )
abstract

Establish a connection.

Reimplemented in League\Flysystem\Adapter\Ftp.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\getConnection().

+ Here is the caller graph for this function:

◆ detectSystemType()

League\Flysystem\Adapter\AbstractFtpAdapter::detectSystemType (   $item)
protected

Get the system type from a listing item.

Parameters
string$item
Returns
string the system type

Definition at line 469 of file AbstractFtpAdapter.php.

470 {
471 return preg_match('/^[0-9]{2,4}-[0-9]{2}-[0-9]{2}/', $item) ? 'windows' : 'unix';
472 }

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\normalizeObject().

+ Here is the caller graph for this function:

◆ detectType()

League\Flysystem\Adapter\AbstractFtpAdapter::detectType (   $permissions)
protected

Get the file type from the permissions.

Parameters
string$permissions
Returns
string file type

Definition at line 481 of file AbstractFtpAdapter.php.

482 {
483 return substr($permissions, 0, 1) === 'd' ? 'dir' : 'file';
484 }

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\normalizeUnixObject().

+ Here is the caller graph for this function:

◆ disconnect()

League\Flysystem\Adapter\AbstractFtpAdapter::disconnect ( )
abstract

Close the connection.

Reimplemented in League\Flysystem\Adapter\Ftp.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\__destruct(), and League\Flysystem\Adapter\AbstractFtpAdapter\getConnection().

+ Here is the caller graph for this function:

◆ ensureDirectory()

League\Flysystem\Adapter\AbstractFtpAdapter::ensureDirectory (   $dirname)

Ensure a directory exists.

Parameters
string$dirname

Definition at line 563 of file AbstractFtpAdapter.php.

564 {
565 if ( ! empty($dirname) && ! $this->has($dirname)) {
566 $this->createDir($dirname, new Config());
567 }
568 }
has($path)
Check whether a file exists.array|bool|null
createDir($dirname, Config $config)
Create a directory.

References League\Flysystem\AdapterInterface\createDir(), and League\Flysystem\Adapter\AbstractFtpAdapter\has().

Referenced by League\Flysystem\Adapter\Ftp\writeStream().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getConnection()

◆ getHost()

League\Flysystem\Adapter\AbstractFtpAdapter::getHost ( )

◆ getPassword()

League\Flysystem\Adapter\AbstractFtpAdapter::getPassword ( )

Returns the password.

Returns
string password

Definition at line 250 of file AbstractFtpAdapter.php.

251 {
252 return $this->safeStorage->retrieveSafely('password');
253 }

Referenced by League\Flysystem\Adapter\Ftp\login().

+ Here is the caller graph for this function:

◆ getPermPrivate()

League\Flysystem\Adapter\AbstractFtpAdapter::getPermPrivate ( )

Get the private permission value.

Returns
int

Definition at line 601 of file AbstractFtpAdapter.php.

References League\Flysystem\Adapter\AbstractFtpAdapter\$permPrivate.

Referenced by League\Flysystem\Adapter\Ftp\setVisibility().

+ Here is the caller graph for this function:

◆ getPermPublic()

League\Flysystem\Adapter\AbstractFtpAdapter::getPermPublic ( )

Get the public permission value.

Returns
int

Definition at line 591 of file AbstractFtpAdapter.php.

References League\Flysystem\Adapter\AbstractFtpAdapter\$permPublic.

Referenced by League\Flysystem\Adapter\Ftp\setVisibility().

+ Here is the caller graph for this function:

◆ getPort()

League\Flysystem\Adapter\AbstractFtpAdapter::getPort ( )

◆ getRoot()

League\Flysystem\Adapter\AbstractFtpAdapter::getRoot ( )

Returns the root folder to work from.

Returns
string

Definition at line 186 of file AbstractFtpAdapter.php.

References League\Flysystem\Adapter\AbstractFtpAdapter\$root.

Referenced by League\Flysystem\Adapter\Ftp\setConnectionRoot().

+ Here is the caller graph for this function:

◆ getSize()

League\Flysystem\Adapter\AbstractFtpAdapter::getSize (   $path)

Get the size of a file.

Parameters
string$path
Returns
array|false

Implements League\Flysystem\ReadInterface.

Definition at line 545 of file AbstractFtpAdapter.php.

546 {
547 return $this->getMetadata($path);
548 }
$path
Definition: aliased.php:25
getMetadata($path)
Get all the meta data of a file or directory.

References $path, and League\Flysystem\ReadInterface\getMetadata().

+ Here is the call graph for this function:

◆ getSystemType()

League\Flysystem\Adapter\AbstractFtpAdapter::getSystemType ( )

Return the FTP system type.

Returns
string

Definition at line 298 of file AbstractFtpAdapter.php.

References League\Flysystem\Adapter\AbstractFtpAdapter\$systemType.

◆ getTimeout()

League\Flysystem\Adapter\AbstractFtpAdapter::getTimeout ( )

Returns the amount of seconds before the connection will timeout.

Returns
int

Definition at line 274 of file AbstractFtpAdapter.php.

References League\Flysystem\Adapter\AbstractFtpAdapter\$timeout.

Referenced by League\Flysystem\Adapter\Ftp\connect().

+ Here is the caller graph for this function:

◆ getUsername()

League\Flysystem\Adapter\AbstractFtpAdapter::getUsername ( )

Returns the ftp username.

Returns
string username

Definition at line 224 of file AbstractFtpAdapter.php.

225 {
226 $username = $this->safeStorage->retrieveSafely('username');
227
228 return $username !== null ? $username : 'anonymous';
229 }

Referenced by League\Flysystem\Adapter\Ftp\login().

+ Here is the caller graph for this function:

◆ getVisibility()

League\Flysystem\Adapter\AbstractFtpAdapter::getVisibility (   $path)

Get the visibility of a file.

Parameters
string$path
Returns
array|false

Implements League\Flysystem\ReadInterface.

Definition at line 553 of file AbstractFtpAdapter.php.

554 {
555 return $this->getMetadata($path);
556 }

References $path, and League\Flysystem\ReadInterface\getMetadata().

+ Here is the call graph for this function:

◆ has()

League\Flysystem\Adapter\AbstractFtpAdapter::has (   $path)

Check whether a file exists.

Parameters
string$path
Returns
array|bool|null

Implements League\Flysystem\ReadInterface.

Definition at line 537 of file AbstractFtpAdapter.php.

538 {
539 return $this->getMetadata($path);
540 }

References $path, and League\Flysystem\ReadInterface\getMetadata().

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\ensureDirectory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isConnected()

League\Flysystem\Adapter\AbstractFtpAdapter::isConnected ( )
abstract

Check if a connection is active.

Returns
bool

Reimplemented in League\Flysystem\Adapter\Ftp.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\getConnection().

+ Here is the caller graph for this function:

◆ listContents()

League\Flysystem\Adapter\AbstractFtpAdapter::listContents (   $directory = '',
  $recursive = false 
)

List contents of a directory.

Parameters
string$directory
bool$recursive
Returns
array

Implements League\Flysystem\ReadInterface.

Definition at line 320 of file AbstractFtpAdapter.php.

321 {
322 return $this->listDirectoryContents($directory, $recursive);
323 }
listDirectoryContents($directory, $recursive=false)

References League\Flysystem\Adapter\AbstractFtpAdapter\listDirectoryContents().

+ Here is the call graph for this function:

◆ listDirectoryContents()

League\Flysystem\Adapter\AbstractFtpAdapter::listDirectoryContents (   $directory,
  $recursive = false 
)
abstractprotected

Reimplemented in League\Flysystem\Adapter\Ftp, and League\Flysystem\Adapter\Ftpd.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\listContents().

+ Here is the caller graph for this function:

◆ normalizeListing()

League\Flysystem\Adapter\AbstractFtpAdapter::normalizeListing ( array  $listing,
  $prefix = '' 
)
protected

Normalize a directory listing.

Parameters
array$listing
string$prefix
Returns
array directory listing

Definition at line 335 of file AbstractFtpAdapter.php.

336 {
337 $base = $prefix;
338 $result = [];
339 $listing = $this->removeDotDirectories($listing);
340
341 while ($item = array_shift($listing)) {
342 if (preg_match('#^.*:$#', $item)) {
343 $base = trim($item, ':');
344 continue;
345 }
346
347 $result[] = $this->normalizeObject($item, $base);
348 }
349
350 return $this->sortListing($result);
351 }
$result
sortListing(array $result)
Sort a directory listing.
removeDotDirectories(array $list)
Filter out dot-directories.
normalizeObject($item, $base)
Normalize a file entry.
$base
Definition: index.php:4

References $base, $result, League\Flysystem\Adapter\AbstractFtpAdapter\normalizeObject(), League\Flysystem\Adapter\AbstractFtpAdapter\removeDotDirectories(), and League\Flysystem\Adapter\AbstractFtpAdapter\sortListing().

Referenced by League\Flysystem\Adapter\Ftp\listDirectoryContents(), League\Flysystem\Adapter\Ftpd\listDirectoryContents(), and League\Flysystem\Adapter\Ftp\listDirectoryContentsRecursive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalizeObject()

League\Flysystem\Adapter\AbstractFtpAdapter::normalizeObject (   $item,
  $base 
)
protected

Normalize a file entry.

Parameters
string$item
string$base
Returns
array normalized file array
Exceptions
NotSupportedException

Definition at line 381 of file AbstractFtpAdapter.php.

382 {
383 $systemType = $this->systemType ?: $this->detectSystemType($item);
384
385 if ($systemType === 'unix') {
386 return $this->normalizeUnixObject($item, $base);
387 } elseif ($systemType === 'windows') {
388 return $this->normalizeWindowsObject($item, $base);
389 }
390
392 }
detectSystemType($item)
Get the system type from a listing item.
normalizeWindowsObject($item, $base)
Normalize a Windows/DOS file entry.
normalizeUnixObject($item, $base)
Normalize a Unix file entry.
static forFtpSystemType($systemType)
Create a new exception for a link.

References $base, League\Flysystem\Adapter\AbstractFtpAdapter\$systemType, League\Flysystem\Adapter\AbstractFtpAdapter\detectSystemType(), League\Flysystem\NotSupportedException\forFtpSystemType(), League\Flysystem\Adapter\AbstractFtpAdapter\normalizeUnixObject(), and League\Flysystem\Adapter\AbstractFtpAdapter\normalizeWindowsObject().

Referenced by League\Flysystem\Adapter\Ftp\getMetadata(), League\Flysystem\Adapter\Ftpd\getMetadata(), and League\Flysystem\Adapter\AbstractFtpAdapter\normalizeListing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalizePermissions()

League\Flysystem\Adapter\AbstractFtpAdapter::normalizePermissions (   $permissions)
protected

Normalize a permissions string.

Parameters
string$permissions
Returns
int

Definition at line 493 of file AbstractFtpAdapter.php.

494 {
495 // remove the type identifier
496 $permissions = substr($permissions, 1);
497
498 // map the string rights to the numeric counterparts
499 $map = ['-' => '0', 'r' => '4', 'w' => '2', 'x' => '1'];
500 $permissions = strtr($permissions, $map);
501
502 // split up the permission groups
503 $parts = str_split($permissions, 3);
504
505 // convert the groups
506 $mapper = function ($part) {
507 return array_sum(str_split($part));
508 };
509
510 // get the sum of the groups
511 return array_sum(array_map($mapper, $parts));
512 }

References $map.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\normalizeUnixObject().

+ Here is the caller graph for this function:

◆ normalizeUnixObject()

League\Flysystem\Adapter\AbstractFtpAdapter::normalizeUnixObject (   $item,
  $base 
)
protected

Normalize a Unix file entry.

Parameters
string$item
string$base
Returns
array normalized file array

Definition at line 402 of file AbstractFtpAdapter.php.

403 {
404 $item = preg_replace('#\s+#', ' ', trim($item), 7);
405
406 if (count(explode(' ', $item, 9)) !== 9) {
407 throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts.");
408 }
409
410 list($permissions, /* $number */, /* $owner */, /* $group */, $size, /* $month */, /* $day */, /* $time*/, $name) = explode(' ', $item, 9);
411 $type = $this->detectType($permissions);
412 $path = empty($base) ? $name : $base . $this->separator . $name;
413
414 if ($type === 'dir') {
415 return compact('type', 'path');
416 }
417
418 $permissions = $this->normalizePermissions($permissions);
420 $size = (int) $size;
421
422 return compact('type', 'path', 'visibility', 'size');
423 }
$size
Definition: RandomTest.php:84
normalizePermissions($permissions)
Normalize a permissions string.
detectType($permissions)
Get the file type from the permissions.
const VISIBILITY_PUBLIC
@const VISIBILITY_PUBLIC public visibility
const VISIBILITY_PRIVATE
@const VISIBILITY_PRIVATE private visibility
$type

References $base, $name, $path, $size, $type, League\Flysystem\Adapter\AbstractFtpAdapter\detectType(), League\Flysystem\Adapter\AbstractFtpAdapter\normalizePermissions(), League\Flysystem\AdapterInterface\VISIBILITY_PRIVATE, and League\Flysystem\AdapterInterface\VISIBILITY_PUBLIC.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\normalizeObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalizeWindowsObject()

League\Flysystem\Adapter\AbstractFtpAdapter::normalizeWindowsObject (   $item,
  $base 
)
protected

Normalize a Windows/DOS file entry.

Parameters
string$item
string$base
Returns
array normalized file array

Definition at line 433 of file AbstractFtpAdapter.php.

434 {
435 $item = preg_replace('#\s+#', ' ', trim($item), 3);
436
437 if (count(explode(' ', $item, 4)) !== 4) {
438 throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts.");
439 }
440
441 list($date, $time, $size, $name) = explode(' ', $item, 4);
442 $path = empty($base) ? $name : $base . $this->separator . $name;
443
444 // Check for the correct date/time format
445 $format = strlen($date) === 8 ? 'm-d-yH:iA' : 'Y-m-dH:i';
446 $dt = DateTime::createFromFormat($format, $date . $time);
447 $timestamp = $dt ? $dt->getTimestamp() : (int) strtotime("$date $time");
448
449 if ($size === '<DIR>') {
450 $type = 'dir';
451
452 return compact('type', 'path', 'timestamp');
453 }
454
455 $type = 'file';
457 $size = (int) $size;
458
459 return compact('type', 'path', 'visibility', 'size', 'timestamp');
460 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
$time
Definition: cron.php:21
$format
Definition: metadata.php:141

References $base, $format, $name, $path, $size, $time, $timestamp, $type, and League\Flysystem\AdapterInterface\VISIBILITY_PUBLIC.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\normalizeObject().

+ Here is the caller graph for this function:

◆ removeDotDirectories()

League\Flysystem\Adapter\AbstractFtpAdapter::removeDotDirectories ( array  $list)

Filter out dot-directories.

Parameters
array$list
Returns
array

Definition at line 521 of file AbstractFtpAdapter.php.

522 {
523 $filter = function ($line) {
524 if ( ! empty($line) && ! preg_match('#.* \.(\.)?$|^total#', $line)) {
525 return true;
526 }
527
528 return false;
529 };
530
531 return array_filter($list, $filter);
532 }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41

References $list.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\normalizeListing().

+ Here is the caller graph for this function:

◆ setConfig()

League\Flysystem\Adapter\AbstractFtpAdapter::setConfig ( array  $config)

Set the config.

Parameters
array$config
Returns
$this

Definition at line 102 of file AbstractFtpAdapter.php.

103 {
104 foreach ($this->configurable as $setting) {
105 if ( ! isset($config[$setting])) {
106 continue;
107 }
108
109 $method = 'set' . ucfirst($setting);
110
111 if (method_exists($this, $method)) {
112 $this->$method($config[$setting]);
113 }
114 }
115
116 return $this;
117 }

References $config.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\__construct().

+ Here is the caller graph for this function:

◆ setHost()

League\Flysystem\Adapter\AbstractFtpAdapter::setHost (   $host)

Set the host.

Parameters
string$host
Returns
$this

Definition at line 136 of file AbstractFtpAdapter.php.

137 {
138 $this->host = $host;
139
140 return $this;
141 }

References League\Flysystem\Adapter\AbstractFtpAdapter\$host.

◆ setPassword()

League\Flysystem\Adapter\AbstractFtpAdapter::setPassword (   $password)

Set the ftp password.

Parameters
string$password
Returns
$this

Definition at line 262 of file AbstractFtpAdapter.php.

263 {
264 $this->safeStorage->storeSafely('password', $password);
265
266 return $this;
267 }
$password
Definition: cron.php:14

References $password.

◆ setPermPrivate()

League\Flysystem\Adapter\AbstractFtpAdapter::setPermPrivate (   $permPrivate)

Set the private permission value.

Parameters
int$permPrivate
Returns
$this

Definition at line 164 of file AbstractFtpAdapter.php.

165 {
166 $this->permPrivate = $permPrivate;
167
168 return $this;
169 }

References League\Flysystem\Adapter\AbstractFtpAdapter\$permPrivate.

◆ setPermPublic()

League\Flysystem\Adapter\AbstractFtpAdapter::setPermPublic (   $permPublic)

Set the public permission value.

Parameters
int$permPublic
Returns
$this

Definition at line 150 of file AbstractFtpAdapter.php.

151 {
152 $this->permPublic = $permPublic;
153
154 return $this;
155 }

References League\Flysystem\Adapter\AbstractFtpAdapter\$permPublic.

◆ setPort()

League\Flysystem\Adapter\AbstractFtpAdapter::setPort (   $port)

Set the ftp port.

Parameters
int | string$port
Returns
$this

Definition at line 198 of file AbstractFtpAdapter.php.

199 {
200 $this->port = (int) $port;
201
202 return $this;
203 }

References League\Flysystem\Adapter\AbstractFtpAdapter\$port.

◆ setRoot()

League\Flysystem\Adapter\AbstractFtpAdapter::setRoot (   $root)

Set the root folder to work from.

Parameters
string$root
Returns
$this

Definition at line 212 of file AbstractFtpAdapter.php.

213 {
214 $this->root = rtrim($root, '\\/') . $this->separator;
215
216 return $this;
217 }

References League\Flysystem\Adapter\AbstractFtpAdapter\$root, and League\Flysystem\Adapter\AbstractFtpAdapter\$separator.

◆ setSystemType()

League\Flysystem\Adapter\AbstractFtpAdapter::setSystemType (   $systemType)

Set the FTP system type (windows or unix).

Parameters
string$systemType
Returns
$this

Definition at line 310 of file AbstractFtpAdapter.php.

311 {
312 $this->systemType = strtolower($systemType);
313
314 return $this;
315 }

References League\Flysystem\Adapter\AbstractFtpAdapter\$systemType.

◆ setTimeout()

League\Flysystem\Adapter\AbstractFtpAdapter::setTimeout (   $timeout)

Set the amount of seconds before the connection should timeout.

Parameters
int$timeout
Returns
$this

Definition at line 286 of file AbstractFtpAdapter.php.

287 {
288 $this->timeout = (int) $timeout;
289
290 return $this;
291 }

References League\Flysystem\Adapter\AbstractFtpAdapter\$timeout.

◆ setUsername()

League\Flysystem\Adapter\AbstractFtpAdapter::setUsername (   $username)

Set ftp username.

Parameters
string$username
Returns
$this

Definition at line 238 of file AbstractFtpAdapter.php.

239 {
240 $this->safeStorage->storeSafely('username', $username);
241
242 return $this;
243 }

◆ sortListing()

League\Flysystem\Adapter\AbstractFtpAdapter::sortListing ( array  $result)
protected

Sort a directory listing.

Parameters
array$result
Returns
array sorted listing

Definition at line 360 of file AbstractFtpAdapter.php.

361 {
362 $compare = function ($one, $two) {
363 return strnatcmp($one['path'], $two['path']);
364 };
365
366 usort($result, $compare);
367
368 return $result;
369 }

References $result.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\normalizeListing().

+ Here is the caller graph for this function:

Field Documentation

◆ $alternativeRecursion

League\Flysystem\Adapter\AbstractFtpAdapter::$alternativeRecursion = false
protected

Definition at line 77 of file AbstractFtpAdapter.php.

◆ $configurable

League\Flysystem\Adapter\AbstractFtpAdapter::$configurable = []
protected

Definition at line 67 of file AbstractFtpAdapter.php.

◆ $connection

◆ $host

League\Flysystem\Adapter\AbstractFtpAdapter::$host
protected

◆ $passive

League\Flysystem\Adapter\AbstractFtpAdapter::$passive = true
protected

Definition at line 42 of file AbstractFtpAdapter.php.

Referenced by League\Flysystem\Adapter\Ftp\setPassive().

◆ $permPrivate

League\Flysystem\Adapter\AbstractFtpAdapter::$permPrivate = 0700
protected

◆ $permPublic

League\Flysystem\Adapter\AbstractFtpAdapter::$permPublic = 0744
protected

◆ $port

League\Flysystem\Adapter\AbstractFtpAdapter::$port = 21
protected

◆ $root

◆ $safeStorage

League\Flysystem\Adapter\AbstractFtpAdapter::$safeStorage
protected

Definition at line 82 of file AbstractFtpAdapter.php.

◆ $separator

League\Flysystem\Adapter\AbstractFtpAdapter::$separator = '/'
protected

◆ $ssl

League\Flysystem\Adapter\AbstractFtpAdapter::$ssl = false
protected

Definition at line 32 of file AbstractFtpAdapter.php.

Referenced by League\Flysystem\Adapter\Ftp\setSsl().

◆ $systemType

◆ $timeout

League\Flysystem\Adapter\AbstractFtpAdapter::$timeout = 90
protected

The documentation for this class was generated from the following file: