mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 23:50:33 +00:00
31 lines
619 B
PHP
31 lines
619 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
class Helpers
|
|
{
|
|
public static function extractTar($tarFile, $extractPath)
|
|
{
|
|
shell_exec('mkdir -p ' . $extractPath);
|
|
|
|
$exec = shell_exec('tar -xvf ' . $tarFile . ' -C ' . $extractPath);
|
|
|
|
return $exec;
|
|
}
|
|
|
|
public static function checkPathSize($path)
|
|
{
|
|
// Check path size
|
|
$pathSize = shell_exec('du -sh ' . $path);
|
|
$pathSize = trim($pathSize);
|
|
$pathSize = explode("\t", $pathSize);
|
|
|
|
if (isset($pathSize[0])) {
|
|
$pathSize = $pathSize[0];
|
|
return $pathSize;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
}
|