ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
 read ($path)
 Read a file. More...
 
 readStream ($path)
 Read a file as a stream. More...
 
 getMetadata ($path)
 Get all the meta data of a file or directory. More...
 
 getMimetype ($path)
 Get the mimetype of a file. More...
 
 getTimestamp ($path)
 Get the timestamp 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'
 VISIBILITY_PUBLIC public visibility More...
 
const VISIBILITY_PRIVATE = 'private'
 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.

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

90  {
91  $this->safeStorage = new SafeStorage();
92  $this->setConfig($config);
93  }
+ 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.

References League\Flysystem\Adapter\AbstractFtpAdapter\connect(), League\Flysystem\Adapter\AbstractFtpAdapter\disconnect(), and League\Flysystem\Adapter\AbstractFtpAdapter\isConnected().

610  {
611  $this->disconnect();
612  }
+ Here is the call graph for this function:

Member Function Documentation

◆ connect()

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

Establish a connection.

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\__destruct(), and 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.

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

470  {
471  return preg_match('/^[0-9]{2,4}-[0-9]{2}-[0-9]{2}/', $item) ? 'windows' : 'unix';
472  }
+ 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.

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

482  {
483  return substr($permissions, 0, 1) === 'd' ? 'dir' : 'file';
484  }
+ Here is the caller graph for this function:

◆ disconnect()

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

Close the connection.

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.

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

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

564  {
565  if ( ! empty($dirname) && ! $this->has($dirname)) {
566  $this->createDir($dirname, new Config());
567  }
568  }
createDir($dirname, Config $config)
Create a directory.
has($path)
Check whether a file exists.array|bool|null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getConnection()

League\Flysystem\Adapter\AbstractFtpAdapter::getConnection ( )
Returns
mixed

Definition at line 573 of file AbstractFtpAdapter.php.

References League\Flysystem\Adapter\AbstractFtpAdapter\$connection, League\Flysystem\Adapter\AbstractFtpAdapter\connect(), League\Flysystem\Adapter\AbstractFtpAdapter\disconnect(), and League\Flysystem\Adapter\AbstractFtpAdapter\isConnected().

Referenced by League\Flysystem\Adapter\Ftp\createDir(), League\Flysystem\Adapter\Ftp\delete(), League\Flysystem\Adapter\Ftp\deleteDir(), League\Flysystem\Adapter\Ftp\ftpRawlist(), League\Flysystem\Adapter\Ftpd\getMetadata(), League\Flysystem\Adapter\Ftp\getMetadata(), League\Flysystem\Adapter\Ftp\getTimestamp(), League\Flysystem\Adapter\Ftpd\listDirectoryContents(), League\Flysystem\Adapter\Ftp\readStream(), League\Flysystem\Adapter\Ftp\rename(), League\Flysystem\Adapter\Ftp\setVisibility(), and League\Flysystem\Adapter\Ftp\writeStream().

574  {
575  $tries = 0;
576 
577  while ( ! $this->isConnected() && $tries < 3) {
578  $tries++;
579  $this->disconnect();
580  $this->connect();
581  }
582 
583  return $this->connection;
584  }
isConnected()
Check if a connection is active.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

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

251  {
252  return $this->safeStorage->retrieveSafely('password');
253  }
+ 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.

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

546  {
547  return $this->getMetadata($path);
548  }
getMetadata($path)
Get all the meta data of a file or directory.
+ 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.

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

225  {
226  $username = $this->safeStorage->retrieveSafely('username');
227 
228  return $username !== null ? $username : 'anonymous';
229  }
+ 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.

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

554  {
555  return $this->getMetadata($path);
556  }
getMetadata($path)
Get all the meta data of a file or directory.
+ 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.

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

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

538  {
539  return $this->getMetadata($path);
540  }
getMetadata($path)
Get all the meta data of a file or directory.
+ 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

Referenced by League\Flysystem\Adapter\AbstractFtpAdapter\__destruct(), and 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.

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

321  {
322  return $this->listDirectoryContents($directory, $recursive);
323  }
listDirectoryContents($directory, $recursive=false)
+ Here is the call graph for this function:

◆ listDirectoryContents()

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

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.

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

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

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
normalizeObject($item, $base)
Normalize a file entry.
$base
Definition: index.php:4
sortListing(array $result)
Sort a directory listing.
removeDotDirectories(array $list)
Filter out dot-directories.
+ 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.

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\Ftpd\getMetadata(), League\Flysystem\Adapter\Ftp\getMetadata(), and League\Flysystem\Adapter\AbstractFtpAdapter\normalizeListing().

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  }
normalizeWindowsObject($item, $base)
Normalize a Windows/DOS file entry.
static forFtpSystemType($systemType)
Create a new exception for a link.
$base
Definition: index.php:4
normalizeUnixObject($item, $base)
Normalize a Unix file entry.
detectSystemType($item)
Get the system type from a listing item.
+ 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.

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

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  }
+ 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.

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().

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  }
const VISIBILITY_PUBLIC
VISIBILITY_PUBLIC public visibility
$size
Definition: RandomTest.php:84
$type
detectType($permissions)
Get the file type from the permissions.
const VISIBILITY_PRIVATE
VISIBILITY_PRIVATE private visibility
$base
Definition: index.php:4
if($format !==null) $name
Definition: metadata.php:146
normalizePermissions($permissions)
Normalize a permissions string.
+ 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.

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

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

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  }
const VISIBILITY_PUBLIC
VISIBILITY_PUBLIC public visibility
$size
Definition: RandomTest.php:84
$format
Definition: metadata.php:141
$type
$base
Definition: index.php:4
$time
Definition: cron.php:21
if($format !==null) $name
Definition: metadata.php:146
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
+ 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.

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

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
+ 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.

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

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  }
+ 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.

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

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

◆ setPassword()

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

Set the ftp password.

Parameters
string$password
Returns
$this

Definition at line 262 of file AbstractFtpAdapter.php.

References $password.

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

◆ 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.

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

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

◆ 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.

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

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

◆ 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.

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

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

◆ 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.

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

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

◆ 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.

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

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

◆ 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.

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

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

◆ 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.

References $result.

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

361  {
362  $compare = function ($one, $two) {
363  return strnatcmp($one['path'], $two['path']);
364  };
365 
366  usort($result, $compare);
367 
368  return $result;
369  }
$result
+ 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: