index.php
//Initialise Slim
$composer = json_decode(file_get_contents(__DIR__.'/../composer.json');
$app = new \Slim\Slim(
array(
'verion'=>$composer->version,
'debug'=>false,
'mode'=>'production'
)
);
I am learning how to add visualcaptcha to our login, but having trouble understanding what these lines mean.
This is how I would read it, get the content of composer.json
and turn it into an array. So now the $composer
has all the components that are needed for app app to work. Here is the tricky bit, I don't understand why is new \Slim\Slim(...)
? Also I made an assumption that it is an relative path to the Slim Framework.
I read this link to understand more about composer
and this link about slim framework
. But still having trouble understanding this. Maybe I am used to javascript or java and having trouble with other alternatives implementations.
Thanks in advance