add phpmyadmin

This commit is contained in:
Saeed Vaziry
2024-03-27 11:41:29 +01:00
parent a7ba095919
commit 9244e69fd8
34 changed files with 401 additions and 85 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace App\SSH\PHPMyAdmin;
use App\Models\Site;
use App\SSH\HasScripts;
class PHPMyAdmin
{
use HasScripts;
public function install(Site $site): void
{
$site->server->ssh()->exec(
$this->getScript('install.sh', [
'version' => $site->type_data['version'],
'path' => $site->path,
]),
'install-phpmyadmin',
$site->id
);
}
}

View File

@ -0,0 +1,25 @@
sudo rm -rf phpmyadmin
sudo rm -rf __path__
if ! wget https://files.phpmyadmin.net/phpMyAdmin/__version__/phpMyAdmin-__version__-all-languages.zip; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! unzip phpMyAdmin-__version__-all-languages.zip; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! rm -rf phpMyAdmin-__version__-all-languages.zip; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! mv phpMyAdmin-__version__-all-languages __path__; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! mv __path__/config.sample.inc.php __path__/config.inc.php; then
echo 'VITO_SSH_ERROR' && exit 1
fi
echo "PHPMyAdmin installed!"