Skip to content

Commit

Permalink
Support composer scripts as objects to support symfony apps
Browse files Browse the repository at this point in the history
Closes: #81
  • Loading branch information
cedricziel committed Sep 7, 2024
1 parent d7a8a7b commit 9a39bd8
Show file tree
Hide file tree
Showing 19 changed files with 2,734 additions and 0 deletions.
20 changes: 20 additions & 0 deletions buildpacks/php/tests/fixtures/smoke/symfony-minimal/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# https://symfony.com/doc/current/configuration/secrets.html
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=c28a6275b89b26e84973213220fa74a2
###< symfony/framework-bundle ###
10 changes: 10 additions & 0 deletions buildpacks/php/tests/fixtures/smoke/symfony-minimal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###
7 changes: 7 additions & 0 deletions buildpacks/php/tests/fixtures/smoke/symfony-minimal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Minimal symfony app

Serve:

```bash
php -S 127.0.0.1:8000 -t public/
```
21 changes: 21 additions & 0 deletions buildpacks/php/tests/fixtures/smoke/symfony-minimal/bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;

if (!is_dir(dirname(__DIR__).'/vendor')) {
throw new LogicException('Dependencies are missing. Try running "composer install".');
}

if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

return new Application($kernel);
};
68 changes: 68 additions & 0 deletions buildpacks/php/tests/fixtures/smoke/symfony-minimal/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/console": "7.1.*",
"symfony/dotenv": "7.1.*",
"symfony/flex": "^2",
"symfony/framework-bundle": "7.1.*",
"symfony/runtime": "7.1.*",
"symfony/yaml": "7.1.*"
},
"require-dev": {
},
"config": {
"allow-plugins": {
"php-http/discovery": true,
"symfony/flex": true,
"symfony/runtime": true
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*",
"symfony/polyfill-php82": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "7.1.*"
}
}
}
Loading

0 comments on commit 9a39bd8

Please sign in to comment.