Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 57 additions & 54 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion etc/sites-enabled/phpdocker.io.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<VirtualHost *:80>
ServerName phpdocker.io
ServerName www.phpdocker.io
ServerAlias *.phpdocker.io

RewriteEngine On
RewriteRule ^(.*)$ http://phpdocker.io$1 [R=301,L]
</VirtualHost>

<VirtualHost *:80>
ServerName phpdocker.io

## Vhost docroot
DocumentRoot "/var/www/phpdocker.io/web"

Expand All @@ -11,6 +18,11 @@
## Make HTTP basic auth work
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1

## 301 to HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]

## Directories, there should at least be a declaration for /var/www/phpdocker.io/public
<Directory "/var/www/phpdocker.io/web">
Options Indexes FollowSymlinks MultiViews
Expand Down
27 changes: 23 additions & 4 deletions src/AppBundle/Controller/GeneratorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,34 @@ public function createAction(Request $request)
* @param Project $project
*
* @return Project
* @throws \InvalidArgumentException
*/
private function fixPhpExtensionGeneratorExpectation(Project $project) : Project
{
if ($project->getPhpOptions()->getVersion() === PhpOptions::PHP_VERSION_56) {
$project->getPhpOptions()->setPhpExtensions($project->getPhpOptions()->getPhpExtensions56());
} else {
$project->getPhpOptions()->setPhpExtensions($project->getPhpOptions()->getPhpExtensions70());
/** @var PhpOptions $phpOptions */
$phpOptions = $project->getPhpOptions();
$phpVersion = $phpOptions->getVersion();

switch ($phpVersion) {
case PhpOptions::PHP_VERSION_56:
$extensions = $phpOptions->getPhpExtensions56();
break;

case PhpOptions::PHP_VERSION_70:
$extensions = $phpOptions->getPhpExtensions70();
break;

case PhpOptions::PHP_VERSION_71:
$extensions = $phpOptions->getPhpExtensions71();
break;

default:
throw new \InvalidArgumentException(sprintf('Eek! Unsupported php version %s', $phpVersion));

}

$project->getPhpOptions()->setPhpExtensions($extensions);

return $project;
}
}
Loading