*/ class Application extends SilexApplication { /** * @var string */ protected $rootDir; /* * Configures the application. */ public function configure() { $users = json_decode(file_get_contents($this->getRootDir().'/etc/security/users.json'), true); $this->register(new SecurityServiceProvider(), [ 'security.firewalls' => [ 'api' => [ 'pattern' => '^/api', 'http' => true, 'users' => $users, ], ], ]); } /* * Set the value of "rootDir". * * @param string $rootDir * * @return */ public function setRootDir($rootDir) { $this->rootDir = $rootDir; return $this; } /* * Get the value of "rootDir". * * @return string */ public function getRootDir() { return $this->rootDir; } }