Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Preparing for version 12.2

  • Loading branch information...
commit 5a484169a67f928f6d84120655cad321aad3dd16 1 parent 0aca112
@chdemko authored
Showing with 329 additions and 325 deletions.
  1. +32 −32 libraries/joomla/filesystem/accessor.php
  2. +4 −13 libraries/joomla/filesystem/accessor/character.php
  3. +5 −5 libraries/joomla/filesystem/accessor/contents.php
  4. +10 −16 libraries/joomla/filesystem/accessor/csv.php
  5. +4 −13 libraries/joomla/filesystem/accessor/formatted.php
  6. +4 −4 libraries/joomla/filesystem/accessor/ini.php
  7. +9 −6 libraries/joomla/filesystem/accessor/json.php
  8. +6 −22 libraries/joomla/filesystem/accessor/line.php
  9. +9 −6 libraries/joomla/filesystem/accessor/serializable.php
  10. +3 −3 libraries/joomla/filesystem/accessor/xml.php
  11. +44 −44 libraries/joomla/filesystem/element.php
  12. +10 −10 libraries/joomla/filesystem/element/directory.php
  13. +19 −19 libraries/joomla/filesystem/element/directory/contents.php
  14. +9 −9 libraries/joomla/filesystem/element/directory/directories.php
  15. +11 −11 libraries/joomla/filesystem/element/directory/files.php
  16. +49 −32 libraries/joomla/filesystem/element/file.php
  17. +9 −12 libraries/joomla/filesystem/element/file/iterator.php
  18. +9 −9 libraries/joomla/filesystem/filesystem.php
  19. +3 −0  phpunit.xml.dist
  20. +1 −1  tests/core/case/filesystem.php
  21. +1 −1  tests/core/case/filesystem/accessor/line.php
  22. +10 −12 tests/core/case/filesystem/element/file.php
  23. +1 −1  tests/suites/filesystem/ftp/JFilesystemAccessorTest.php
  24. +1 −1  tests/suites/filesystem/ftp/accessor/JFilesystemAccessorCharacterTest.php
  25. +1 −1  tests/suites/filesystem/ftp/accessor/JFilesystemAccessorContentsTest.php
  26. +1 −1  tests/suites/filesystem/ftp/accessor/JFilesystemAccessorCsvTest.php
  27. +1 −1  tests/suites/filesystem/ftp/accessor/JFilesystemAccessorFormattedTest.php
  28. +1 −1  tests/suites/filesystem/ftp/accessor/JFilesystemAccessorIniTest.php
  29. +1 −1  tests/suites/filesystem/ftp/accessor/JFilesystemAccessorJsonTest.php
  30. +1 −1  tests/suites/filesystem/ftp/accessor/JFilesystemAccessorLineTest.php
  31. +1 −1  tests/suites/filesystem/ftp/accessor/JFilesystemAccessorSerializableTest.php
  32. +1 −1  tests/suites/filesystem/ftp/accessor/JFilesystemAccessorXmlTest.php
  33. +1 −1  tests/suites/filesystem/ftp/element/JFilesystemElementDirectoryTest.php
  34. +1 −1  tests/suites/filesystem/ftp/element/JFilesystemElementFileTest.php
  35. +1 −1  tests/suites/unit/joomla/filesystem/JFilesystemAccessorTest.php
  36. +7 −7 tests/suites/unit/joomla/filesystem/JFilesystemTest.php
  37. +1 −1  tests/suites/unit/joomla/filesystem/accessor/JFilesystemAccessorCharacterTest.php
  38. +2 −2 tests/suites/unit/joomla/filesystem/accessor/JFilesystemAccessorContentsTest.php
  39. +1 −1  tests/suites/unit/joomla/filesystem/accessor/JFilesystemAccessorCsvTest.php
  40. +1 −1  tests/suites/unit/joomla/filesystem/accessor/JFilesystemAccessorFormattedTest.php
  41. +1 −1  tests/suites/unit/joomla/filesystem/accessor/JFilesystemAccessorIniTest.php
  42. +1 −1  tests/suites/unit/joomla/filesystem/accessor/JFilesystemAccessorJsonTest.php
  43. +1 −1  tests/suites/unit/joomla/filesystem/accessor/JFilesystemAccessorLineTest.php
  44. +1 −1  tests/suites/unit/joomla/filesystem/accessor/JFilesystemAccessorSerializableTest.php
  45. +1 −1  tests/suites/unit/joomla/filesystem/accessor/JFilesystemAccessorXmlTest.php
  46. +2 −2 tests/suites/unit/joomla/filesystem/element/JFilesystemElementDirectoryTest.php
  47. +36 −13 tests/suites/unit/joomla/filesystem/element/JFilesystemElementFileTest.php
View
64 libraries/joomla/filesystem/accessor.php
@@ -16,42 +16,42 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemAccessor
{
/**
* @var array Array of readers
*
- * @since 12.1
+ * @since 12.2
*/
protected static $readers = array();
/**
* @var array Array of writers
*
- * @since 12.1
+ * @since 12.2
*/
protected static $writers = array();
/**
* @var array Array of pullers
*
- * @since 12.1
+ * @since 12.2
*/
protected static $pullers = array();
/**
* @var array Array of pushers
*
- * @since 12.1
+ * @since 12.2
*/
protected static $pushers = array();
/**
* @var array Array of accessors
*
- * @since 12.1
+ * @since 12.2
*/
protected static $accessors = array();
@@ -63,7 +63,7 @@
*
* @return mixed The data read.
*
- * @since 12.1
+ * @since 12.2
*/
public static function read($name, $args)
{
@@ -78,7 +78,7 @@ public static function read($name, $args)
*
* @return int|FALSE The number of bytes written, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
public static function write($name, $args)
{
@@ -93,7 +93,7 @@ public static function write($name, $args)
*
* @return mixed The data read.
*
- * @since 12.1
+ * @since 12.2
*/
public static function pull($name, $args)
{
@@ -108,7 +108,7 @@ public static function pull($name, $args)
*
* @return int|FALSE The number of bytes written, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
public static function push($name, $args)
{
@@ -124,7 +124,7 @@ public static function push($name, $args)
*
* @return mixed
*
- * @since 12.1
+ * @since 12.2
*/
protected static function call($type, $name, $args)
{
@@ -191,7 +191,7 @@ protected static function call($type, $name, $args)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function registerAccessor($name, $className)
{
@@ -206,7 +206,7 @@ public static function registerAccessor($name, $className)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function registerReader($name, $function)
{
@@ -221,7 +221,7 @@ public static function registerReader($name, $function)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function registerWriter($name, $function)
{
@@ -236,7 +236,7 @@ public static function registerWriter($name, $function)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function registerPuller($name, $function)
{
@@ -251,7 +251,7 @@ public static function registerPuller($name, $function)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function registerPusher($name, $function)
{
@@ -265,7 +265,7 @@ public static function registerPusher($name, $function)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function unregisterAccessor($name)
{
@@ -279,7 +279,7 @@ public static function unregisterAccessor($name)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function unregisterReader($name)
{
@@ -293,7 +293,7 @@ public static function unregisterReader($name)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function unregisterWriter($name)
{
@@ -307,7 +307,7 @@ public static function unregisterWriter($name)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function unregisterPuller($name)
{
@@ -321,7 +321,7 @@ public static function unregisterPuller($name)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function unregisterPusher($name)
{
@@ -335,7 +335,7 @@ public static function unregisterPusher($name)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function isAccessor($name)
{
@@ -349,7 +349,7 @@ public static function isAccessor($name)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function isReader($name)
{
@@ -363,7 +363,7 @@ public static function isReader($name)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function isWriter($name)
{
@@ -377,7 +377,7 @@ public static function isWriter($name)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function isPuller($name)
{
@@ -391,7 +391,7 @@ public static function isPuller($name)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public static function isPusher($name)
{
@@ -405,7 +405,7 @@ public static function isPusher($name)
*
* @return string Class registered
*
- * @since 12.1
+ * @since 12.2
*/
public static function getAccessor($name)
{
@@ -419,7 +419,7 @@ public static function getAccessor($name)
*
* @return callable The function registered
*
- * @since 12.1
+ * @since 12.2
*/
public static function getReader($name)
{
@@ -433,7 +433,7 @@ public static function getReader($name)
*
* @return callable The function registered
*
- * @since 12.1
+ * @since 12.2
*/
public static function getWriter($name)
{
@@ -447,7 +447,7 @@ public static function getWriter($name)
*
* @return callable The function registered
*
- * @since 12.1
+ * @since 12.2
*/
public static function getPuller($name)
{
@@ -461,7 +461,7 @@ public static function getPuller($name)
*
* @return callable The function registered
*
- * @since 12.1
+ * @since 12.2
*/
public static function getPusher($name)
{
@@ -475,7 +475,7 @@ public static function getPusher($name)
*
* @return array array($prefix, $suffix).
*
- * @since 12.1
+ * @since 12.2
*/
protected static function extract($name)
{
View
17 libraries/joomla/filesystem/accessor/character.php
@@ -16,7 +16,7 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemAccessorCharacter
{
@@ -29,20 +29,11 @@
*
* @link http://php.net/manual/en/function.fgetc.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function read(JFilesystemElementFile $file)
{
- $return = fgetc($file->handle);
- if ($return === false)
- {
- $file->valid = false;
- return false;
- }
- else
- {
- return $return;
- }
+ return fgetc($file->handle);
}
/**
@@ -55,7 +46,7 @@ public static function read(JFilesystemElementFile $file)
*
* @see JFilesystemAccessorContents::write
*
- * @since 12.1
+ * @since 12.2
*/
public static function write(JFilesystemElementFile $file, $character)
{
View
10 libraries/joomla/filesystem/accessor/contents.php
@@ -16,7 +16,7 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemAccessorContents
{
@@ -30,7 +30,7 @@
*
* @link http://php.net/manual/en/function.fread.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function read(JFilesystemElementFile $file, $length)
{
@@ -48,7 +48,7 @@ public static function read(JFilesystemElementFile $file, $length)
*
* @link http://php.net/manual/en/function.fwrite.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function write(JFilesystemElementFile $file, $data, $length = null)
{
@@ -73,7 +73,7 @@ public static function write(JFilesystemElementFile $file, $data, $length = null
*
* @link http://php.net/manual/en/function.file-get-contents.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function pull(JFilesystemElementFile $file, $offset = -1, $maxlen = null)
{
@@ -100,7 +100,7 @@ public static function pull(JFilesystemElementFile $file, $offset = -1, $maxlen
*
* @link http://php.net/manual/en/function.file-put-contents.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function push(JFilesystemElementFile $file, $data, $flags = 0)
{
View
26 libraries/joomla/filesystem/accessor/csv.php
@@ -16,7 +16,7 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemAccessorCsv
{
@@ -33,20 +33,11 @@
*
* @link http://php.net/manual/en/function.fgetcsv.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function read(JFilesystemElementFile $file, $length = 0, $delimiter = ',', $enclosure = '"', $escape = '\\')
{
- $return = fgetcsv($file->handle, $length, $delimiter, $enclosure, $escape);
- if ($return === false)
- {
- $file->valid = false;
- return false;
- }
- else
- {
- return $return;
- }
+ return fgetcsv($file->handle, $length, $delimiter, $enclosure, $escape);
}
/**
@@ -61,7 +52,7 @@ public static function read(JFilesystemElementFile $file, $length = 0, $delimite
*
* @link http://php.net/manual/en/function.fputcsv.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function write(JFilesystemElementFile $file, $fields, $delimiter = ',', $enclosure = '"')
{
@@ -81,7 +72,7 @@ public static function write(JFilesystemElementFile $file, $fields, $delimiter =
*
* @link http://php.net/manual/en/function.fgetcsv.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function pull(JFilesystemElementFile $file, $length = 0, $delimiter = ',', $enclosure = '"', $escape = '\\')
{
@@ -89,7 +80,10 @@ public static function pull(JFilesystemElementFile $file, $length = 0, $delimite
$file->open('r');
foreach ($file->iterateCsv($length, $delimiter, $enclosure, $escape) as $csv)
{
- $array[] = $csv;
+ if (is_array($csv))
+ {
+ $array[] = $csv;
+ }
}
$file->close();
return $array;
@@ -107,7 +101,7 @@ public static function pull(JFilesystemElementFile $file, $length = 0, $delimite
*
* @link http://php.net/manual/en/function.fputcsv.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function push(JFilesystemElementFile $file, $data, $delimiter = ',', $enclosure = '"')
{
View
17 libraries/joomla/filesystem/accessor/formatted.php
@@ -16,7 +16,7 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemAccessorFormatted
{
@@ -30,20 +30,11 @@
*
* @link http://php.net/manual/en/function.fscanf.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function read(JFilesystemElementFile $file, $format)
{
- $v = fscanf($file->handle, $format);
- if (!is_array($v))
- {
- $file->valid = false;
- return false;
- }
- else
- {
- return $v;
- }
+ return fscanf($file->handle, $format);
}
/**
@@ -56,7 +47,7 @@ public static function read(JFilesystemElementFile $file, $format)
*
* @link http://php.net/manual/en/function.fwrite.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function write(JFilesystemElementFile $file, $format)
{
View
8 libraries/joomla/filesystem/accessor/ini.php
@@ -16,7 +16,7 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemAccessorIni
{
@@ -32,7 +32,7 @@
*
* @link http://php.net/manual/en/function.parse-ini-file.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function pull(JFilesystemElementFile $file, $process_sections = false, $scanner_mode = INI_SCANNER_NORMAL)
{
@@ -49,7 +49,7 @@ public static function pull(JFilesystemElementFile $file, $process_sections = fa
*
* @see JFilesystemElementAccessorLine::write
*
- * @since 12.1
+ * @since 12.2
*/
public static function push(JFilesystemElementFile $file, $ini)
{
@@ -112,7 +112,7 @@ public static function push(JFilesystemElementFile $file, $ini)
*
* @see JFilesystemElementAccessorLine::write
*
- * @since 12.1
+ * @since 12.2
*/
public static function writeEntry(JFilesystemElementFile $file, $key, $value)
{
View
15 libraries/joomla/filesystem/accessor/json.php
@@ -16,7 +16,7 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemAccessorJson
{
@@ -33,7 +33,7 @@
*
* @see JFilesystemAccessorLine::read
*
- * @since 12.1
+ * @since 12.2
*/
public static function read(JFilesystemElementFile $file, $assoc = false, $depth = 512)
{
@@ -64,7 +64,7 @@ public static function read(JFilesystemElementFile $file, $assoc = false, $depth
*
* @see JFilesystemAccessorLine::write
*
- * @since 12.1
+ * @since 12.2
*/
public static function write(JFilesystemElementFile $file, $value, $options = 0)
{
@@ -82,7 +82,7 @@ public static function write(JFilesystemElementFile $file, $value, $options = 0)
*
* @link http://php.net/manual/en/function.json-decode.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function pull(JFilesystemElementFile $file, $assoc = false, $depth = 512)
{
@@ -90,7 +90,10 @@ public static function pull(JFilesystemElementFile $file, $assoc = false, $depth
$file->open('r');
foreach ($file->iterateJson($assoc, $depth) as $json)
{
- $array[] = $json;
+ if (is_object($json) || is_array($json))
+ {
+ $array[] = $json;
+ }
}
$file->close();
return $array;
@@ -111,7 +114,7 @@ public static function pull(JFilesystemElementFile $file, $assoc = false, $depth
* @link http://php.net/manual/en/function.file-put-contents.php
* @link http://php.net/manual/en/function.json-encode.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function push(JFilesystemElementFile $file, $data, $options = 0)
{
View
28 libraries/joomla/filesystem/accessor/line.php
@@ -16,7 +16,7 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemAccessorLine
{
@@ -30,7 +30,7 @@
*
* @link http://php.net/manual/en/function.fgets.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function read(JFilesystemElementFile $file, $length = null)
{
@@ -42,23 +42,7 @@ public static function read(JFilesystemElementFile $file, $length = null)
{
$return = fgets($file->handle, $length);
}
-
- if ($return === false)
- {
- $file->valid = false;
- return false;
- }
- else
- {
- if ($return[strlen($return) - 1] == "\n")
- {
- return substr($return, 0, strlen($return) - 1);
- }
- else
- {
- return $return;
- }
- }
+ return $return;
}
/**
@@ -72,7 +56,7 @@ public static function read(JFilesystemElementFile $file, $length = null)
*
* @see JFilesystemAccessorContents::write
*
- * @since 12.1
+ * @since 12.2
*/
public static function write(JFilesystemElementFile $file, $data, $length = null)
{
@@ -94,7 +78,7 @@ public static function write(JFilesystemElementFile $file, $data, $length = null
*
* @return array|FALSE The lines, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
public static function pull(JFilesystemElementFile $file, $length = null)
{
@@ -127,7 +111,7 @@ public static function pull(JFilesystemElementFile $file, $length = null)
*
* @return int|FALSE The number of bytes written, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
public static function push(JFilesystemElementFile $file, $data, $length = null)
{
View
15 libraries/joomla/filesystem/accessor/serializable.php
@@ -16,7 +16,7 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemAccessorSerializable
{
@@ -31,7 +31,7 @@
*
* @see JFilesystemAccessorLine::read
*
- * @since 12.1
+ * @since 12.2
*/
public static function read(JFilesystemElementFile $file)
{
@@ -58,7 +58,7 @@ public static function read(JFilesystemElementFile $file)
*
* @see JFilesystemAccessorLine::write
*
- * @since 12.1
+ * @since 12.2
*/
public static function write(JFilesystemElementFile $file, $serializable)
{
@@ -72,7 +72,7 @@ public static function write(JFilesystemElementFile $file, $serializable)
*
* @return array The unserialized data
*
- * @since 12.1
+ * @since 12.2
*/
public static function pull(JFilesystemElementFile $file)
{
@@ -80,7 +80,10 @@ public static function pull(JFilesystemElementFile $file)
$file->open('r');
foreach ($file->iterateSerializable() as $unserialized)
{
- $array[] = $unserialized;
+ if ($unserialized !== false)
+ {
+ $array[] = $unserialized;
+ }
}
$file->close();
return $array;
@@ -94,7 +97,7 @@ public static function pull(JFilesystemElementFile $file)
*
* @return int|FALSE The number of bytes written, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
public static function push(JFilesystemElementFile $file, $data)
{
View
6 libraries/joomla/filesystem/accessor/xml.php
@@ -16,7 +16,7 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemAccessorXml
{
@@ -33,7 +33,7 @@
*
* @link http://php.net/manual/en/function.simplexml-load-file.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function pull(JFilesystemElementFile $file, $class_name = 'SimpleXMLElement', $options = 0, $ns = '', $is_prefix = false)
{
@@ -51,7 +51,7 @@ public static function pull(JFilesystemElementFile $file, $class_name = 'SimpleX
* @link http://php.net/manual/en/function.file-put-contents.php
* @link http://php.net/manual/en/simplexmlelement.asxml.php
*
- * @since 12.1
+ * @since 12.2
*/
public static function push(JFilesystemElementFile $file, SimpleXMLElement $xml)
{
View
88 libraries/joomla/filesystem/element.php
@@ -41,42 +41,42 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
abstract class JFilesystemElement
{
/**
* @var array Array of instances
*
- * @since 12.1
+ * @since 12.2
*/
protected static $instances = array();
/**
* @var string Element signature
*
- * @since 12.1
+ * @since 12.2
*/
private $_signature;
/**
* @var string Element path
*
- * @since 12.1
+ * @since 12.2
*/
private $_path;
/**
* @var string Element full path
*
- * @since 12.1
+ * @since 12.2
*/
private $_fullpath;
/**
* @var JFilesystem Element file system
*
- * @since 12.1
+ * @since 12.2
*/
private $_system;
@@ -103,7 +103,7 @@
* @param JFilesystem $system Element file system
* @param string $signature Signature
*
- * @since 12.1
+ * @since 12.2
*/
protected function __construct($path, $fullpath, JFilesystem $system, $signature)
{
@@ -122,7 +122,7 @@ protected function __construct($path, $fullpath, JFilesystem $system, $signature
*
* @throw Exception
*
- * @since 12.1
+ * @since 12.2
*/
public function __get($property)
{
@@ -175,7 +175,7 @@ public function __get($property)
*
* @link http://php.net/manual/en/function.clearstatcache.php
*
- * @since 12.1
+ * @since 12.2
*/
public function __set($property, $value)
{
@@ -210,7 +210,7 @@ public function __set($property, $value)
*
* @throw Exception
*
- * @since 12.1
+ * @since 12.2
*/
public function __call($method, $args)
{
@@ -222,7 +222,7 @@ public function __call($method, $args)
*
* @return string Return full path
*
- * @since 12.1
+ * @since 12.2
*/
public function __toString()
{
@@ -239,7 +239,7 @@ public function __toString()
*
* @throw Exception
*
- * @since 12.1
+ * @since 12.2
*/
public function callHandleError($method, array $args = array())
{
@@ -301,7 +301,7 @@ public static function errorHandler($errno , $errstr, $errfile, $errline)
*
* @throw RuntimeException
*
- * @since 12.1
+ * @since 12.2
*/
public static function getInstance($path, JFilesystem $system = null)
{
@@ -337,7 +337,7 @@ public static function getInstance($path, JFilesystem $system = null)
*
* @link http://php.net/manual/en/function.basename.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getName()
{
@@ -351,7 +351,7 @@ protected function getName()
*
* @link http://php.net/manual/en/function.basename.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getBasename()
{
@@ -373,7 +373,7 @@ protected function getBasename()
*
* @link http://php.net/manual/en/function.dirname.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getDirpath()
{
@@ -387,7 +387,7 @@ protected function getDirpath()
*
* @link http://php.net/manual/en/function.pathinfo.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getExtension()
{
@@ -401,7 +401,7 @@ protected function getExtension()
*
* @link http://php.net/manual/en/function.realpath.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getRealpath()
{
@@ -415,7 +415,7 @@ protected function getRealpath()
*
* @link http://php.net/manual/en/function.file-exists.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getExists()
{
@@ -429,7 +429,7 @@ protected function getExists()
*
* @link http://php.net/manual/en/function.fileatime.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getAccessTime()
{
@@ -443,7 +443,7 @@ protected function getAccessTime()
*
* @link http://php.net/manual/en/function.filectime.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getChangeTime()
{
@@ -457,7 +457,7 @@ protected function getChangeTime()
*
* @link http://php.net/manual/en/function.filemtime.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getModificationTime()
{
@@ -471,7 +471,7 @@ protected function getModificationTime()
*
* @link http://php.net/manual/en/function.filegroup.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getGroup()
{
@@ -485,7 +485,7 @@ protected function getGroup()
*
* @link http://php.net/manual/en/function.fileowner.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getOwner()
{
@@ -499,7 +499,7 @@ protected function getOwner()
*
* @link http://php.net/manual/en/function.fileperms.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getPermissions()
{
@@ -524,7 +524,7 @@ protected function getPermissions()
*
* @link http://php.net/manual/en/function.filesize.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getSize()
{
@@ -538,7 +538,7 @@ protected function getSize()
*
* @link http://php.net/manual/en/function.is-dir.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getIsDir()
{
@@ -552,7 +552,7 @@ protected function getIsDir()
*
* @link http://php.net/manual/en/function.is-file.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getIsFile()
{
@@ -566,7 +566,7 @@ protected function getIsFile()
*
* @link http://php.net/manual/en/function.is-link.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getIsLink()
{
@@ -580,7 +580,7 @@ protected function getIsLink()
*
* @link http://php.net/manual/en/function.is-readable.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getIsReadable()
{
@@ -594,7 +594,7 @@ protected function getIsReadable()
*
* @link http://php.net/manual/en/function.is-writable.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getIsWritable()
{
@@ -608,7 +608,7 @@ protected function getIsWritable()
*
* @link http://php.net/manual/en/function.readlink.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getLink()
{
@@ -625,7 +625,7 @@ protected function getLink()
* @link http://php.net/manual/en/function.filegroup.php
* @link http://php.net/manual/en/function.chgrp.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function setGroup($group)
{
@@ -663,7 +663,7 @@ protected function setGroup($group)
* @link http://php.net/manual/en/function.fileowner.php
* @link http://php.net/manual/en/function.chown.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function setOwner($owner)
{
@@ -701,7 +701,7 @@ protected function setOwner($owner)
* @link http://php.net/manual/en/function.fileperms.php
* @link http://php.net/manual/en/function.chmod.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function setPermissions($permissions)
{
@@ -718,7 +718,7 @@ protected function setPermissions($permissions)
* @link http://php.net/manual/en/function.fileperms.php
* @link http://php.net/manual/en/function.chmod.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function affectPermissions($permissions)
{
@@ -758,7 +758,7 @@ protected function affectPermissions($permissions)
*
* @return int The new permissions
*
- * @since 12.1
+ * @since 12.2
*/
protected static function newPermissions($permissions, $operation)
{
@@ -852,7 +852,7 @@ protected static function newPermissions($permissions, $operation)
*
* @link http://php.net/manual/en/function.symlink.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function setLink($link)
{
@@ -866,7 +866,7 @@ protected function setLink($link)
*
* @return bool TRUE on success, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
protected function setPath($path)
{
@@ -897,7 +897,7 @@ protected function setPath($path)
*
* @return bool TRUE on success, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
protected function setDirpath($dirpath)
{
@@ -911,7 +911,7 @@ protected function setDirpath($dirpath)
*
* @return bool TRUE on success, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
protected function setName($name)
{
@@ -925,7 +925,7 @@ protected function setName($name)
*
* @return bool TRUE on success, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
protected function setBasename($basename)
{
@@ -947,7 +947,7 @@ protected function setBasename($basename)
*
* @return bool TRUE on success, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
protected function setExtension($extension)
{
@@ -968,7 +968,7 @@ protected function setExtension($extension)
*
* @return void.
*
- * @since 12.1
+ * @since 12.2
*/
protected static function cleanpath($path)
{
View
20 libraries/joomla/filesystem/element/directory.php
@@ -24,7 +24,7 @@
*
* @package Joomla.Platform
* @subpackage FileSystem
- * @since 12.1
+ * @since 12.2
*/
class JFilesystemElementDirectory extends JFilesystemElement
{
@@ -40,7 +40,7 @@ class JFilesystemElementDirectory extends JFilesystemElement
* @param JFilesystem $system Element file system
* @param string $signature Signature
*
- * @since 12.1
+ * @since 12.2
*/
protected function __construct($path, JFilesystem $system, $signature)
{
@@ -63,7 +63,7 @@ protected function __construct($path, JFilesystem $system, $signature)
*
* @throw Exception
*
- * @since 12.1
+ * @since 12.2
*/
public function __get($property)
{
@@ -91,7 +91,7 @@ public function __get($property)
*
* @throw Exception
*
- * @since 12.1
+ * @since 12.2
*/
public function __call($method, $args)
{
@@ -134,7 +134,7 @@ public function __call($method, $args)
*
* @link http://php.net/manual/en/function.mkdir.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function create($permissions = null)
{
@@ -161,7 +161,7 @@ protected function create($permissions = null)
*
* @return RecursiveIteratorIterator Iterator on files.
*
- * @since 12.1
+ * @since 12.2
*/
protected function items($type, $mode, array $options = array())
{
@@ -194,7 +194,7 @@ protected function items($type, $mode, array $options = array())
* @link http://php.net/manual/en/function.rmdir.php
* @link http://php.net/manual/en/function.unlink.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function delete()
{
@@ -228,7 +228,7 @@ protected function delete()
* @link http://php.net/manual/en/function.fileperms.php
* @link http://php.net/manual/en/function.chmod.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function setPermissions($permissions)
{
@@ -302,7 +302,7 @@ protected function setPermissions($permissions)
*
* @return int|FALSE The number of bytes that were written to the file, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
protected function copyFromFile(JFilesystemElementFile $src)
{
@@ -320,7 +320,7 @@ protected function copyFromFile(JFilesystemElementFile $src)
*
* @return int|FALSE The number of bytes that were written to the files, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
protected function copy(JFilesystemElementDirectory $dest)
{
View
38 libraries/joomla/filesystem/element/directory/contents.php
@@ -16,63 +16,63 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
class JFilesystemElementDirectoryContents implements RecursiveIterator
{
/**
* Iterate in depth first mode
*
- * @since 12.1
+ * @since 12.2
*/
const DEPTH_FIRST = -1;
/**
* Iterate in breadth first mode
*
- * @since 12.1
+ * @since 12.2
*/
const BREADTH_FIRST = 1;
/**
* @var string Original path
*
- * @since 12.1
+ * @since 12.2
*/
private $_path;
/**
* @var JFilesystem File system
*
- * @since 12.1
+ * @since 12.2
*/
private $_system;
/**
* @var array Array of options
*
- * @since 12.1
+ * @since 12.2
*/
private $_options;
/**
* @var array Array of entries
*
- * @since 12.1
+ * @since 12.2
*/
private $_entries = array();
/**
* @var function Compare function
*
- * @since 12.1
+ * @since 12.2
*/
private $_compare = null;
/**
* @var int Either JFilesystemElementDirectoryContents::DEPTH_FIRST|BREADTH_FIRST
*
- * @since 12.1
+ * @since 12.2
*/
private $_mode = self::BREADTH_FIRST;
@@ -84,7 +84,7 @@ class JFilesystemElementDirectoryContents implements RecursiveIterator
* @param JFilesystem $system File system
* @param array $options Array of options
*
- * @since 12.1
+ * @since 12.2
*/
public function __construct($path, $relative, $system, array $options = array())
{
@@ -122,7 +122,7 @@ public function __construct($path, $relative, $system, array $options = array())
*
* @return int Negative, 0 or positive
*
- * @since 12.1
+ * @since 12.2
*/
private function _compare($a, $b)
{
@@ -175,7 +175,7 @@ private function _compare($a, $b)
*
* @throw InvalidArgumentException
*
- * @since 12.1
+ * @since 12.2
*/
public function __get($property)
{
@@ -204,7 +204,7 @@ public function __get($property)
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public function rewind()
{
@@ -216,7 +216,7 @@ public function rewind()
*
* @return string Directory pathname
*
- * @since 12.1
+ * @since 12.2
*/
public function key()
{
@@ -228,7 +228,7 @@ public function key()
*
* @return void
*
- * @since 12.1
+ * @since 12.2
*/
public function next()
{
@@ -240,7 +240,7 @@ public function next()
*
* @return string Directory name
*
- * @since 12.1
+ * @since 12.2
*/
public function current()
{
@@ -252,7 +252,7 @@ public function current()
*
* @return bool TRUE on success, or FALSE on failure
*
- * @since 12.1
+ * @since 12.2
*/
public function valid()
{
@@ -264,7 +264,7 @@ public function valid()
*
* @return bool TRUE on success, or FALSE on failure
*
- * @since 12.1
+ * @since 12.2
*/
public function hasChildren()
{
@@ -276,7 +276,7 @@ public function hasChildren()
*
* @return JFilesystemElementDirectoryContents new iterator
*
- * @since 12.1
+ * @since 12.2
*/
public function getChildren()
{
View
18 libraries/joomla/filesystem/element/directory/directories.php
@@ -16,35 +16,35 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
class JFilesystemElementDirectoryDirectories extends RecursiveFilterIterator
{
/**
* @var string regex filter
*
- * @since 12.1
+ * @since 12.2
*/
private $_filter;
/**
* @var string regex exclude filter
*
- * @since 12.1
+ * @since 12.2
*/
private $_exclude;
/**
* @var function function accepting a directory
*
- * @since 12.1
+ * @since 12.2
*/
private $_accept = null;
/**
* @var array Array of options
*
- * @since 12.1
+ * @since 12.2
*/
private $_options;
@@ -53,7 +53,7 @@ class JFilesystemElementDirectoryDirectories extends RecursiveFilterIterator
*
* @return bool TRUE on success, FALSE on failure
*
- * @since 12.1
+ * @since 12.2
*/
public function accept()
{
@@ -76,7 +76,7 @@ public function accept()
*
* @return JFilesystemElementDirectoryDirectories new iterator
*
- * @since 12.1
+ * @since 12.2
*/
public function getChildren()
{
@@ -88,7 +88,7 @@ public function getChildren()
*
* @return JFilesystemElementDirectory Directory object
*
- * @since 12.1
+ * @since 12.2
*/
public function current()
{
@@ -101,7 +101,7 @@ public function current()
* @param JFilesystemElementDirectoryContents $iterator Directory iterator
* @param array $options Array of options
*
- * @since 12.1
+ * @since 12.2
*/
public function __construct($iterator, array $options = array())
{
View
22 libraries/joomla/filesystem/element/directory/files.php
@@ -16,49 +16,49 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
class JFilesystemElementDirectoryFiles extends RecursiveFilterIterator
{
/**
* @var string regex filter
*
- * @since 12.1
+ * @since 12.2
*/
private $_filter;
/**
* @var string regex exclude filter
*
- * @since 12.1
+ * @since 12.2
*/
private $_exclude;
/**
* @var string regex directory filter
*
- * @since 12.1
+ * @since 12.2
*/
private $_filter_directory;
/**
* @var string regex directory exclude filter
*
- * @since 12.1
+ * @since 12.2
*/
private $_exclude_directory;
/**
* @var function function accepting a file
*
- * @since 12.1
+ * @since 12.2
*/
private $_accept = null;
/**
* @var array Array of options
*
- * @since 12.1
+ * @since 12.2
*/
private $_options;
@@ -67,7 +67,7 @@ class JFilesystemElementDirectoryFiles extends RecursiveFilterIterator
*
* @return bool TRUE on success, FALSE on failure
*
- * @since 12.1
+ * @since 12.2
*/
public function accept()
{
@@ -92,7 +92,7 @@ public function accept()
*
* @return JFilesystemElementDirectoryDirectories new iterator
*
- * @since 12.1
+ * @since 12.2
*/
public function getChildren()
{
@@ -104,7 +104,7 @@ public function getChildren()
*
* @return JFilesystemElementFile File object
*
- * @since 12.1
+ * @since 12.2
*/
public function current()
{
@@ -117,7 +117,7 @@ public function current()
* @param JFilesystemElementDirectoryContents $iterator Directory iterator
* @param array $options Array of options
*
- * @since 12.1
+ * @since 12.2
*/
public function __construct($iterator, array $options = array())
{
View
81 libraries/joomla/filesystem/element/file.php
@@ -49,16 +49,11 @@
* @package Joomla.Platform
* @subpackage FileSystem
*
- * @since 12.1
+ * @since 12.2
*/
class JFilesystemElementFile extends JFilesystemElement
{
/**
- * @var bool Used by iterators on file
- */
- public $valid = true;
-
- /**
* @var resource|null The file handler or null if it not opened
*/
private $_handle;
@@ -80,7 +75,7 @@ class JFilesystemElementFile extends JFilesystemElement
* @param JFilesystem $system Element file system
* @param string $signature Signature
*
- * @since 12.1
+ * @since 12.2
*/
protected function __construct($path, JFilesystem $system, $signature)
{
@@ -97,7 +92,7 @@ protected function __construct($path, JFilesystem $system, $signature)
/**
* Destructor
*
- * @since 12.1
+ * @since 12.2
*/
public function __destruct()
{
@@ -118,7 +113,7 @@ public function __destruct()
*
* @throw Exception
*
- * @since 12.1
+ * @since 12.2
*/
public function __get($property)
{
@@ -158,7 +153,7 @@ public function __get($property)
*
* @throw Exception
*
- * @since 12.1
+ * @since 12.2
*/
public function __set($property, $value)
{
@@ -189,7 +184,7 @@ public function __set($property, $value)
*
* @throw Exception
*
- * @since 12.1
+ * @since 12.2
*/
public function __call($method, $args)
{
@@ -199,6 +194,7 @@ public function __call($method, $args)
case 'close':
case 'flush':
case 'truncate':
+ case 'lock':
case 'copy':
case 'copyFromFile':
case 'delete':
@@ -240,7 +236,7 @@ public function __call($method, $args)
*
* @throw RuntimeException
*
- * @since 12.1
+ * @since 12.2
*/
public static function getInstance($path, JFilesystem $system = null, $mode = null, $use_include_path = false)
{
@@ -255,7 +251,7 @@ public static function getInstance($path, JFilesystem $system = null, $mode = nu
*
* @return JFilesystemElementFile $this for chaining
*
- * @since 12.1
+ * @since 12.2
*/
protected function initialise($mode = null, $use_include_path = false)
{
@@ -273,7 +269,7 @@ protected function initialise($mode = null, $use_include_path = false)
* @link http://php.net/manual/en/function.fopen.php
* @link http://php.net/manual/en/function.fclose.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function open($mode)
{
@@ -307,7 +303,7 @@ protected function open($mode)
*
* @link http://php.net/manual/en/function.fclose.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function close()
{
@@ -324,7 +320,7 @@ protected function close()
*
* @link http://php.net/manual/en/function.fflush.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function flush()
{
@@ -341,7 +337,7 @@ protected function flush()
*
* @see JFilesystemAccessor::read
*
- * @since 12.1
+ * @since 12.2
*/
protected function read($name, $args)
{
@@ -358,7 +354,7 @@ protected function read($name, $args)
*
* @see JFilesystemAccessor::write
*
- * @since 12.1
+ * @since 12.2
*/
protected function write($name, $args)
{
@@ -375,7 +371,7 @@ protected function write($name, $args)
*
* @see JFilesystemAccessor::pull
*
- * @since 12.1
+ * @since 12.2
*/
protected function pull($name, $args)
{
@@ -392,7 +388,7 @@ protected function pull($name, $args)
*
* @see JFilesystemAccessor::push
*
- * @since 12.1
+ * @since 12.2
*/
protected function push($name, $args)
{
@@ -407,7 +403,7 @@ protected function push($name, $args)
*
* @return JFilesystemElementFileIterator
*
- * @since 12.1
+ * @since 12.2
*/
protected function iterate($name, $args)
{
@@ -423,7 +419,7 @@ protected function iterate($name, $args)
*
* @link http://php.net/manual/en/function.ftruncate.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function truncate($size)
{
@@ -431,13 +427,34 @@ protected function truncate($size)
}
/**
+ * Locks the file
+ *
+ * @param int $operation Either
+ * LOCK_SH to to acquire a shared lock (reader),
+ * LOCK_EX to acquire an exclusive lock (writer) or
+ * LOCK_UN to release a lock (shared or exclusive).
+ * @param int &$wouldblock The optional third argument is set to TRUE if the lock would block (EWOULDBLOCK errno condition).
+ * (not supported on Windows)
+ *
+ * @return bool TRUE on success, or FALSE on failure.
+ *
+ * @link http://php.net/manual/en/function.flock.php
+ *
+ * @since 12.2
+ */
+ protected function lock($operation, &$wouldblock = true)
+ {
+ return flock($this->_handle, $operation, $wouldblock);
+ }
+
+ /**
* Tests for end-of-file on a file pointer
*
* @return bool TRUE on success or FALSE on failure.
*
* @link http://php.net/manual/en/function.feof.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getEof()
{
@@ -451,7 +468,7 @@ protected function getEof()
*
* @link http://php.net/manual/en/function.ftell.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function getPosition()
{
@@ -467,7 +484,7 @@ protected function getPosition()
*
* @link http://php.net/manual/en/function.fseek.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function setPosition($offset)
{
@@ -508,7 +525,7 @@ protected function setPosition($offset)
*
* @return int|FALSE The number of bytes that were written to the file, or FALSE on failure.
*
- * @since 12.1
+ * @since 12.2
*/
protected function copy(JFilesystemElement $dest)
{
@@ -524,7 +541,7 @@ protected function copy(JFilesystemElement $dest)
*
* @link http://php.net/manual/en/function.stream-copy-to-stream.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function copyFromFile(JFilesystemElementFile $src)
{
@@ -543,7 +560,7 @@ protected function copyFromFile(JFilesystemElementFile $src)
*
* @link http://php.net/manual/en/function.delete.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function delete()
{
@@ -559,7 +576,7 @@ protected function delete()
*
* @link http://php.net/manual/en/function.touch.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function create()
{
@@ -582,7 +599,7 @@ protected function create()
*
* @link http://.php.net/manual/en/function.stream-filter-prepend.php
*
- * @since 12.1
+ * @since 12.2
*/
protected function prependFilter($filtername, $read_write = 0, $params = null)
{
@@ -601,7 +618,7 @@ protected function prependFilter($filtername, $read_write = 0, $params = null)
*
* @link http://.php.net/manual/en/function.stream-filter-append.php