Skip to content

Commit

Permalink
Fix classmap and wrapper names
Browse files Browse the repository at this point in the history
  • Loading branch information
fastslack committed Oct 11, 2017
1 parent 27a6d4b commit ba3b4c4
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 34 deletions.
12 changes: 12 additions & 0 deletions libraries/classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,15 @@
JLoader::registerAlias('JExtensionHelper', '\\Joomla\\CMS\\Extension\\ExtensionHelper', '5.0');

JLoader::registerAlias('JHtml', '\\Joomla\\CMS\\HTML\\HTMLHelper', '5.0');

JLoader::registerAlias('JFile', '\\Joomla\\CMS\\Filesystem\\File', '5.0');
JLoader::registerAlias('JFolder', '\\Joomla\\CMS\\Filesystem\\Folder', '5.0');
JLoader::registerAlias('JFilesystemHelper', '\\Joomla\\CMS\\Filesystem\\FilesystemHelper', '5.0');
JLoader::registerAlias('JFilesystemPatcher', '\\Joomla\\CMS\\Filesystem\\Patcher', '5.0');
JLoader::registerAlias('JPath', '\\Joomla\\CMS\\Filesystem\\Path', '5.0');
JLoader::registerAlias('JStream', '\\Joomla\\CMS\\Filesystem\\Stream', '5.0');
JLoader::registerAlias('JStreamString', '\\Joomla\\CMS\\Filesystem\\Streams\\StreamString', '5.0');
JLoader::registerAlias('JStringController', '\\Joomla\\CMS\\Filesystem\\Support\\StringController', '5.0');
JLoader::registerAlias('JFilesystemWrapperFile', '\\Joomla\\CMS\\Filesystem\\FileWrapper', '5.0');
JLoader::registerAlias('JFilesystemWrapperFolder', '\\Joomla\\CMS\\Filesystem\\FolderWrapper', '5.0');
JLoader::registerAlias('JFilesystemWrapperPath', '\\Joomla\\CMS\\Filesystem\\PathWrapper', '5.0');
24 changes: 12 additions & 12 deletions libraries/src/Filesystem/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\CMS\Filesystem
namespace Joomla\CMS\Filesystem;

use Joomla\CMS\Factory;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Filesystem\Wrapper\WrapperFolder;
use Joomla\CMS\Filesystem\Wrapper\WrapperPath;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Filesystem\Wrapper\FolderWrapper;
use Joomla\CMS\Filesystem\Wrapper\PathWrapper;
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Client\FtpClient;

Expand Down Expand Up @@ -94,7 +94,7 @@ public static function makeSafe($file)
*/
public static function copy($src, $dest, $path = null, $use_streams = false)
{
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;

// Prepend a base path if it exists
if ($path)
Expand Down Expand Up @@ -136,7 +136,7 @@ public static function copy($src, $dest, $path = null, $use_streams = false)
// If the parent folder doesn't exist we must create it
if (!file_exists(dirname($dest)))
{
$folderObject = new WrapperFolder;
$folderObject = new FolderWrapper;
$folderObject->create(dirname($dest));
}

Expand Down Expand Up @@ -179,7 +179,7 @@ public static function copy($src, $dest, $path = null, $use_streams = false)
public static function delete($file)
{
$FTPOptions = ClientHelper::getCredentials('ftp');
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;

if (is_array($file))
{
Expand Down Expand Up @@ -253,7 +253,7 @@ public static function delete($file)
*/
public static function move($src, $dest, $path = '', $use_streams = false)
{
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;

if ($path)
{
Expand Down Expand Up @@ -406,7 +406,7 @@ public static function write($file, $buffer, $use_streams = false)
// If the destination directory doesn't exist we need to create it
if (!file_exists(dirname($file)))
{
$folderObject = new WrapperFolder;
$folderObject = new FolderWrapper;

if ($folderObject->create(dirname($file)) == false)
{
Expand All @@ -433,7 +433,7 @@ public static function write($file, $buffer, $use_streams = false)
else
{
$FTPOptions = ClientHelper::getCredentials('ftp');
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;

if ($FTPOptions['enabled'] == 1)
{
Expand Down Expand Up @@ -551,15 +551,15 @@ public static function upload($src, $dest, $use_streams = false, $allow_unsafe =
}

// Ensure that the path is valid and clean
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;
$dest = $pathObject->clean($dest);

// Create the destination directory if it does not exist
$baseDir = dirname($dest);

if (!file_exists($baseDir))
{
$folderObject = new WrapperFolder;
$folderObject = new FolderWrapper;
$folderObject->create($baseDir);
}

Expand Down Expand Up @@ -635,7 +635,7 @@ public static function upload($src, $dest, $use_streams = false, $allow_unsafe =
*/
public static function exists($file)
{
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;

return is_file($pathObject->clean($file));
}
Expand Down
26 changes: 13 additions & 13 deletions libraries/src/Filesystem/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\CMS\Filesystem
namespace Joomla\CMS\Filesystem;

use Joomla\CMS\Factory;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Filesystem\Wrapper\WrapperPath;
use Joomla\CMS\Filesystem\Wrapper\WrapperFile;
use Joomla\CMS\Filesystem\Wrapper\PathWrapper;
use Joomla\CMS\Filesystem\Wrapper\FileWrapper;
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Client\FtpClient;
use Joomla\CMS\Language\Text;
Expand Down Expand Up @@ -44,7 +44,7 @@ public static function copy($src, $dest, $path = '', $force = false, $use_stream
@set_time_limit(ini_get('max_execution_time'));

$FTPOptions = ClientHelper::getCredentials('ftp');
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;

if ($path)
{
Expand Down Expand Up @@ -181,7 +181,7 @@ public static function create($path = '', $mode = 0755)
static $nested = 0;

// Check to make sure the path valid and clean
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;
$path = $pathObject->clean($path);

// Check if parent dir exists
Expand Down Expand Up @@ -305,7 +305,7 @@ public static function create($path = '', $mode = 0755)
public static function delete($path)
{
@set_time_limit(ini_get('max_execution_time'));
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;

// Sanity check
if (!$path)
Expand Down Expand Up @@ -334,7 +334,7 @@ public static function delete($path)

if (!empty($files))
{
$file = new WrapperFile;
$file = new FileWrapper;

if ($file->delete($files) !== true)
{
Expand All @@ -351,7 +351,7 @@ public static function delete($path)
if (is_link($folder))
{
// Don't descend into linked directories, just delete the link.
$file = new WrapperFile;
$file = new FileWrapper;

if ($file->delete($folder) !== true)
{
Expand Down Expand Up @@ -410,7 +410,7 @@ public static function delete($path)
public static function move($src, $dest, $path = '', $use_streams = false)
{
$FTPOptions = ClientHelper::getCredentials('ftp');
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;

if ($path)
{
Expand Down Expand Up @@ -483,7 +483,7 @@ public static function move($src, $dest, $path = '', $use_streams = false)
*/
public static function exists($path)
{
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;

return is_dir($pathObject->clean($path));
}
Expand All @@ -507,7 +507,7 @@ public static function files($path, $filter = '.', $recurse = false, $full = fal
$excludefilter = array('^\..*', '.*~'), $naturalSort = false)
{
// Check to make sure the path valid and clean
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;
$path = $pathObject->clean($path);

// Is the path a folder?
Expand Down Expand Up @@ -562,7 +562,7 @@ public static function folders($path, $filter = '.', $recurse = false, $full = f
$excludefilter = array('^\..*'))
{
// Check to make sure the path valid and clean
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;
$path = $pathObject->clean($path);

// Is the path a folder?
Expand Down Expand Up @@ -691,7 +691,7 @@ public static function listFolderTree($path, $filter, $maxLevel = 3, $level = 0,
if ($level < $maxLevel)
{
$folders = self::folders($path, $filter);
$pathObject = new WrapperPath;
$pathObject = new PathWrapper;

// First path, index foldernames
foreach ($folders as $name)
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Filesystem/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\CMS\Filesystem
namespace Joomla\CMS\Filesystem;

defined('JPATH_PLATFORM') or die;

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Filesystem/Patcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\CMS\Filesystem
namespace Joomla\CMS\Filesystem;

use Joomla\CMS\Log\Log;
use Joomla\CMS\Language\Text;
Expand Down
8 changes: 4 additions & 4 deletions libraries/src/Filesystem/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

namespace Joomla\CMS\Filesystem;

use Joomla\CMS\Filesystem\Wrapper\WrapperPath;
use Joomla\CMS\Filesystem\Wrapper\WrapperFile;
use Joomla\CMS\Filesystem\Wrapper\PathWrapper;
use Joomla\CMS\Filesystem\Wrapper\FileWrapper;
use Joomla\CMS\Crypt\Crypt;

defined('JPATH_PLATFORM') or die;

if (!defined('JPATH_ROOT'))
{
// Define a string constant for the root directory of the file system in native format
$pathHelper = new WrapperPath;
$pathHelper = new PathWrapper;
define('JPATH_ROOT', $pathHelper->clean(JPATH_SITE));
}

Expand Down Expand Up @@ -253,7 +253,7 @@ public static function isOwner($path)

if ($dir)
{
$fileObject = new WrapperFile;
$fileObject = new FileWrapper;
$test = $dir . '/' . $tmp;

// Create the test file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @subpackage Filesystem
* @since 3.4
*/
class WrapperFile
class FileWrapper
{
/**
* Helper wrapper method for getExt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @subpackage Filesystem
* @since 3.4
*/
class WrapperFolder
class FolderWrapper
{
/**
* Helper wrapper method for copy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @subpackage Filesystem
* @since 3.4
*/
class WrapperPath
class PathWrapper
{
/**
* Helper wrapper method for canChmod
Expand Down

0 comments on commit ba3b4c4

Please sign in to comment.