0

I have to understand a script to make some additions and I have some short questions.

There are these few lines:

if(!isset($GLOBALS['DB'])){
    $DB = new System\Database\MySQL(DB_SERVER,DB_USER,DB_PASSWORD,DB_NAME,DB_PORT);
}

new System\SessionHandler();

I don't understand which path System\Database\MySQL and System\ defines, because there are no folders with these names.

4
  • 9
    They're namespaces Commented Sep 26, 2013 at 13:58
  • 1
    Read about namespaces. Commented Sep 26, 2013 at 13:58
  • namespaces are the files which are used in the code, the below path is from one of the file mentioned in the namespaces. Commented Sep 26, 2013 at 14:04
  • grep -R 'namespace System\\Database' your/app/root might help to find the file that defines the MySQL class. Commented Sep 26, 2013 at 14:17

2 Answers 2

1

As John and Elon are saying they are namescpaces. This is creating a new object MySQL with the parameters: Server, User, Password, Database and Port.

Sign up to request clarification or add additional context in comments.

Comments

0

System\Database\MySQL may not neccessary match the path actually. This is just namespace. It depends on autoloader implementation. But in your case it can absent and you should look for manual include/require somewhere else up in the code.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.