fixes for symfony4 #74 #81

This commit is contained in:
Kevin Papst
2018-01-12 21:07:20 +01:00
parent a87355695e
commit 4d7fe3d595
5 changed files with 101 additions and 57 deletions

View File

@@ -49,7 +49,7 @@ $ bin/console kimai:install --relative
All thats left to do is to create your first user: All thats left to do is to create your first user:
```bash ```bash
$ bin/console kimai:create-user admin admin@example.com password en ROLE_SUPER_ADMIN $ bin/console kimai:create-user username admin@example.com password en ROLE_SUPER_ADMIN
``` ```
For available roles, please refer to [the user documentation](var/docs/users.md). For available roles, please refer to [the user documentation](var/docs/users.md).
@@ -91,7 +91,7 @@ There is no need to configure a virtual host in your web server to access the ap
Just use the built-in web server for your first tests: Just use the built-in web server for your first tests:
```bash ```bash
$ APP_FRONT_CONTROLLER=app.php bin/console server:run $ bin/console server:run
``` ```
This command will start a web server for Kimai. Now you can access the application in your browser at <http://127.0.0.1:8000/>. This command will start a web server for Kimai. Now you can access the application in your browser at <http://127.0.0.1:8000/>.

View File

@@ -6,7 +6,7 @@
"require": { "require": {
"php": "^7.1.3", "php": "^7.1.3",
"ext-pdo_sqlite": "*", "ext-pdo_sqlite": "*",
"avanzu/admin-theme-bundle": "dev-master", "avanzu/admin-theme-bundle": "dev-symfony4",
"beberlei/DoctrineExtensions": "^1.0", "beberlei/DoctrineExtensions": "^1.0",
"dama/doctrine-test-bundle": "^4.0", "dama/doctrine-test-bundle": "^4.0",
"sensio/framework-extra-bundle": "^5.1", "sensio/framework-extra-bundle": "^5.1",
@@ -83,5 +83,11 @@
"id": "01C3FWRDJJEX9K6Y3A4XDFXPBR", "id": "01C3FWRDJJEX9K6Y3A4XDFXPBR",
"allow-contrib": false "allow-contrib": false
} }
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/kevinpapst/AdminThemeBundle"
} }
]
} }

112
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "2399d7e65f36c5579d419f3b66f2d08a", "content-hash": "8138f6fcbab7203332de143d5b442541",
"packages": [ "packages": [
{ {
"name": "almasaeed2010/adminlte", "name": "almasaeed2010/adminlte",
@@ -48,16 +48,16 @@
}, },
{ {
"name": "avanzu/admin-theme-bundle", "name": "avanzu/admin-theme-bundle",
"version": "dev-master", "version": "dev-symfony4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/avanzu/AdminThemeBundle.git", "url": "https://github.com/kevinpapst/AdminThemeBundle.git",
"reference": "eb80bd51fca844cabedae397c9c48c4529b06748" "reference": "f007e946f56295f447d0f1b75e5a7cf55145cf7c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/avanzu/AdminThemeBundle/zipball/eb80bd51fca844cabedae397c9c48c4529b06748", "url": "https://api.github.com/repos/kevinpapst/AdminThemeBundle/zipball/f007e946f56295f447d0f1b75e5a7cf55145cf7c",
"reference": "eb80bd51fca844cabedae397c9c48c4529b06748", "reference": "f007e946f56295f447d0f1b75e5a7cf55145cf7c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -82,7 +82,14 @@
"Avanzu\\AdminThemeBundle\\": "" "Avanzu\\AdminThemeBundle\\": ""
} }
}, },
"notification-url": "https://packagist.org/downloads/", "scripts": {
"post-install-cmd": [
"Avanzu\\AdminThemeBundle\\Composer\\ScriptHandler::fetchThemeVendors"
],
"post-update-cmd": [
"Avanzu\\AdminThemeBundle\\Composer\\ScriptHandler::fetchThemeVendors"
]
},
"license": [ "license": [
"MIT" "MIT"
], ],
@@ -101,7 +108,10 @@
} }
], ],
"description": "Admin Theme based on the AdminLTE Template for easy integration into symfony", "description": "Admin Theme based on the AdminLTE Template for easy integration into symfony",
"time": "2017-12-29T18:13:35+00:00" "support": {
"source": "https://github.com/kevinpapst/AdminThemeBundle/tree/symfony4"
},
"time": "2018-01-12T20:01:56+00:00"
}, },
{ {
"name": "beberlei/DoctrineExtensions", "name": "beberlei/DoctrineExtensions",
@@ -3972,49 +3982,6 @@
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2017-10-23T15:15:11+00:00" "time": "2017-10-23T15:15:11+00:00"
}, },
{
"name": "symfony/thanks",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/thanks.git",
"reference": "b637913a92664571afd1067fc645ecb30c9cf5b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/thanks/zipball/b637913a92664571afd1067fc645ecb30c9cf5b2",
"reference": "b637913a92664571afd1067fc645ecb30c9cf5b2",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.1",
"php": "^5.5.9|^7.0.8"
},
"type": "composer-plugin",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
},
"class": "Symfony\\Thanks\\Thanks"
},
"autoload": {
"psr-4": {
"Symfony\\Thanks\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
}
],
"description": "Give thanks (in the form of a GitHub ⭐) to your fellow PHP package maintainers (not limited to Symfony components)!",
"time": "2018-01-03T09:30:52+00:00"
},
{ {
"name": "symfony/translation", "name": "symfony/translation",
"version": "v4.0.3", "version": "v4.0.3",
@@ -6862,6 +6829,49 @@
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2018-01-04T17:20:09+00:00" "time": "2018-01-04T17:20:09+00:00"
}, },
{
"name": "symfony/thanks",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/thanks.git",
"reference": "b637913a92664571afd1067fc645ecb30c9cf5b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/thanks/zipball/b637913a92664571afd1067fc645ecb30c9cf5b2",
"reference": "b637913a92664571afd1067fc645ecb30c9cf5b2",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.1",
"php": "^5.5.9|^7.0.8"
},
"type": "composer-plugin",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
},
"class": "Symfony\\Thanks\\Thanks"
},
"autoload": {
"psr-4": {
"Symfony\\Thanks\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
}
],
"description": "Give thanks (in the form of a GitHub ⭐) to your fellow PHP package maintainers (not limited to Symfony components)!",
"time": "2018-01-03T09:30:52+00:00"
},
{ {
"name": "symfony/web-server-bundle", "name": "symfony/web-server-bundle",
"version": "v4.0.3", "version": "v4.0.3",

View File

@@ -120,6 +120,11 @@ services:
arguments: arguments:
$projectDirectory: "%kernel.project_dir%" $projectDirectory: "%kernel.project_dir%"
App\Command\InstallCommand:
class: App\Command\InstallCommand
arguments:
$projectDirectory: "%kernel.project_dir%"
# ================================================================================ # ================================================================================
# THEME # THEME
# ================================================================================ # ================================================================================

View File

@@ -26,6 +26,21 @@ use Symfony\Component\Console\Style\SymfonyStyle;
class InstallCommand extends Command class InstallCommand extends Command
{ {
/**
* @var string
*/
protected $rootDir;
/**
* RunCodeSnifferCommand constructor.
* @param string $projectDirectory
*/
public function __construct($projectDirectory)
{
$this->rootDir = realpath($projectDirectory);
parent::__construct();
}
/** /**
* @inheritdoc * @inheritdoc
*/ */
@@ -77,14 +92,22 @@ class InstallCommand extends Command
try { try {
$command = $this->getApplication()->find('avanzu:admin:fetch-vendor'); $command = $this->getApplication()->find('avanzu:admin:fetch-vendor');
$command->run([], $output); $command->run(new ArrayInput([]), $output);
} catch (\Exception $ex) { } catch (\Exception $ex) {
$io->error('Failed to fetch vendors for avanzu-admin-theme: ' . $ex->getMessage()); $io->error('Failed to fetch vendors for avanzu-admin-theme: ' . $ex->getMessage());
return 3; return 3;
} }
try { try {
$command = $this->getApplication()->find('avanzu:admin:initialize'); $command = $this->getApplication()->find('avanzu:admin:initialize');
$command->run(new ArrayInput(array_merge(['--web-dir' => 'public'], $arguments)), $output); $command->run(
new ArrayInput(
array_merge([
'--web-dir' => $this->rootDir . '/public',
'--vendor-dir' => $this->rootDir . '/vendor',
], $arguments)
),
$output
);
} catch (\Exception $ex) { } catch (\Exception $ex) {
$io->error('Failed to initialize avanzu-admin-theme: ' . $ex->getMessage()); $io->error('Failed to initialize avanzu-admin-theme: ' . $ex->getMessage());
return 4; return 4;