Move OC_Archive to \OC\Archive\Archive
* Move out of legacy folder * Move to proper namespace * Fix calling code
This commit is contained in:
parent
0cb434686c
commit
c96ed5c4ce
4 changed files with 6 additions and 7 deletions
|
@ -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);
|
|
@ -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;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
namespace OC\Archive;
|
||||
|
||||
class ZIP extends \OC_Archive{
|
||||
class ZIP extends Archive{
|
||||
/**
|
||||
* @var \ZipArchive zip
|
||||
*/
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue