Mobile app version of vmapp.org
Login or Join
Yeniel560

: PHP syntax issue 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: <?php // set up

@Yeniel560

Posted in: #Authentication #Php

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:

<?php
// set up autoloader
require ('vendorautoload.php');

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


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

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Yeniel560

1 Comments

Sorted by latest first Latest Oldest Best

 

@Courtney195

You have a case of PHP syntax for namespaces, this has nothing to do with path and filenames on disk.
See this introduction: 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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme