Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
20d20a8
add drupal 9 test and update some dependencies
mrossi113 Nov 11, 2020
9fedd39
remove silex/silex package not compatible with symfony 4
mrossi113 Nov 11, 2020
8705d36
fix deprecated code for Drupal 9
mrossi113 Nov 12, 2020
39efd9c
Revert "fix deprecated code for Drupal 9"
mrossi113 Nov 12, 2020
bb121ab
wip adding silex/silex to test something in circleci
mrossi113 Nov 16, 2020
f84aeee
update twig deprecated code
mrossi113 Nov 16, 2020
e2395c9
update drupal deprecated code
mrossi113 Nov 16, 2020
d785291
fix a twig extends
mrossi113 Nov 16, 2020
9f9ac80
fix a deprecated code change
mrossi113 Nov 17, 2020
fd3d713
revert back to original code
mrossi113 Nov 17, 2020
5974aa7
fix fatal error
mrossi113 Nov 18, 2020
b3e5d24
wip - fix codesniffer
mrossi113 Nov 20, 2020
bf36b1d
remove silex/silex package and add symfony/flex instead
mrossi113 Nov 25, 2020
81ca9bf
remove the 8.4 test from CircleCI config
mrossi113 Nov 25, 2020
df4d078
adjust the drupal versions and php to 7.3
mrossi113 Nov 30, 2020
564aeee
resolved a merge conflict
mrossi113 Dec 9, 2020
86f1ac5
update packages for symfony 4 within Mannequin core
mrossi113 Dec 9, 2020
0d3ee9b
fix the logger and ServiceControllerServiceProvider in mannequin
mrossi113 Dec 9, 2020
a25b550
wip few updates to dependencies
mrossi113 Dec 9, 2020
556bab3
wip
mrossi113 Dec 10, 2020
00cdd45
adjusted the code to remove silex dependencies and use symfony 4 instead
mrossi113 Dec 11, 2020
7a17b28
wip - manniquen.php
mrossi113 Dec 15, 2020
05a34d2
fix phpunit test for drupal 9
mrossi113 Dec 15, 2020
eac82fe
fix a test
mrossi113 Dec 15, 2020
0d8a8bf
Revert "fix a test"
mrossi113 Dec 15, 2020
ea0713d
wip - update phpunit from 6 to 7
mrossi113 Dec 16, 2020
ec08c74
wip - check a test
mrossi113 Dec 16, 2020
3644675
wip - adjust a test change
mrossi113 Dec 16, 2020
b0fad74
Revert "wip - adjust a test change"
mrossi113 Dec 16, 2020
07368b2
revert back to original test
mrossi113 Dec 16, 2020
4ebb3cd
updated twig/twig 3.0 and adjust method on FallbackLoader.php
mrossi113 Dec 18, 2020
f629d8d
Revert "updated twig/twig 3.0 and adjust method on FallbackLoader.php"
mrossi113 Dec 18, 2020
58a3701
fix the FallbackLoader.php and removed twig/twig 3.0
mrossi113 Dec 18, 2020
881ffeb
update twig to 1.41.0 to match drupal 8.9 & adjust application.php
mrossi113 Dec 18, 2020
9d3ab06
wip - testing
mrossi113 Dec 18, 2020
ea337b7
fix deprecated for EventDispatcherInterface::dispatch()
mrossi113 Dec 18, 2020
36246f4
Revert "fix deprecated for EventDispatcherInterface::dispatch()"
mrossi113 Dec 18, 2020
2520f83
wip test
mrossi113 Dec 21, 2020
e9fc99f
remove unused import
mrossi113 Dec 21, 2020
59a5f15
Revert "remove unused import"
mrossi113 Dec 21, 2020
f8ed64b
Revert "wip test"
mrossi113 Dec 21, 2020
e80513f
add symfony http-foundation and http-kernal packages
mrossi113 Dec 23, 2020
dbe7871
adjust the http-foundation for drupal 9
mrossi113 Dec 23, 2020
fcd95cd
update the composer.json with packages that are missing from Core
mrossi113 Dec 23, 2020
b54b6ea
Need to fix the http-kernel for drupal 8.9
mrossi113 Dec 23, 2020
e87aa3d
missed 2 symfony packages for drupal 8.9
mrossi113 Dec 23, 2020
5d65198
fix the package being used
mrossi113 Jan 4, 2021
5e8b235
fix codesniffer issues
mrossi113 Jan 4, 2021
df3df3c
remove extra line
mrossi113 Jan 4, 2021
eabc978
fix again extra line
mrossi113 Jan 4, 2021
1ef4fb6
adjust silex route being used
mrossi113 Jan 4, 2021
1ba3eb6
fix codesniffer
mrossi113 Jan 4, 2021
0d8c95e
Revert "fix codesniffer"
mrossi113 Jan 4, 2021
eea065c
Revert "adjust silex route being used"
mrossi113 Jan 4, 2021
f98423f
fix the silex issue with changes being made
mrossi113 Jan 4, 2021
ec8225d
codesniffer
mrossi113 Jan 4, 2021
199381c
fix one missing file with phpunit
mrossi113 Jan 5, 2021
97bb398
codesniffer
mrossi113 Jan 5, 2021
5070537
fix codesniffer
mrossi113 Jan 6, 2021
aaa5d38
fix an issue with the wrong package being used
mrossi113 Jan 6, 2021
ab75776
fix some codesniffer
mrossi113 Jan 6, 2021
4f10f1b
fix a package being used
mrossi113 Jan 6, 2021
ae20637
fix a code checker
mrossi113 Feb 11, 2021
e5e52da
adjust the filename
mrossi113 Feb 11, 2021
f1c943a
fix few comment header codesniffer
mrossi113 Feb 11, 2021
b63aaf9
testing - this holding up PHPUnit in CI
mrossi113 Feb 12, 2021
4d03426
wip - remove comment as well
mrossi113 Feb 12, 2021
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
44 changes: 32 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
test_php:
working_directory: /srv
docker:
- image: lastcallmedia/php:7.0-dev
- image: lastcallmedia/php:7.3-dev
steps:
- checkout
- restore_cache:
Expand All @@ -28,13 +28,13 @@ jobs:
- store_test_results:
path: /phpunit

test_drupal_8.4.0:
test_drupal_8.9:
working_directory: /srv
docker:
- image: lastcallmedia/php:7.0-dev
- image: lastcallmedia/php:7.3-dev
steps:
- checkout
- run: composer require drupal/core:8.7.0 --no-update
- run: composer require drupal/core:8.9.10 --no-update
- restore_cache:
key: composer-v4-{{ checksum "composer.json" }}
- run: composer install
Expand All @@ -47,19 +47,38 @@ jobs:
- store_test_results:
path: /phpunit

test_drupal_8.8.10:
test_drupal_9:
working_directory: /srv
docker:
- image: lastcallmedia/php:7.0-dev
- image: lastcallmedia/php:7.3-dev
steps:
- checkout
- run: composer require drupal/core:8.8.10 --no-update
- run: composer require drupal/core:9.0.x-dev --no-update
- restore_cache:
key: composer-v4-{{ checksum "composer.json" }}
- run: composer install
- save_cache:
key: composer-v4-{{ checksum "composer.json" }}
paths: [vendor, composer.lock]
paths: [ vendor, composer.lock ]
- run: |
mkdir -p /phpunit
DRUPAL_ROOT=vendor/drupal vendor/bin/phpunit --testsuite=Drupal --log-junit=/phpunit/drupal.xml
- store_test_results:
path: /phpunit

test_drupal_9_latest:
working_directory: /srv
docker:
- image: lastcallmedia/php:7.3-dev
steps:
- checkout
- run: composer require drupal/core:9.1.x-dev --no-update
- restore_cache:
key: composer-v4-{{ checksum "composer.json" }}
- run: composer install
- save_cache:
key: composer-v4-{{ checksum "composer.json" }}
paths: [ vendor, composer.lock ]
- run: |
mkdir -p /phpunit
DRUPAL_ROOT=vendor/drupal vendor/bin/phpunit --testsuite=Drupal --log-junit=/phpunit/drupal.xml
Expand Down Expand Up @@ -87,7 +106,7 @@ jobs:
build_demo:
working_directory: /srv
docker:
- image: lastcallmedia/php:7.0-dev
- image: lastcallmedia/php:7.3-dev
steps:
- checkout
- attach_workspace:
Expand Down Expand Up @@ -172,14 +191,15 @@ workflows:
test_and_deploy:
jobs:
- test_php
- test_drupal_8.4.0
- test_drupal_8.8.10
- test_drupal_8.9
- test_drupal_9
- test_drupal_9_latest
- test_ui
- build_site
- build_demo:
requires: [test_ui]
- deploy_split:
requires: [test_php, test_drupal_8.4.0, test_drupal_8.8.10]
requires: [test_php, test_drupal_8.9, test_drupal_9, test_drupal_9_latest]
- deploy_ui:
requires: [test_ui]
filters:
Expand Down
14 changes: 14 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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.
#
# 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
4 changes: 4 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,19 @@ vendor/
/cache/
composer.lock
.php_cs.cache

###> friendsofphp/php-cs-fixer ###
/.php_cs
/.php_cs.cache
###< friendsofphp/php-cs-fixer ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

###> symfony/phpunit-bridge ###
.phpunit
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
42 changes: 42 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\ErrorHandler\Debug;

if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
}

set_time_limit(0);

require dirname(__DIR__).'/vendor/autoload.php';

if (!class_exists(Application::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

require dirname(__DIR__).'/config/bootstrap.php';

if ($_SERVER['APP_DEBUG']) {
umask(0000);

if (class_exists(Debug::class)) {
Debug::enable();
}
}

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
19 changes: 19 additions & 0 deletions bin/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php

if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

if (false === getenv('SYMFONY_PHPUNIT_VERSION')) {
putenv('SYMFONY_PHPUNIT_VERSION=6.5');
}
if (false === getenv('SYMFONY_PHPUNIT_REMOVE')) {
putenv('SYMFONY_PHPUNIT_REMOVE=symfony/yaml');
}
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
24 changes: 14 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,26 @@
},
"require": {
"php": ">7.0",
"symfony/console": "^2.7 ||^3.0",
"symfony/filesystem": "^2.7 ||^3.0",
"symfony/process": "^2.7 ||^3.0",
"silex/silex": ">=2.0 <2.3",
"symfony/console": "^3.0 ||^4.0",
"symfony/filesystem": "^3.0 ||^4.0",
"symfony/process": "^3.0 ||^4.0",
"pimple/pimple": "^3.0",
"symfony/yaml": "^2.7 ||^3.0",
"symfony/yaml": "^3.0 ||^4.0",
"symfony/finder": "^2.7 ||^3.0",
"twig/twig": "^1.3.0",
"twig/twig": "^1.41.0 ||^2.12.0",
"psr/cache": "~1.0",
"sebastian/version": "^1.0 || ^2.0",
"symfony/expression-language": "^2.7 ||^3.0",
"symfony/asset": "^2.7 || ^3.0",
"symfony/cache": "^3.3"
"symfony/expression-language": "^3.0 ||^4.0",
"symfony/asset": "^3.0 ||^4.0",
"symfony/cache": "^3.3",
"symfony/flex": "^1.10",
"symfony/http-foundation": "^3.4 ||^4.4",
"symfony/http-kernel": "^3.4 ||^4.4",
"symfony/routing": "^3.4 ||^4.4",
"symfony/web-link": "^3.4 ||^4.4"
},
"require-dev": {
"phpunit/phpunit": "^6.1",
"phpunit/phpunit": "^7.0",
"friendsofphp/php-cs-fixer": "^2.3",
"symfony/phpunit-bridge": "^2.7 || ^3.3",
"mikey179/vfsStream": "^1.6"
Expand Down
23 changes: 23 additions & 0 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

use Symfony\Component\Dotenv\Dotenv;

require dirname(__DIR__).'/vendor/autoload.php';

if (!class_exists(Dotenv::class)) {
throw new LogicException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
}

// Load cached env vars if the .env.local.php file exists
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {
(new Dotenv(false))->populate($env);
} else {
// load all the .env files
(new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');
}

$_SERVER += $_ENV;
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
3 changes: 3 additions & 0 deletions config/packages/prod/routing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
router:
strict_requirements: null
7 changes: 7 additions & 0 deletions config/packages/routing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
framework:
router:
utf8: true

# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost
3 changes: 3 additions & 0 deletions config/routes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#index:
# path: /
# controller: App\Controller\DefaultController::index
7 changes: 7 additions & 0 deletions config/routes/annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
controllers:
resource: ../../src/Controller/
type: annotation

kernel:
resource: ../../src/Kernel.php
type: annotation
34 changes: 34 additions & 0 deletions src/Core/AppArgumentValueResolver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace LastCall\Mannequin\Core;

use Application\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;

class AppArgumentValueResolver implements ArgumentValueResolverInterface
{
private $app;

public function __construct(Application $app)
{
$this->app = $app;
}

/**
* {@inheritdoc}
*/
public function supports(Request $request, ArgumentMetadata $argument)
{
return null !== $argument->getType() && (Application::class === $argument->getType() || is_subclass_of($argument->getType(), Application::class));
}

/**
* {@inheritdoc}
*/
public function resolve(Request $request, ArgumentMetadata $argument)
{
yield $this->app;
}
}
Loading