/** * Creates a Logger component */ private function createLogger() { $logFolder = $this->filesystem->assertFolderWritable($this->rootFolder . '/var/log'); $logLevel = $this->debug === true ? LogLevel::DEBUG : $this->config->get('logger.level', LogLevel::WARNING); $args = [$logFolder, $this->config->get('logger.name', 'application'), $this->config->get('logger.filelogger.maxfiles', 10), $logLevel]; $this->logger = (new \ReflectionClass($this->loggerFactory))->newInstanceArgs($args)->create(); $this->logger->debug('Logger started'); }
public function testAssertWritable() { $fs = new Filesystem(); if (!is_windows()) { $this->assertEquals('/tmp', $fs->assertFolderWritable('/tmp')); } else { $this->assertTrue(true); } }
protected function initializeSession(Request $request) { if (!$request->hasSession()) { if (!$this->container->isDefined(SessionProviderInterface::class)) { $savePath = $this->filesystem->assertFolderWritable($this->rootFolder . '/var/session'); $this->container->defineSingletonWithInterface(SessionProviderInterface::class, NativeSessionProvider::class, ['save_path' => $savePath]); } /* @var $provider SessionProviderInterface */ $provider = $this->container->get(SessionProviderInterface::class); $provider->initializeSession($request); $this->container->setScalar(SessionInterface::class, $provider->getSession()); } }