Move OC_Archive to \OC\Archive\Archive

* Move out of legacy folder
* Move to proper namespace
* Fix calling code
This commit is contained in:
Roeland Jago Douma 2016-05-02 09:43:17 +02:00
parent 0cb434686c
commit c96ed5c4ce
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
4 changed files with 6 additions and 7 deletions

View File

@ -28,15 +28,14 @@
*
*/
use OC\Archive\TAR;
use OC\Archive\ZIP;
namespace OC\Archive;
abstract class OC_Archive{
abstract class Archive{
/**
* Open any of the supported archive types
*
* @param string $path
* @return OC_Archive|void
* @return Archive|void
*/
public static function open($path) {
$mime = \OC::$server->getMimeTypeDetector()->detect($path);

View File

@ -32,7 +32,7 @@
namespace OC\Archive;
class TAR extends \OC_Archive {
class TAR extends Archive {
const PLAIN = 0;
const GZIP = 1;
const BZIP = 2;

View File

@ -29,7 +29,7 @@
namespace OC\Archive;
class ZIP extends \OC_Archive{
class ZIP extends Archive{
/**
* @var \ZipArchive zip
*/

View File

@ -300,7 +300,7 @@ class Installer {
$extractDir = \OC::$server->getTempManager()->getTemporaryFolder();
OC_Helper::rmdirr($extractDir);
mkdir($extractDir);
if($archive=\OC_Archive::open($path)) {
if($archive=\OC\Archive\Archive::open($path)) {
$archive->extract($extractDir);
} else {
OC_Helper::rmdirr($extractDir);