Source for file helper.php
Documentation is available at helper.php
* @package Joomla.Platform
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* Holds support functions for the filesystem, particularly the stream
* @package Joomla.Platform
* Remote file size function for streams that don't support it
* @param string $url TODO Add text
* @see http://www.php.net/manual/en/function.filesize.php#71098
if (($sch !=
'http') &&
($sch !=
'https') &&
($sch !=
'ftp') &&
($sch !=
'ftps'))
if (($sch ==
'http') ||
($sch ==
'https'))
return $headers['Content-Length'];
if (($sch ==
'ftp') ||
($sch ==
'ftps'))
if ((!$server) ||
(!$path))
$ftpid =
ftp_ssl_connect($server, $port);
* @param string $url Link identifier
* @param integer $mode The new permissions, given as an octal value.
* @see http://www.php.net/manual/en/function.ftp-chmod.php
public static function ftpChmod($url, $mode)
if (($sch !=
'ftp') &&
($sch !=
'ftps'))
if ((!$server) ||
(!$path))
$ftpid =
ftp_ssl_connect($server, $port);
* Modes that require a write operation
return array('w', 'w+', 'a', 'a+', 'r+', 'x', 'x+');
* Stream and Filter Support Operations
* Returns the supported streams, in addition to direct file access
* Also includes Joomla! streams as well as PHP streams
// Really quite cool what php can do with arrays when you let it...
* Returns a list of transports
* Returns a list of filters
// Note: This will look like the getSupported() function with J! filters.
// TODO: add user space filter loading like user space stream loading
* Returns a list of J! streams
static $streams =
array();
$files =
new DirectoryIterator(__DIR__ .
'/streams');
foreach ($files as $file)
$filename =
$file->getFilename();
// Only load for php files.
// Note: DirectoryIterator::getExtension only available PHP >= 5.3.6
if (!$file->isFile() ||
substr($filename, strrpos($filename, '.') +
1) !=
'php')
$streams[] =
$file->getBasename('.php');
* Determine if a stream is a Joomla stream.
* @param string $streamname The name of a stream
* @return boolean True for a Joomla Stream
return in_array($streamname, self::getJStreams());
Documentation generated on Tue, 19 Nov 2013 15:04:30 +0100 by phpDocumentor 1.4.3