I'm reading a Sentry tutorial for implementing an authentication workflow in a webapp. I'm a PHP beginner. There's a thing I don't understand in this code:

// set up autoloader
require ('vendor\autoload.php');

// configure database
$dsn = 'mysql:dbname=appdata;host=localhost';
$u = 'sentry';
$p = 'g39ejdl';
  new PDO($dsn, $u, $p));

What is the meaning of Cartalyst\Sentry\Facades\Native\Sentry? What's happening there? Is it a server file path? While debugging I found that this line doesn't execute.

closed as off-topic by Stephen Ostermiller Dec 12 '17 at 15:01

  • This question does not appear to be about webmastering within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.


You have a case of PHP syntax for namespaces, this has nothing to do with path and filenames on disk. See this introduction: http://php.net/manual/en/language.namespaces.basics.php (even if it compares PHP namespaces to concept of disk directories and files, it is an analogy, not a 1-1 mapping)

It sure should execute.

Not the answer you're looking for? Browse other questions tagged or ask your own question.