'ushosting' => ['host' => 'kingkong.cubedesigners.com', 'basepath' => '/home/fluidbook/data/hosting'],
];
+ const LATEST_PHP = '8.3';
+
public function handle()
{
foreach (static::$_data as $name => $s) {
copy($r . 'updateall', $d . 'update');
+
+
foreach ($servers as $server) {
$basePath = trim($server->base_path, '/');
if ($basePath != '') {
$basePath = '/' . $basePath;
}
+ $phpversion=floatval($server->php);
+ $image = 'php:apache';
+ if ($phpversion > 1) {
+ $image = 'php:' . $phpversion . '-apache';
+ }
+
/** @var FluidbookExternalInstallServer $server */
$server->updateHtaccess();
$s = $d . 'server-' . $server->id;
Files::copy($r . 'server', $s);
Files::recursiveReplaceStringInDir($s, [
'$sid' => $server->id,
- '$image' => (true || $server->php) ? 'php:apache' : 'httpd',
- '$dockerpath' => (true || $server->php) ? '/var/www/html' : '/usr/local/apache2/htdocs',
+ '$image' => $image,
+ '$dockerpath' => ($image !== 'httpd') ? '/var/www/html' : '/usr/local/apache2/htdocs',
'$domains' => implode(',', Text::explodeNewLines($server->subdomains)),
'$hosting' => $name,
'$path' => $data['basepath'] . $basePath,
use App\Models\Traits\Owner;
use App\Models\Traits\Permissions;
use Cubist\Backpack\Magic\Fields\Checkbox;
+use Cubist\Backpack\Magic\Fields\SelectFromArray;
use Cubist\Backpack\Magic\Fields\Table;
use Cubist\Backpack\Magic\Fields\Textarea;
use Cubist\Backpack\Magic\Models\ExternalServer;
$this->addOwnerField(['column' => true]);
$this->getField('base_url')->setAttribute('when', ['protocol' => $nothostingProtocols]);
$this->addField('subdomains', Textarea::class, __('Sous-domaines'), ['when' => ['protocol' => $hostingProtocols]]);
- $this->addField('php', Checkbox::class, __('Activer le support de PHP'), ['default' => false, 'when' => ['protocol' => $hostingProtocols]]);
+ $this->addField('php', SelectFromArray::class, __('Activer le support de PHP'), ['default' => false, 'options' => [0 => __('Non'), 1 => __('Dernière version'), '8.3' => '8.3', '8.2' => '8.2', '8.1' => '8.1'], 'when' => ['protocol' => $hostingProtocols]]);
$this->addField('redirections', Table::class, __('Redirections'), ['entity_singular' => __('redirection'), 'columns' => ['from' => __('De'), 'to' => __('Vers')], 'when' => ['protocol' => $hostingProtocols]]);
$this->addField('allows_root', Checkbox::class, __('Autoriser le chargement à la racine (sur le chemin de base)'), ['default' => false]);
}