aboutsummaryrefslogtreecommitdiffhomepage
path: root/login/app/sprinkles/core/src
diff options
context:
space:
mode:
authormarvin-borner@live.com2018-04-15 19:16:19 +0200
committermarvin-borner@live.com2018-04-15 19:16:19 +0200
commit619b01b3615458c4ed78bfaeabb6b1a47cc8ad8b (patch)
treef6be4552e31964ac894860bcfdc832e3c5740ad8 /login/app/sprinkles/core/src
parent937100e9bb2a2f5ab035e283e01e6d96e569ee51 (diff)
Preparing for soon implementation of content management system
Diffstat (limited to 'login/app/sprinkles/core/src')
-rwxr-xr-xlogin/app/sprinkles/core/src/Controller/CoreController.php19
-rwxr-xr-xlogin/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php42
2 files changed, 28 insertions, 33 deletions
diff --git a/login/app/sprinkles/core/src/Controller/CoreController.php b/login/app/sprinkles/core/src/Controller/CoreController.php
index 0dd8165..b5f6e3c 100755
--- a/login/app/sprinkles/core/src/Controller/CoreController.php
+++ b/login/app/sprinkles/core/src/Controller/CoreController.php
@@ -5,6 +5,7 @@
* @link https://github.com/userfrosting/UserFrosting
* @license https://github.com/userfrosting/UserFrosting/blob/master/licenses/UserFrosting.md (MIT License)
*/
+
namespace UserFrosting\Sprinkle\Core\Controller;
use Psr\Http\Message\ServerRequestInterface as Request;
@@ -26,8 +27,7 @@ class CoreController extends SimpleController
* By default, this is the page that non-authenticated users will first see when they navigate to your website's root.
* Request type: GET
*/
- public function pageIndex($request, $response, $args)
- {
+ public function pageIndex($request, $response, $args) {
return $this->ci->view->render($response, 'pages/index.html.twig');
}
@@ -36,8 +36,7 @@ class CoreController extends SimpleController
*
* Request type: GET
*/
- public function pageAbout($request, $response, $args)
- {
+ public function pageAbout($request, $response, $args) {
return $this->ci->view->render($response, 'pages/about.html.twig');
}
@@ -46,8 +45,7 @@ class CoreController extends SimpleController
*
* Request type: GET
*/
- public function pageLegal($request, $response, $args)
- {
+ public function pageLegal($request, $response, $args) {
return $this->ci->view->render($response, 'pages/legal.html.twig');
}
@@ -56,8 +54,7 @@ class CoreController extends SimpleController
*
* Request type: GET
*/
- public function pagePrivacy($request, $response, $args)
- {
+ public function pagePrivacy($request, $response, $args) {
return $this->ci->view->render($response, 'pages/privacy.html.twig');
}
@@ -67,8 +64,7 @@ class CoreController extends SimpleController
* The alert stream contains messages which have been generated by calls to `MessageStream::addMessage` and `MessageStream::addMessageTranslated`.
* Request type: GET
*/
- public function jsonAlerts($request, $response, $args)
- {
+ public function jsonAlerts($request, $response, $args) {
return $response->withJson($this->ci->alerts->getAndClearMessages());
}
@@ -76,8 +72,7 @@ class CoreController extends SimpleController
* Handle all requests for raw assets.
* Request type: GET
*/
- public function getAsset($request, $response, $args)
- {
+ public function getAsset($request, $response, $args) {
// By starting this service, we ensure that the timezone gets set.
$config = $this->ci->config;
diff --git a/login/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php b/login/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php
index 5fcffbc..c67b886 100755
--- a/login/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php
+++ b/login/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php
@@ -5,6 +5,7 @@
* @link https://github.com/userfrosting/UserFrosting
* @license https://github.com/userfrosting/UserFrosting/blob/master/licenses/UserFrosting.md (MIT License)
*/
+
namespace UserFrosting\Sprinkle\Core\ServicesProvider;
use Dotenv\Dotenv;
@@ -70,8 +71,7 @@ class ServicesProvider
*
* @param ContainerInterface $container A DI container implementing ArrayAccess and container-interop.
*/
- public function register(ContainerInterface $container)
- {
+ public function register(ContainerInterface $container) {
/**
* Flash messaging service.
*
@@ -126,7 +126,7 @@ class ServicesProvider
// TODO: move this out into PathBuilder and Loader classes in userfrosting/assets
// This would also allow us to define and load bundles in themes
- $bundleSchemas = array_reverse($locator->findResources('sprinkles://' . $config['assets.raw.schema'], true, true));
+ $bundleSchemas = array_reverse($locator->findResources('sprinkles://' . $config['assets.raw.schema'], TRUE, TRUE));
foreach ($bundleSchemas as $schema) {
if (file_exists($schema)) {
@@ -138,7 +138,7 @@ class ServicesProvider
$aub = new CompiledAssetUrlBuilder($baseUrl);
$as = new AssetBundleSchema($aub);
- $as->loadCompiledSchemaFile($locator->findResource("build://" . $config['assets.compiled.schema'], true, true));
+ $as->loadCompiledSchemaFile($locator->findResource("build://" . $config['assets.compiled.schema'], TRUE, TRUE));
}
$am = new AssetManager($aub, $as);
@@ -156,7 +156,7 @@ class ServicesProvider
$config = $c->config;
if ($config['cache.driver'] == 'file') {
- $path = $c->locator->findResource('cache://', true, true);
+ $path = $c->locator->findResource('cache://', TRUE, TRUE);
$cacheStore = new TaggableFileStore($path);
} elseif ($config['cache.driver'] == 'memcached') {
// We need to inject the prefix in the memcached config
@@ -307,9 +307,9 @@ class ServicesProvider
// Register listener
$queryEventDispatcher->listen(QueryExecuted::class, function ($query) use ($logger) {
$logger->debug("Query executed on database [{$query->connectionName}]:", [
- 'query' => $query->sql,
+ 'query' => $query->sql,
'bindings' => $query->bindings,
- 'time' => $query->time . ' ms'
+ 'time' => $query->time . ' ms'
]);
});
}
@@ -325,11 +325,11 @@ class ServicesProvider
$container['debugLogger'] = function ($c) {
$logger = new Logger('debug');
- $logFile = $c->locator->findResource('log://userfrosting.log', true, true);
+ $logFile = $c->locator->findResource('log://userfrosting.log', TRUE, TRUE);
$handler = new StreamHandler($logFile);
- $formatter = new MixedFormatter(null, null, true);
+ $formatter = new MixedFormatter(NULL, NULL, TRUE);
$handler->setFormatter($formatter);
$logger->pushHandler($handler);
@@ -365,11 +365,11 @@ class ServicesProvider
$container['errorLogger'] = function ($c) {
$log = new Logger('errors');
- $logFile = $c->locator->findResource('log://userfrosting.log', true, true);
+ $logFile = $c->locator->findResource('log://userfrosting.log', TRUE, TRUE);
$handler = new StreamHandler($logFile, Logger::WARNING);
- $formatter = new LineFormatter(null, null, true);
+ $formatter = new LineFormatter(NULL, NULL, TRUE);
$handler->setFormatter($formatter);
$log->pushHandler($handler);
@@ -385,7 +385,7 @@ class ServicesProvider
$container['factory'] = function ($c) {
// Get the path of all of the sprinkle's factories
- $factoriesPath = $c->locator->findResources('factories://', true, true);
+ $factoriesPath = $c->locator->findResources('factories://', TRUE, TRUE);
// Create a new Factory Muffin instance
$fm = new FactoryMuffin();
@@ -439,10 +439,10 @@ class ServicesProvider
$container['mailLogger'] = function ($c) {
$log = new Logger('mail');
- $logFile = $c->locator->findResource('log://userfrosting.log', true, true);
+ $logFile = $c->locator->findResource('log://userfrosting.log', TRUE, TRUE);
$handler = new StreamHandler($logFile);
- $formatter = new LineFormatter(null, null, true);
+ $formatter = new LineFormatter(NULL, NULL, TRUE);
$handler->setFormatter($formatter);
$log->pushHandler($handler);
@@ -478,11 +478,11 @@ class ServicesProvider
$container['queryLogger'] = function ($c) {
$logger = new Logger('query');
- $logFile = $c->locator->findResource('log://userfrosting.log', true, true);
+ $logFile = $c->locator->findResource('log://userfrosting.log', TRUE, TRUE);
$handler = new StreamHandler($logFile);
- $formatter = new MixedFormatter(null, null, true);
+ $formatter = new MixedFormatter(NULL, NULL, TRUE);
$handler->setFormatter($formatter);
$logger->pushHandler($handler);
@@ -494,7 +494,7 @@ class ServicesProvider
* Override Slim's default router with the UF router.
*/
$container['router'] = function ($c) {
- $routerCacheFile = false;
+ $routerCacheFile = FALSE;
if (isset($c->config['settings.routerCacheFile'])) {
$routerCacheFile = $c->config['settings.routerCacheFile'];
}
@@ -537,13 +537,13 @@ class ServicesProvider
$config = $c->config;
- if ($config->has('throttles') && ($config['throttles'] !== null)) {
+ if ($config->has('throttles') && ($config['throttles'] !== NULL)) {
foreach ($config['throttles'] as $type => $rule) {
if ($rule) {
$throttleRule = new ThrottleRule($rule['method'], $rule['interval'], $rule['delays']);
$throttler->addThrottleRule($type, $throttleRule);
} else {
- $throttler->addThrottleRule($type, null);
+ $throttler->addThrottleRule($type, NULL);
}
}
}
@@ -571,7 +571,7 @@ class ServicesProvider
* Also adds the UserFrosting core Twig extension, which provides additional functions, filters, global variables, etc.
*/
$container['view'] = function ($c) {
- $templatePaths = $c->locator->findResources('templates://', true, true);
+ $templatePaths = $c->locator->findResources('templates://', TRUE, TRUE);
$view = new Twig($templatePaths);
@@ -593,7 +593,7 @@ class ServicesProvider
$twig = $view->getEnvironment();
if ($c->config['cache.twig']) {
- $twig->setCache($c->locator->findResource('cache://twig', true, true));
+ $twig->setCache($c->locator->findResource('cache://twig', TRUE, TRUE));
}
if ($c->config['debug.twig']) {