Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix, update and re-activate symfony_demo PGO training case #27

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
9 changes: 4 additions & 5 deletions pgo/cases/symfony_demo/TrainingCaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,23 @@ public function getJobFilename() : string

protected function getToolFn() : string
{
return $this->conf->getToolsDir() . DIRECTORY_SEPARATOR . "symfony.phar";
return $this->conf->getToolsDir() . DIRECTORY_SEPARATOR . "composer.phar";
}

protected function setupDist() : void
{
if (!is_dir($this->conf->getCaseWorkDir($this->getName()))) {
echo "Setting up in '{$this->base}'\n";
$ver = $this->conf->getSectionItem($this->getName(), "symfony_demo_version");
$php = new PHP\CLI($this->conf);
$php->exec($this->getToolFn() . " demo " . $this->base);
$php->exec($this->getToolFn() . " create-project symfony/symfony-demo " . $this->base . " " . $ver);
}

$port = $this->getHttpPort();
$host = $this->getHttpHost();

$vars = array(
$this->conf->buildTplVarName($this->getName(), "docroot") => str_replace("\\", "/", $this->base . DIRECTORY_SEPARATOR . "web"),
$this->conf->buildTplVarName($this->getName(), "docroot") => str_replace("\\", "/", $this->base . DIRECTORY_SEPARATOR . "public"),
);
$tpl_fn = $this->conf->getCasesTplDir($this->getName()) . DIRECTORY_SEPARATOR . "nginx.partial.conf";
$this->nginx->addServer($tpl_fn, $vars);
Expand Down Expand Up @@ -105,8 +106,6 @@ public function setupUrls()

public function prepareInit(Tool\PackageWorkman $pw, bool $force = false) : void
{
$url = $this->conf->getSectionItem($this->getName(), "symfony_phar_url");
$pw->fetch($url, $this->getToolFn(), $force);
}

public function init() : void
Expand Down
Empty file removed pgo/cases/symfony_demo/inactive
Empty file.
4 changes: 2 additions & 2 deletions pgo/cases/symfony_demo/nginx.partial.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

# symfony
location / {
try_files $uri /app.php$is_args$args;
try_files $uri /index.php$is_args$args;
}

location ~ ^/app\.php(/|$) {
location ~ ^/index\.php(/|$) {
fastcgi_pass PHP_SDK_PGO_PHP_FCGI_HOST:PHP_SDK_PGO_PHP_FCGI_PORT;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
Expand Down
2 changes: 1 addition & 1 deletion pgo/cases/symfony_demo/phpsdk_pgo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"symfony_phar_url": "https://get.symfony.com/symfony.phar",
"symfony_demo_version": "v2.4.0",
"type": "web",
"srv_http": "nginx",
"srv_db": null
Expand Down