Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Static Protected Member Functions | Protected Attributes
Zend_File_Transfer_Adapter_Abstract Class Reference
Inheritance diagram for Zend_File_Transfer_Adapter_Abstract:
Zend_File_Transfer_Adapter_Http

Public Member Functions

 send ($options=null)
 
 receive ($options=null)
 
 isSent ($files=null)
 
 isReceived ($files=null)
 
 isUploaded ($files=null)
 
 isFiltered ($files=null)
 
 setPluginLoader (Zend_Loader_PluginLoader_Interface $loader, $type)
 
 getPluginLoader ($type)
 
 addPrefixPath ($prefix, $path, $type=null)
 
 addPrefixPaths (array $spec)
 
 addValidator ($validator, $breakChainOnFailure=false, $options=null, $files=null)
 
 addValidators (array $validators, $files=null)
 
 setValidators (array $validators, $files=null)
 
 hasValidator ($name)
 
 getValidator ($name)
 
 getValidators ($files=null)
 
 removeValidator ($name)
 
 clearValidators ()
 
 setOptions ($options=array(), $files=null)
 
 getOptions ($files=null)
 
 isValid ($files=null)
 
 getMessages ()
 
 getErrors ()
 
 hasErrors ()
 
 addFilter ($filter, $options=null, $files=null)
 
 addFilters (array $filters, $files=null)
 
 setFilters (array $filters, $files=null)
 
 hasFilter ($name)
 
 getFilter ($name)
 
 getFilters ($files=null)
 
 removeFilter ($name)
 
 clearFilters ()
 
 getFile ()
 
 getFileName ($file=null, $path=true)
 
 getFileInfo ($file=null)
 
 addFile ($file, $validator=null, $filter=null)
 
 getType ()
 
 addType ($type, $validator=null, $filter=null)
 
 setDestination ($destination, $files=null)
 
 getDestination ($files=null)
 
 setTranslator ($translator=null)
 
 getTranslator ()
 
 setDisableTranslator ($flag)
 
 translatorIsDisabled ()
 
 getHash ($hash='crc32', $files=null)
 
 getFileSize ($files=null)
 
 getMimeType ($files=null)
 

Static Public Member Functions

static getProgress ()
 

Data Fields

const FILTER = 'FILTER'
 
const VALIDATE = 'VALIDATE'
 

Protected Member Functions

 _detectFileSize ($value)
 
 _detectMimeType ($value)
 
 _filter ($files=null)
 
 _getTmpDir ()
 
 _isPathWriteable ($path)
 
 _getFiles ($files, $names=false, $noexception=false)
 
 _getValidatorIdentifier ($name)
 
 _getFilterIdentifier ($name)
 

Static Protected Member Functions

static _toByteString ($size)
 

Protected Attributes

 $_break = array()
 
 $_filters = array()
 
 $_loaders = array()
 
 $_messages = array()
 
 $_translator
 
 $_translatorDisabled = false
 
 $_validators = array()
 
 $_files = array()
 
 $_tmpDir
 
 $_options
 

Detailed Description

Definition at line 30 of file Abstract.php.

Member Function Documentation

◆ _detectFileSize()

_detectFileSize (   $value)
protected

Internal method to detect the size of a file

Parameters
array$valueFile infos
Returns
string Filesize of given file

Definition at line 1239 of file Abstract.php.

1240  {
1241  if (file_exists($value['name'])) {
1242  $result = sprintf("%u", @filesize($value['name']));
1243  } else if (file_exists($value['tmp_name'])) {
1244  $result = sprintf("%u", @filesize($value['tmp_name']));
1245  } else {
1246  return null;
1247  }
1248 
1249  return $result;
1250  }
$value
Definition: gender.phtml:16

◆ _detectMimeType()

_detectMimeType (   $value)
protected

Internal method to detect the mime type of a file

Parameters
array$valueFile infos
Returns
string Mimetype of given file

Definition at line 1288 of file Abstract.php.

1289  {
1290  if (file_exists($value['name'])) {
1291  $file = $value['name'];
1292  } else if (file_exists($value['tmp_name'])) {
1293  $file = $value['tmp_name'];
1294  } else {
1295  return null;
1296  }
1297 
1298  if (class_exists('finfo', false)) {
1299  $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
1300  if (!empty($value['options']['magicFile'])) {
1301  $mime = @finfo_open($const, $value['options']['magicFile']);
1302  }
1303 
1304  if (empty($mime)) {
1305  $mime = @finfo_open($const);
1306  }
1307 
1308  if (!empty($mime)) {
1309  $result = finfo_file($mime, $file);
1310  }
1311 
1312  unset($mime);
1313  }
1314 
1315  if (empty($result) && (function_exists('mime_content_type')
1316  && ini_get('mime_magic.magicfile'))) {
1317  $result = mime_content_type($file);
1318  }
1319 
1320  if (empty($result)) {
1321  $result = 'application/octet-stream';
1322  }
1323 
1324  return $result;
1325  }
$value
Definition: gender.phtml:16

◆ _filter()

_filter (   $files = null)
protected

Internal function to filter all given files

Parameters
string | array$files(Optional) Files to check
Returns
boolean False on error

Definition at line 1349 of file Abstract.php.

1350  {
1351  $check = $this->_getFiles($files);
1352  foreach ($check as $name => $content) {
1353  if (array_key_exists('filters', $content)) {
1354  foreach ($content['filters'] as $class) {
1355  $filter = $this->_filters[$class];
1356  try {
1357  $result = $filter->filter($this->getFileName($name));
1358 
1359  $this->_files[$name]['destination'] = dirname($result);
1360  $this->_files[$name]['name'] = basename($result);
1361  } catch (Zend_Filter_Exception $e) {
1362  $this->_messages += array($e->getMessage());
1363  }
1364  }
1365  }
1366  }
1367 
1368  if (count($this->_messages) > 0) {
1369  return false;
1370  }
1371 
1372  return true;
1373  }
getFileName($file=null, $path=true)
Definition: Abstract.php:944
$_option $_optionId $class
Definition: date.phtml:13
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ _getFiles()

_getFiles (   $files,
  $names = false,
  $noexception = false 
)
protected

Returns found files based on internal file array and given files

Parameters
string | array$files(Optional) Files to return
boolean$names(Optional) Returns only names on true, else complete info
boolean$noexception(Optional) Allows throwing an exception, otherwise returns an empty array
Returns
array Found files
Exceptions
Zend_File_Transfer_ExceptionOn false filename

Definition at line 1464 of file Abstract.php.

1465  {
1466  $check = array();
1467 
1468  if (is_string($files)) {
1469  $files = array($files);
1470  }
1471 
1472  if (is_array($files)) {
1473  foreach ($files as $find) {
1474  $found = array();
1475  foreach ($this->_files as $file => $content) {
1476  if (!isset($content['name'])) {
1477  continue;
1478  }
1479 
1480  if (($content['name'] === $find) && isset($content['multifiles'])) {
1481  foreach ($content['multifiles'] as $multifile) {
1482  $found[] = $multifile;
1483  }
1484  break;
1485  }
1486 
1487  if ($file === $find) {
1488  $found[] = $file;
1489  break;
1490  }
1491 
1492  if ($content['name'] === $find) {
1493  $found[] = $file;
1494  break;
1495  }
1496  }
1497 
1498  if (empty($found)) {
1499  if ($noexception !== false) {
1500  return array();
1501  }
1502 
1503  #require_once 'Zend/File/Transfer/Exception.php';
1504  throw new Zend_File_Transfer_Exception(sprintf('The file transfer adapter can not find "%s"', $find));
1505  }
1506 
1507  foreach ($found as $checked) {
1508  $check[$checked] = $this->_files[$checked];
1509  }
1510  }
1511  }
1512 
1513  if ($files === null) {
1514  $check = $this->_files;
1515  $keys = array_keys($check);
1516  foreach ($keys as $key) {
1517  if (isset($check[$key]['multifiles'])) {
1518  unset($check[$key]);
1519  }
1520  }
1521  }
1522 
1523  if ($names) {
1524  $check = array_keys($check);
1525  }
1526 
1527  return $check;
1528  }
foreach($appDirs as $dir) $files
$checked
Definition: billing.phtml:77

◆ _getFilterIdentifier()

_getFilterIdentifier (   $name)
protected

Retrieve internal identifier for a named filter

Parameters
string$name
Returns
string

Definition at line 1557 of file Abstract.php.

1558  {
1559  if (array_key_exists($name, $this->_filters)) {
1560  return $name;
1561  }
1562 
1563  foreach (array_keys($this->_filters) as $test) {
1564  if (preg_match('/' . preg_quote($name) . '$/i', $test)) {
1565  return $test;
1566  }
1567  }
1568 
1569  return false;
1570  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ _getTmpDir()

_getTmpDir ( )
protected

Determine system TMP directory and detect if we have read access

Returns
string
Exceptions
Zend_File_Transfer_Exceptionif unable to determine directory

Definition at line 1381 of file Abstract.php.

1382  {
1383  if (null === $this->_tmpDir) {
1384  $tmpdir = array();
1385  if (function_exists('sys_get_temp_dir')) {
1386  $tmpdir[] = sys_get_temp_dir();
1387  }
1388 
1389  if (!empty($_ENV['TMP'])) {
1390  $tmpdir[] = realpath($_ENV['TMP']);
1391  }
1392 
1393  if (!empty($_ENV['TMPDIR'])) {
1394  $tmpdir[] = realpath($_ENV['TMPDIR']);
1395  }
1396 
1397  if (!empty($_ENV['TEMP'])) {
1398  $tmpdir[] = realpath($_ENV['TEMP']);
1399  }
1400 
1401  $upload = ini_get('upload_tmp_dir');
1402  if ($upload) {
1403  $tmpdir[] = realpath($upload);
1404  }
1405 
1406  foreach($tmpdir as $directory) {
1407  if ($this->_isPathWriteable($directory)) {
1408  $this->_tmpDir = $directory;
1409  }
1410  }
1411 
1412  if (empty($this->_tmpDir)) {
1413  // Attemp to detect by creating a temporary file
1414  $tempFile = tempnam(md5(uniqid(rand(), TRUE)), '');
1415  if ($tempFile) {
1416  $this->_tmpDir = realpath(dirname($tempFile));
1417  unlink($tempFile);
1418  } else {
1419  #require_once 'Zend/File/Transfer/Exception.php';
1420  throw new Zend_File_Transfer_Exception('Could not determine a temporary directory');
1421  }
1422  }
1423 
1424  $this->_tmpDir = rtrim($this->_tmpDir, "/\\");
1425  }
1426  return $this->_tmpDir;
1427  }

◆ _getValidatorIdentifier()

_getValidatorIdentifier (   $name)
protected

Retrieve internal identifier for a named validator

Parameters
string$name
Returns
string

Definition at line 1536 of file Abstract.php.

1537  {
1538  if (array_key_exists($name, $this->_validators)) {
1539  return $name;
1540  }
1541 
1542  foreach (array_keys($this->_validators) as $test) {
1543  if (preg_match('/' . preg_quote($name) . '$/i', $test)) {
1544  return $test;
1545  }
1546  }
1547 
1548  return false;
1549  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ _isPathWriteable()

_isPathWriteable (   $path)
protected

Tries to detect if we can read and write to the given path

Parameters
string$path
Returns
bool

Definition at line 1435 of file Abstract.php.

1436  {
1437  $tempFile = rtrim($path, "/\\");
1438  $tempFile .= '/' . 'test.1';
1439 
1440  $result = @file_put_contents($tempFile, 'TEST');
1441 
1442  if ($result == false) {
1443  return false;
1444  }
1445 
1446  $result = @unlink($tempFile);
1447 
1448  if ($result == false) {
1449  return false;
1450  }
1451 
1452  return true;
1453  }

◆ _toByteString()

static _toByteString (   $size)
staticprotected

Returns the formatted size

Parameters
integer$size
Returns
string

Definition at line 1333 of file Abstract.php.

1334  {
1335  $sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
1336  for ($i=0; $size >= 1024 && $i < 9; $i++) {
1337  $size /= 1024;
1338  }
1339 
1340  return round($size, 2) . $sizes[$i];
1341  }
$i
Definition: gallery.phtml:31

◆ addFile()

addFile (   $file,
  $validator = null,
  $filter = null 
)

Adds one or more files

Parameters
string | array$fileFile to add
string | array$validatorValidators to use for this file, must be set before
string | array$filterFilters to use for this file, must be set before
Returns
Zend_File_Transfer_Adapter_Abstract
Exceptions
Zend_File_Transfer_ExceptionNot implemented

Definition at line 988 of file Abstract.php.

989  {
990  #require_once 'Zend/File/Transfer/Exception.php';
991  throw new Zend_File_Transfer_Exception('Method not implemented');
992  }

◆ addFilter()

addFilter (   $filter,
  $options = null,
  $files = null 
)

Adds a new filter for this class

Parameters
string | array$filterType of filter to add
string | array$optionsOptions to set for the filter
string | array$filesFiles to limit this filter to
Returns
Zend_File_Transfer_Adapter

Definition at line 750 of file Abstract.php.

751  {
752  if ($filter instanceof Zend_Filter_Interface) {
753  $class = get_class($filter);
754  } elseif (is_string($filter)) {
755  $class = $this->getPluginLoader(self::FILTER)->load($filter);
756  $filter = new $class($options);
757  } else {
758  #require_once 'Zend/File/Transfer/Exception.php';
759  throw new Zend_File_Transfer_Exception('Invalid filter specified');
760  }
761 
762  $this->_filters[$class] = $filter;
763  $files = $this->_getFiles($files, true, true);
764  foreach ($files as $file) {
765  $this->_files[$file]['filters'][] = $class;
766  }
767 
768  return $this;
769  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$_option $_optionId $class
Definition: date.phtml:13
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ addFilters()

addFilters ( array  $filters,
  $files = null 
)

Add Multiple filters at once

Parameters
array$filters
string | array$files
Returns
Zend_File_Transfer_Adapter_Abstract

Definition at line 778 of file Abstract.php.

779  {
780  foreach ($filters as $key => $spec) {
781  if ($spec instanceof Zend_Filter_Interface) {
782  $this->addFilter($spec, null, $files);
783  continue;
784  }
785 
786  if (is_string($key)) {
787  $this->addFilter($key, $spec, $files);
788  continue;
789  }
790 
791  if (is_int($key)) {
792  if (is_string($spec)) {
793  $this->addFilter($spec, null, $files);
794  continue;
795  }
796 
797  if (is_array($spec)) {
798  if (!array_key_exists('filter', $spec)) {
799  continue;
800  }
801 
802  $filter = $spec['filter'];
803  unset($spec['filter']);
804  $this->addFilter($filter, $spec, $files);
805  continue;
806  }
807 
808  continue;
809  }
810  }
811 
812  return $this;
813  }
addFilter($filter, $options=null, $files=null)
Definition: Abstract.php:750
$filters
Definition: uploader.phtml:11
foreach($appDirs as $dir) $files

◆ addPrefixPath()

addPrefixPath (   $prefix,
  $path,
  $type = null 
)

Add prefix path for plugin loader

If no $type specified, assumes it is a base path for both filters and validators, and sets each according to the following rules:

  • filters: $prefix = $prefix . '_Filter'
  • validators: $prefix = $prefix . '_Validate'

Otherwise, the path prefix is set on the appropriate plugin loader.

Parameters
string$prefix
string$path
string$type
Returns
Zend_File_Transfer_Adapter_Abstract
Exceptions
Zend_File_Transfer_Exceptionfor invalid type

Definition at line 256 of file Abstract.php.

257  {
258  $type = strtoupper($type);
259  switch ($type) {
260  case self::FILTER:
261  case self::VALIDATE:
262  $loader = $this->getPluginLoader($type);
263  $loader->addPrefixPath($prefix, $path);
264  return $this;
265  case null:
266  $prefix = rtrim($prefix, '_');
267  $path = rtrim($path, DIRECTORY_SEPARATOR);
268  foreach (array(self::FILTER, self::VALIDATE) as $type) {
269  $cType = ucfirst(strtolower($type));
270  $pluginPath = $path . DIRECTORY_SEPARATOR . $cType . DIRECTORY_SEPARATOR;
271  $pluginPrefix = $prefix . '_' . $cType;
272  $loader = $this->getPluginLoader($type);
273  $loader->addPrefixPath($pluginPrefix, $pluginPath);
274  }
275  return $this;
276  default:
277  #require_once 'Zend/File/Transfer/Exception.php';
278  throw new Zend_File_Transfer_Exception(sprintf('Invalid type "%s" provided to getPluginLoader()', $type));
279  }
280  }
$loader
Definition: autoload.php:8
$type
Definition: item.phtml:13
$prefix
Definition: name.phtml:25

◆ addPrefixPaths()

addPrefixPaths ( array  $spec)

Add many prefix paths at once

Parameters
array$spec
Returns
Zend_File_Transfer_Exception

Definition at line 288 of file Abstract.php.

289  {
290  if (isset($spec['prefix']) && isset($spec['path'])) {
291  return $this->addPrefixPath($spec['prefix'], $spec['path']);
292  }
293  foreach ($spec as $type => $paths) {
294  if (is_numeric($type) && is_array($paths)) {
295  $type = null;
296  if (isset($paths['prefix']) && isset($paths['path'])) {
297  if (isset($paths['type'])) {
298  $type = $paths['type'];
299  }
300  $this->addPrefixPath($paths['prefix'], $paths['path'], $type);
301  }
302  } elseif (!is_numeric($type)) {
303  if (!isset($paths['prefix']) || !isset($paths['path'])) {
304  foreach ($paths as $prefix => $spec) {
305  if (is_array($spec)) {
306  foreach ($spec as $path) {
307  if (!is_string($path)) {
308  continue;
309  }
310  $this->addPrefixPath($prefix, $path, $type);
311  }
312  } elseif (is_string($spec)) {
313  $this->addPrefixPath($prefix, $spec, $type);
314  }
315  }
316  } else {
317  $this->addPrefixPath($paths['prefix'], $paths['path'], $type);
318  }
319  }
320  }
321  return $this;
322  }
addPrefixPath($prefix, $path, $type=null)
Definition: Abstract.php:256
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$type
Definition: item.phtml:13
$prefix
Definition: name.phtml:25
$paths
Definition: _bootstrap.php:83

◆ addType()

addType (   $type,
  $validator = null,
  $filter = null 
)

Adds one or more type of files

Parameters
string | array$typeType of files to add
string | array$validatorValidators to use for this file, must be set before
string | array$filterFilters to use for this file, must be set before
Returns
Zend_File_Transfer_Adapter_Abstract
Exceptions
Zend_File_Transfer_ExceptionNot implemented

Definition at line 1015 of file Abstract.php.

1016  {
1017  #require_once 'Zend/File/Transfer/Exception.php';
1018  throw new Zend_File_Transfer_Exception('Method not implemented');
1019  }

◆ addValidator()

addValidator (   $validator,
  $breakChainOnFailure = false,
  $options = null,
  $files = null 
)

Adds a new validator for this class

Parameters
string | array$validatorType of validator to add
boolean$breakChainOnFailureIf the validation chain should stop an failure
string | array$optionsOptions to set for the validator
string | array$filesFiles to limit this validator to
Returns
Zend_File_Transfer_Adapter

Definition at line 333 of file Abstract.php.

334  {
335  if ($validator instanceof Zend_Validate_Interface) {
336  $name = get_class($validator);
337  } elseif (is_string($validator)) {
338  $name = $this->getPluginLoader(self::VALIDATE)->load($validator);
339  $validator = new $name($options);
340  if (is_array($options) && isset($options['messages'])) {
341  if (is_array($options['messages'])) {
342  $validator->setMessages($options['messages']);
343  } elseif (is_string($options['messages'])) {
344  $validator->setMessage($options['messages']);
345  }
346 
347  unset($options['messages']);
348  }
349  } else {
350  #require_once 'Zend/File/Transfer/Exception.php';
351  throw new Zend_File_Transfer_Exception('Invalid validator provided to addValidator; must be string or Zend_Validate_Interface');
352  }
353 
354  $this->_validators[$name] = $validator;
355  $this->_break[$name] = $breakChainOnFailure;
356  $files = $this->_getFiles($files, true, true);
357  foreach ($files as $file) {
358  if ($name == 'NotEmpty') {
359  $temp = $this->_files[$file]['validators'];
360  $this->_files[$file]['validators'] = array($name);
361  $this->_files[$file]['validators'] += $temp;
362  } else {
363  $this->_files[$file]['validators'][] = $name;
364  }
365 
366  $this->_files[$file]['validated'] = false;
367  }
368 
369  return $this;
370  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ addValidators()

addValidators ( array  $validators,
  $files = null 
)

Add Multiple validators at once

Parameters
array$validators
string | array$files
Returns
Zend_File_Transfer_Adapter_Abstract

Definition at line 379 of file Abstract.php.

380  {
381  foreach ($validators as $name => $validatorInfo) {
382  if ($validatorInfo instanceof Zend_Validate_Interface) {
383  $this->addValidator($validatorInfo, null, null, $files);
384  } else if (is_string($validatorInfo)) {
385  if (!is_int($name)) {
386  $this->addValidator($name, null, $validatorInfo, $files);
387  } else {
388  $this->addValidator($validatorInfo, null, null, $files);
389  }
390  } else if (is_array($validatorInfo)) {
391  $argc = count($validatorInfo);
392  $breakChainOnFailure = false;
393  $options = array();
394  if (isset($validatorInfo['validator'])) {
395  $validator = $validatorInfo['validator'];
396  if (isset($validatorInfo['breakChainOnFailure'])) {
397  $breakChainOnFailure = $validatorInfo['breakChainOnFailure'];
398  }
399 
400  if (isset($validatorInfo['options'])) {
401  $options = $validatorInfo['options'];
402  }
403 
404  $this->addValidator($validator, $breakChainOnFailure, $options, $files);
405  } else {
406  if (is_string($name)) {
407  $validator = $name;
408  $options = $validatorInfo;
409  $this->addValidator($validator, $breakChainOnFailure, $options, $files);
410  } else {
411  $file = $files;
412  switch (true) {
413  case (0 == $argc):
414  break;
415  case (1 <= $argc):
416  $validator = array_shift($validatorInfo);
417  case (2 <= $argc):
418  $breakChainOnFailure = array_shift($validatorInfo);
419  case (3 <= $argc):
420  $options = array_shift($validatorInfo);
421  case (4 <= $argc):
422  if (!empty($validatorInfo)) {
423  $file = array_shift($validatorInfo);
424  }
425  default:
426  $this->addValidator($validator, $breakChainOnFailure, $options, $file);
427  break;
428  }
429  }
430  }
431  } else {
432  #require_once 'Zend/File/Transfer/Exception.php';
433  throw new Zend_File_Transfer_Exception('Invalid validator passed to addValidators()');
434  }
435  }
436 
437  return $this;
438  }
addValidator($validator, $breakChainOnFailure=false, $options=null, $files=null)
Definition: Abstract.php:333
foreach($appDirs as $dir) $files
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ clearFilters()

clearFilters ( )

Remove all filters

Returns
Zend_File_Transfer_Adapter_Abstract

Definition at line 916 of file Abstract.php.

917  {
918  $this->_filters = array();
919  foreach (array_keys($this->_files) as $file) {
920  $this->_files[$file]['filters'] = array();
921  }
922  return $this;
923  }

◆ clearValidators()

clearValidators ( )

Remove all validators

Returns
Zend_File_Transfer_Adapter_Abstract

Definition at line 542 of file Abstract.php.

543  {
544  $this->_validators = array();
545  foreach (array_keys($this->_files) as $file) {
546  $this->_files[$file]['validators'] = array();
547  $this->_files[$file]['validated'] = false;
548  }
549 
550  return $this;
551  }

◆ getDestination()

getDestination (   $files = null)

Retrieve destination directory value

Parameters
null | string | array$files
Returns
null|string|array
Exceptions
Zend_File_Transfer_Exception

Definition at line 1073 of file Abstract.php.

1074  {
1075  $orig = $files;
1076  $files = $this->_getFiles($files, false, true);
1077  $destinations = array();
1078  if (empty($files) and is_string($orig)) {
1079  if (isset($this->_files[$orig]['destination'])) {
1080  $destinations[$orig] = $this->_files[$orig]['destination'];
1081  } else {
1082  #require_once 'Zend/File/Transfer/Exception.php';
1083  throw new Zend_File_Transfer_Exception(sprintf('The file transfer adapter can not find "%s"', $orig));
1084  }
1085  }
1086 
1087  foreach ($files as $key => $content) {
1088  if (isset($this->_files[$key]['destination'])) {
1089  $destinations[$key] = $this->_files[$key]['destination'];
1090  } else {
1091  $tmpdir = $this->_getTmpDir();
1092  $this->setDestination($tmpdir, $key);
1093  $destinations[$key] = $tmpdir;
1094  }
1095  }
1096 
1097  if (empty($destinations)) {
1098  $destinations = $this->_getTmpDir();
1099  } else if (count($destinations) == 1) {
1100  $destinations = current($destinations);
1101  }
1102 
1103  return $destinations;
1104  }
setDestination($destination, $files=null)
Definition: Abstract.php:1030
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ getErrors()

getErrors ( )

Retrieve error codes

Returns
array

Definition at line 727 of file Abstract.php.

728  {
729  return array_keys($this->_messages);
730  }

◆ getFile()

getFile ( )

Returns all set files

Returns
array List of set files
Exceptions
Zend_File_Transfer_ExceptionNot implemented

Definition at line 931 of file Abstract.php.

932  {
933  #require_once 'Zend/File/Transfer/Exception.php';
934  throw new Zend_File_Transfer_Exception('Method not implemented');
935  }

◆ getFileInfo()

getFileInfo (   $file = null)

Retrieve additional internal file informations for files

Parameters
string$file(Optional) File to get informations for
Returns
array

Definition at line 974 of file Abstract.php.

975  {
976  return $this->_getFiles($file);
977  }
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464

◆ getFileName()

getFileName (   $file = null,
  $path = true 
)

Retrieves the filename of transferred files.

Parameters
string | null$file
boolean$path(Optional) Should the path also be returned ?
Returns
string|array

Definition at line 944 of file Abstract.php.

945  {
946  $files = $this->_getFiles($file, true, true);
947  $result = array();
948  $directory = "";
949  foreach($files as $file) {
950  if (empty($this->_files[$file]['name'])) {
951  continue;
952  }
953 
954  if ($path === true) {
955  $directory = $this->getDestination($file) . DIRECTORY_SEPARATOR;
956  }
957 
958  $result[$file] = $directory . $this->_files[$file]['name'];
959  }
960 
961  if (count($result) == 1) {
962  return current($result);
963  }
964 
965  return $result;
966  }
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ getFileSize()

getFileSize (   $files = null)

Returns the real filesize of the file

Parameters
string | array$filesFiles to get the filesize from
Exceptions
Zend_File_Transfer_ExceptionWhen the file does not exist
Returns
string|array Filesize

Definition at line 1207 of file Abstract.php.

1208  {
1209  $files = $this->_getFiles($files);
1210  $result = array();
1211  foreach($files as $key => $value) {
1212  if (file_exists($value['name']) || file_exists($value['tmp_name'])) {
1213  if ($value['options']['useByteString']) {
1214  $result[$key] = self::_toByteString($value['size']);
1215  } else {
1216  $result[$key] = $value['size'];
1217  }
1218  } else if (empty($value['options']['ignoreNoFile'])) {
1219  #require_once 'Zend/File/Transfer/Exception.php';
1220  throw new Zend_File_Transfer_Exception("The file '{$value['name']}' does not exist");
1221  } else {
1222  continue;
1223  }
1224  }
1225 
1226  if (count($result) == 1) {
1227  return current($result);
1228  }
1229 
1230  return $result;
1231  }
$value
Definition: gender.phtml:16
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ getFilter()

getFilter (   $name)

Retrieve individual filter

Parameters
string$name
Returns
Zend_Filter_Interface|null

Definition at line 845 of file Abstract.php.

846  {
847  if (false === ($identifier = $this->_getFilterIdentifier($name))) {
848  return null;
849  }
850  return $this->_filters[$identifier];
851  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ getFilters()

getFilters (   $files = null)

Returns all set filters

Parameters
string | array$files(Optional) Returns the filter for this files
Returns
array List of set filters
Exceptions
Zend_File_Transfer_ExceptionWhen file not found

Definition at line 860 of file Abstract.php.

861  {
862  if ($files === null) {
863  return $this->_filters;
864  }
865 
866  $files = $this->_getFiles($files, true, true);
867  $filters = array();
868  foreach ($files as $file) {
869  if (!empty($this->_files[$file]['filters'])) {
870  $filters += $this->_files[$file]['filters'];
871  }
872  }
873 
874  $filters = array_unique($filters);
875  $result = array();
876  foreach ($filters as $filter) {
877  $result[] = $this->_filters[$filter];
878  }
879 
880  return $result;
881  }
$filters
Definition: uploader.phtml:11
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ getHash()

getHash (   $hash = 'crc32',
  $files = null 
)

Returns the hash for a given file

Parameters
string$hashHash algorithm to use
string | array$filesFiles to return the hash for
Returns
string|array Hashstring
Exceptions
Zend_File_Transfer_ExceptionOn unknown hash algorithm

Definition at line 1173 of file Abstract.php.

1174  {
1175  if (!in_array($hash, hash_algos())) {
1176  #require_once 'Zend/File/Transfer/Exception.php';
1177  throw new Zend_File_Transfer_Exception('Unknown hash algorithm');
1178  }
1179 
1180  $files = $this->_getFiles($files);
1181  $result = array();
1182  foreach($files as $key => $value) {
1183  if (file_exists($value['name'])) {
1184  $result[$key] = hash_file($hash, $value['name']);
1185  } else if (file_exists($value['tmp_name'])) {
1186  $result[$key] = hash_file($hash, $value['tmp_name']);
1187  } else if (empty($value['options']['ignoreNoFile'])) {
1188  #require_once 'Zend/File/Transfer/Exception.php';
1189  throw new Zend_File_Transfer_Exception("The file '{$value['name']}' does not exist");
1190  }
1191  }
1192 
1193  if (count($result) == 1) {
1194  return current($result);
1195  }
1196 
1197  return $result;
1198  }
$value
Definition: gender.phtml:16
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ getMessages()

getMessages ( )

Returns found validation messages

Returns
array

Definition at line 717 of file Abstract.php.

718  {
719  return $this->_messages;
720  }

◆ getMimeType()

getMimeType (   $files = null)

Returns the real mimetype of the file Uses fileinfo, when not available mime_magic and as last fallback a manual given mimetype

Parameters
string | array$filesFiles to get the mimetype from
Exceptions
Zend_File_Transfer_ExceptionWhen the file does not exist
Returns
string|array MimeType

Definition at line 1260 of file Abstract.php.

1261  {
1262  $files = $this->_getFiles($files);
1263  $result = array();
1264  foreach($files as $key => $value) {
1265  if (file_exists($value['name']) || file_exists($value['tmp_name'])) {
1266  $result[$key] = $value['type'];
1267  } else if (empty($value['options']['ignoreNoFile'])) {
1268  #require_once 'Zend/File/Transfer/Exception.php';
1269  throw new Zend_File_Transfer_Exception("The file '{$value['name']}' does not exist");
1270  } else {
1271  continue;
1272  }
1273  }
1274 
1275  if (count($result) == 1) {
1276  return current($result);
1277  }
1278 
1279  return $result;
1280  }
$value
Definition: gender.phtml:16
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ getOptions()

getOptions (   $files = null)

Returns set options for adapters or files

Parameters
array$files(Optional) Files to return the options for
Returns
array Options for given files

Definition at line 598 of file Abstract.php.

598  {
599  $file = $this->_getFiles($files, false, true);
600 
601  foreach ($file as $key => $content) {
602  if (isset($this->_files[$key]['options'])) {
603  $options[$key] = $this->_files[$key]['options'];
604  } else {
605  $options[$key] = array();
606  }
607  }
608 
609  return $options;
610  }
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ getPluginLoader()

getPluginLoader (   $type)

Retrieve plugin loader for validator or filter chain

Instantiates with default rules if none available for that type. Use 'filter' or 'validate' for $type.

Parameters
string$type
Returns
Zend_Loader_PluginLoader
Exceptions
Zend_File_Transfer_Exceptionon invalid type.

Definition at line 210 of file Abstract.php.

211  {
212  $type = strtoupper($type);
213  switch ($type) {
214  case self::FILTER:
215  case self::VALIDATE:
216  $prefixSegment = ucfirst(strtolower($type));
217  $pathSegment = $prefixSegment;
218  if (!isset($this->_loaders[$type])) {
219  $paths = array(
220  'Zend_' . $prefixSegment . '_' => 'Zend/' . $pathSegment . '/',
221  'Zend_' . $prefixSegment . '_File' => 'Zend/' . $pathSegment . '/File',
222  );
223 
224  #require_once 'Zend/Loader/PluginLoader.php';
225  $this->_loaders[$type] = new Zend_Loader_PluginLoader($paths);
226  } else {
227  $loader = $this->_loaders[$type];
228  $prefix = 'Zend_' . $prefixSegment . '_File_';
229  if (!$loader->getPaths($prefix)) {
230  $loader->addPrefixPath($prefix, str_replace('_', '/', $prefix));
231  }
232  }
233  return $this->_loaders[$type];
234  default:
235  #require_once 'Zend/File/Transfer/Exception.php';
236  throw new Zend_File_Transfer_Exception(sprintf('Invalid type "%s" provided to getPluginLoader()', $type));
237  }
238  }
$loader
Definition: autoload.php:8
$type
Definition: item.phtml:13
$prefix
Definition: name.phtml:25
$paths
Definition: _bootstrap.php:83

◆ getProgress()

static getProgress ( )
static

Retrieve progress of transfer

Returns
float

Definition at line 172 of file Abstract.php.

173  {
174  #require_once 'Zend/File/Transfer/Exception.php';
175  throw new Zend_File_Transfer_Exception('Method must be implemented within the adapter');
176  }

◆ getTranslator()

getTranslator ( )

Retrieve localization translator object

Returns
Zend_Translate_Adapter|null

Definition at line 1134 of file Abstract.php.

1135  {
1136  if ($this->translatorIsDisabled()) {
1137  return null;
1138  }
1139 
1140  return $this->_translator;
1141  }

◆ getType()

getType ( )

Returns all set types

Returns
array List of set types
Exceptions
Zend_File_Transfer_ExceptionNot implemented

Definition at line 1000 of file Abstract.php.

1001  {
1002  #require_once 'Zend/File/Transfer/Exception.php';
1003  throw new Zend_File_Transfer_Exception('Method not implemented');
1004  }

◆ getValidator()

getValidator (   $name)

Retrieve individual validator

Parameters
string$name
Returns
Zend_Validate_Interface|null

Definition at line 470 of file Abstract.php.

471  {
472  if (false === ($identifier = $this->_getValidatorIdentifier($name))) {
473  return null;
474  }
475  return $this->_validators[$identifier];
476  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ getValidators()

getValidators (   $files = null)

Returns all set validators

Parameters
string | array$files(Optional) Returns the validator for this files
Returns
null|array List of set validators

Definition at line 484 of file Abstract.php.

485  {
486  if ($files == null) {
487  return $this->_validators;
488  }
489 
490  $files = $this->_getFiles($files, true, true);
491  $validators = array();
492  foreach ($files as $file) {
493  if (!empty($this->_files[$file]['validators'])) {
494  $validators += $this->_files[$file]['validators'];
495  }
496  }
497 
498  $validators = array_unique($validators);
499  $result = array();
500  foreach ($validators as $validator) {
501  $result[$validator] = $this->_validators[$validator];
502  }
503 
504  return $result;
505  }
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ hasErrors()

hasErrors ( )

Are there errors registered?

Returns
boolean

Definition at line 737 of file Abstract.php.

738  {
739  return (!empty($this->_messages));
740  }

◆ hasFilter()

hasFilter (   $name)

Determine if a given filter has already been registered

Parameters
string$name
Returns
bool

Definition at line 834 of file Abstract.php.

835  {
836  return (false !== $this->_getFilterIdentifier($name));
837  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ hasValidator()

hasValidator (   $name)

Determine if a given validator has already been registered

Parameters
string$name
Returns
bool

Definition at line 459 of file Abstract.php.

460  {
461  return (false !== $this->_getValidatorIdentifier($name));
462  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ isFiltered()

isFiltered (   $files = null)
abstract

Has the file been filtered ?

Parameters
array | string | null$files
Returns
bool

◆ isReceived()

isReceived (   $files = null)
abstract

Is file received?

Parameters
array | string | null$files
Returns
bool

◆ isSent()

isSent (   $files = null)
abstract

Is file sent?

Parameters
array | string | null$files
Returns
bool

◆ isUploaded()

isUploaded (   $files = null)
abstract

Has a file been uploaded ?

Parameters
array | string | null$files
Returns
bool

◆ isValid()

isValid (   $files = null)

Checks if the files are valid

Parameters
string | array$files(Optional) Files to check
Returns
boolean True if all checks are valid

Definition at line 618 of file Abstract.php.

619  {
620  $check = $this->_getFiles($files, false, true);
621  if (empty($check)) {
622  return false;
623  }
624 
625  $translator = $this->getTranslator();
626  $this->_messages = array();
627  $break = false;
628  foreach($check as $key => $content) {
629  if (array_key_exists('validators', $content) &&
630  in_array('Zend_Validate_File_Count', $content['validators'])) {
631  $validator = $this->_validators['Zend_Validate_File_Count'];
632  $count = $content;
633  if (empty($content['tmp_name'])) {
634  continue;
635  }
636 
637  if (array_key_exists('destination', $content)) {
638  $checkit = $content['destination'];
639  } else {
640  $checkit = dirname($content['tmp_name']);
641  }
642 
643  $checkit .= DIRECTORY_SEPARATOR . $content['name'];
644  $validator->addFile($checkit);
645  }
646  }
647 
648  if (isset($count)) {
649  if (!$validator->isValid($count['tmp_name'], $count)) {
650  $this->_messages += $validator->getMessages();
651  }
652  }
653 
654  foreach ($check as $key => $content) {
655  $fileerrors = array();
656  if (array_key_exists('validators', $content) && $content['validated']) {
657  continue;
658  }
659 
660  if (array_key_exists('validators', $content)) {
661  foreach ($content['validators'] as $class) {
662  $validator = $this->_validators[$class];
663  if (method_exists($validator, 'setTranslator')) {
664  $validator->setTranslator($translator);
665  }
666 
667  if (($class === 'Zend_Validate_File_Upload') and (empty($content['tmp_name']))) {
668  $tocheck = $key;
669  } else {
670  $tocheck = $content['tmp_name'];
671  }
672 
673  if (!$validator->isValid($tocheck, $content)) {
674  $fileerrors += $validator->getMessages();
675  }
676 
677  if (!empty($content['options']['ignoreNoFile']) and (isset($fileerrors['fileUploadErrorNoFile']))) {
678  unset($fileerrors['fileUploadErrorNoFile']);
679  break;
680  }
681 
682  if (($class === 'Zend_Validate_File_Upload') and (count($fileerrors) > 0)) {
683  break;
684  }
685 
686  if (($this->_break[$class]) and (count($fileerrors) > 0)) {
687  $break = true;
688  break;
689  }
690  }
691  }
692 
693  if (count($fileerrors) > 0) {
694  $this->_files[$key]['validated'] = false;
695  } else {
696  $this->_files[$key]['validated'] = true;
697  }
698 
699  $this->_messages += $fileerrors;
700  if ($break) {
701  break;
702  }
703  }
704 
705  if (count($this->_messages) > 0) {
706  return false;
707  }
708 
709  return true;
710  }
$count
Definition: recent.phtml:13
$_option $_optionId $class
Definition: date.phtml:13
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ receive()

receive (   $options = null)
abstract

Receive file

Parameters
mixed$options
Returns
bool

◆ removeFilter()

removeFilter (   $name)

Remove an individual filter

Parameters
string$name
Returns
Zend_File_Transfer_Adapter_Abstract

Definition at line 889 of file Abstract.php.

890  {
891  if (false === ($key = $this->_getFilterIdentifier($name))) {
892  return $this;
893  }
894 
895  unset($this->_filters[$key]);
896  foreach (array_keys($this->_files) as $file) {
897  if (empty($this->_files[$file]['filters'])) {
898  continue;
899  }
900 
901  $index = array_search($key, $this->_files[$file]['filters']);
902  if ($index === false) {
903  continue;
904  }
905 
906  unset($this->_files[$file]['filters'][$index]);
907  }
908  return $this;
909  }
$index
Definition: list.phtml:44
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ removeValidator()

removeValidator (   $name)

Remove an individual validator

Parameters
string$name
Returns
Zend_File_Transfer_Adapter_Abstract

Definition at line 513 of file Abstract.php.

514  {
515  if (false === ($key = $this->_getValidatorIdentifier($name))) {
516  return $this;
517  }
518 
519  unset($this->_validators[$key]);
520  foreach (array_keys($this->_files) as $file) {
521  if (empty($this->_files[$file]['validators'])) {
522  continue;
523  }
524 
525  $index = array_search($key, $this->_files[$file]['validators']);
526  if ($index === false) {
527  continue;
528  }
529 
530  unset($this->_files[$file]['validators'][$index]);
531  $this->_files[$file]['validated'] = false;
532  }
533 
534  return $this;
535  }
$index
Definition: list.phtml:44
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ send()

send (   $options = null)
abstract

Send file

Parameters
mixed$options
Returns
bool

◆ setDestination()

setDestination (   $destination,
  $files = null 
)

Sets a new destination for the given files

Deprecated:
Will be changed to be a filter!!!
Parameters
string$destinationNew destination directory
string | array$filesFiles to set the new destination for
Returns
Zend_File_Transfer_Abstract
Exceptions
Zend_File_Transfer_Exceptionwhen the given destination is not a directory or does not exist

Definition at line 1030 of file Abstract.php.

1031  {
1032  $orig = $files;
1033  $destination = rtrim($destination, "/\\");
1034  if (!is_dir($destination)) {
1035  #require_once 'Zend/File/Transfer/Exception.php';
1036  throw new Zend_File_Transfer_Exception(
1037  'The given destination is not a directory or does not exist'
1038  );
1039  }
1040 
1041  if (!$this->_isPathWriteable($destination)) {
1042  #require_once 'Zend/File/Transfer/Exception.php';
1043  throw new Zend_File_Transfer_Exception(
1044  'The given destination is not writable'
1045  );
1046  }
1047 
1048  if ($files === null) {
1049  foreach ($this->_files as $file => $content) {
1050  $this->_files[$file]['destination'] = $destination;
1051  }
1052  } else {
1053  $files = $this->_getFiles($files, true, true);
1054  if (empty($files) and is_string($orig)) {
1055  $this->_files[$orig]['destination'] = $destination;
1056  }
1057 
1058  foreach ($files as $file) {
1059  $this->_files[$file]['destination'] = $destination;
1060  }
1061  }
1062 
1063  return $this;
1064  }
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files

◆ setDisableTranslator()

setDisableTranslator (   $flag)

Indicate whether or not translation should be disabled

Parameters
bool$flag
Returns
Zend_File_Transfer_Abstract

Definition at line 1149 of file Abstract.php.

1150  {
1151  $this->_translatorDisabled = (bool) $flag;
1152  return $this;
1153  }

◆ setFilters()

setFilters ( array  $filters,
  $files = null 
)

Sets a filter for the class, erasing all previous set

Parameters
string | array$filterFilter to set
string | array$filesFiles to limit this filter to
Returns
Zend_File_Transfer_Adapter

Definition at line 822 of file Abstract.php.

823  {
824  $this->clearFilters();
825  return $this->addFilters($filters, $files);
826  }
addFilters(array $filters, $files=null)
Definition: Abstract.php:778
$filters
Definition: uploader.phtml:11
foreach($appDirs as $dir) $files

◆ setOptions()

setOptions (   $options = array(),
  $files = null 
)

Sets Options for adapters

Parameters
array$optionsOptions to set
array$files(Optional) Files to set the options for
Returns
Zend_File_Transfer_Adapter_Abstract

Definition at line 560 of file Abstract.php.

560  {
561  $file = $this->_getFiles($files, false, true);
562 
563  if (is_array($options)) {
564  if (empty($file)) {
565  $this->_options = array_merge($this->_options, $options);
566  }
567 
568  foreach ($options as $name => $value) {
569  foreach ($file as $key => $content) {
570  switch ($name) {
571  case 'magicFile' :
572  $this->_files[$key]['options'][$name] = (string) $value;
573  break;
574 
575  case 'ignoreNoFile' :
576  case 'useByteString' :
577  case 'detectInfos' :
578  $this->_files[$key]['options'][$name] = (boolean) $value;
579  break;
580 
581  default:
582  #require_once 'Zend/File/Transfer/Exception.php';
583  throw new Zend_File_Transfer_Exception("Unknown option: $name = $value");
584  }
585  }
586  }
587  }
588 
589  return $this;
590  }
$value
Definition: gender.phtml:16
_getFiles($files, $names=false, $noexception=false)
Definition: Abstract.php:1464
foreach($appDirs as $dir) $files
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ setPluginLoader()

setPluginLoader ( Zend_Loader_PluginLoader_Interface  $loader,
  $type 
)

Set plugin loader to use for validator or filter chain

Parameters
Zend_Loader_PluginLoader_Interface$loader
string$type'filter', or 'validate'
Returns
Zend_File_Transfer_Adapter_Abstract
Exceptions
Zend_File_Transfer_Exceptionon invalid type

Definition at line 186 of file Abstract.php.

187  {
188  $type = strtoupper($type);
189  switch ($type) {
190  case self::FILTER:
191  case self::VALIDATE:
192  $this->_loaders[$type] = $loader;
193  return $this;
194  default:
195  #require_once 'Zend/File/Transfer/Exception.php';
196  throw new Zend_File_Transfer_Exception(sprintf('Invalid type "%s" provided to setPluginLoader()', $type));
197  }
198  }
$loader
Definition: autoload.php:8
$type
Definition: item.phtml:13

◆ setTranslator()

setTranslator (   $translator = null)

Set translator object for localization

Parameters
Zend_Translate | null$translator
Returns
Zend_File_Transfer_Abstract
Exceptions
Zend_File_Transfer_Exception

Definition at line 1113 of file Abstract.php.

1114  {
1115  if (null === $translator) {
1116  $this->_translator = null;
1117  } elseif ($translator instanceof Zend_Translate_Adapter) {
1118  $this->_translator = $translator;
1119  } elseif ($translator instanceof Zend_Translate) {
1120  $this->_translator = $translator->getAdapter();
1121  } else {
1122  #require_once 'Zend/File/Transfer/Exception.php';
1123  throw new Zend_File_Transfer_Exception('Invalid translator specified');
1124  }
1125 
1126  return $this;
1127  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17

◆ setValidators()

setValidators ( array  $validators,
  $files = null 
)

Sets a validator for the class, erasing all previous set

Parameters
string | array$validatorValidator to set
string | array$filesFiles to limit this validator to
Returns
Zend_File_Transfer_Adapter

Definition at line 447 of file Abstract.php.

448  {
449  $this->clearValidators();
450  return $this->addValidators($validators, $files);
451  }
addValidators(array $validators, $files=null)
Definition: Abstract.php:379
foreach($appDirs as $dir) $files

◆ translatorIsDisabled()

translatorIsDisabled ( )

Is translation disabled?

Returns
bool

Definition at line 1160 of file Abstract.php.

1161  {
1163  }

Field Documentation

◆ $_break

$_break = array()
protected

Definition at line 44 of file Abstract.php.

◆ $_files

$_files = array()
protected

Definition at line 101 of file Abstract.php.

◆ $_filters

$_filters = array()
protected

Definition at line 51 of file Abstract.php.

◆ $_loaders

$_loaders = array()
protected

Definition at line 58 of file Abstract.php.

◆ $_messages

$_messages = array()
protected

Definition at line 65 of file Abstract.php.

◆ $_options

$_options
protected
Initial value:
= array(
'ignoreNoFile' => false,
'useByteString' => true,
'magicFile' => null,
'detectInfos' => true,
)

Available options for file transfers

Definition at line 112 of file Abstract.php.

◆ $_tmpDir

$_tmpDir
protected

Definition at line 107 of file Abstract.php.

◆ $_translator

$_translator
protected

Definition at line 70 of file Abstract.php.

◆ $_translatorDisabled

$_translatorDisabled = false
protected

Definition at line 77 of file Abstract.php.

◆ $_validators

$_validators = array()
protected

Definition at line 83 of file Abstract.php.

◆ FILTER

const FILTER = 'FILTER'

+ Plugin loader Constants

Definition at line 35 of file Abstract.php.

◆ VALIDATE

const VALIDATE = 'VALIDATE'

Definition at line 36 of file Abstract.php.


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