Release 1.16 (#2929)

Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
Co-authored-by: SC <lalocas@protonmail.com>
Co-authored-by: dkstiler <dkstiler@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
This commit is contained in:
Kevin Papst
2021-11-16 10:51:01 +01:00
committed by GitHub
parent 95796ab256
commit f63a2c8ef6
39 changed files with 91 additions and 52 deletions

View File

@@ -25,7 +25,7 @@ class Constants
/**
* The current release status, either "stable" or "dev"
*/
public const STATUS = 'dev';
public const STATUS = 'prod';
/**
* The software name
*/

View File

@@ -56,6 +56,9 @@ class ExportServiceCompilerPass implements CompilerPassInterface
foreach (glob($path . $exportPath . '/*.html.twig') as $htmlTpl) {
$tplName = basename($htmlTpl);
if (stripos($tplName, '-bundle') !== false) {
continue;
}
$serviceId = 'exporter_renderer.' . str_replace('.', '_', $tplName);
@@ -70,6 +73,9 @@ class ExportServiceCompilerPass implements CompilerPassInterface
foreach (glob($path . $exportPath . '/*.pdf.twig') as $pdfHtml) {
$tplName = basename($pdfHtml);
if (stripos($tplName, '-bundle') !== false) {
continue;
}
$serviceId = 'exporter_renderer.' . str_replace('.', '_', $tplName);

View File

@@ -120,33 +120,26 @@ class Kernel extends BaseKernel
}
} else {
// ... or we load them dynamically from the plugins directory
foreach ($this->getBundleDirectories() as $bundleDir) {
$bundleName = $bundleDir->getRelativePathname();
$pluginClass = 'KimaiPlugin\\' . $bundleName . '\\' . $bundleName;
foreach ($this->getBundleClasses() as $pluginClass) {
yield new $pluginClass();
}
}
}
private function getBundleDirectories(): array
private function getBundleClasses(): array
{
$pluginsDir = $this->getProjectDir() . '/var/plugins';
if (!file_exists($pluginsDir)) {
return [];
}
$directories = [];
$plugins = [];
$finder = new Finder();
$finder->ignoreUnreadableDirs()->directories()->name('*Bundle');
/** @var SplFileInfo $bundleDir */
foreach ($finder->in($pluginsDir) as $bundleDir) {
$bundleName = $bundleDir->getRelativePathname();
$bundleFilename = $bundleDir->getRealPath() . '/' . $bundleName . '.php';
if (!file_exists($bundleFilename)) {
continue;
}
if (file_exists($bundleDir->getRealPath() . '/.disabled')) {
continue;
}
@@ -156,10 +149,10 @@ class Kernel extends BaseKernel
continue;
}
$directories[] = $bundleDir;
$plugins[] = $pluginClass;
}
return $directories;
return $plugins;
}
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)
@@ -223,7 +216,11 @@ class Kernel extends BaseKernel
foreach ($this->bundles as $bundle) {
if (strpos(\get_class($bundle), 'KimaiPlugin\\') !== false) {
$routes->import($bundle->getPath() . '/Resources/config/routes' . self::CONFIG_EXTS, '/', 'glob');
if (is_dir($bundle->getPath() . '/Resources/config/')) {
$routes->import($bundle->getPath() . '/Resources/config/routes' . self::CONFIG_EXTS, '/', 'glob');
} elseif (is_dir($bundle->getPath() . '/config/')) {
$routes->import($bundle->getPath() . '/config/routes' . self::CONFIG_EXTS, '/', 'glob');
}
}
}
}

View File

@@ -205,7 +205,7 @@ final class LocaleFormatExtensions extends AbstractExtension
public function dateWeekday(DateTime $date): string
{
return $this->dayName($date, true) . ', ' . $this->getFormatter()->dateFormat($date, 'd');
return $this->dayName($date, true) . ' ' . $this->getFormatter()->dateFormat($date, 'd');
}
/**