0

I have developed a small PHP application that runs parallel and self-sufficient to a main application. This main application has a configuration file with defines (e.a. database connect configuration and so on...) that I need for my application. The problem is that this main application has defines and includes that are in conflict with my application.

The question is how can I use particular defines fom this configuration file, but not the defines and includes I don't want to?

5
  • 1
    Does this answer your question? PHP, getting variable from another php-file Commented Jan 13, 2021 at 7:40
  • 1
    why dont you just not use the same nor for defines or you can use boolean function_exists($function_name) for function to check if they are defined already and use this for constant if(defined('FOO')) { // do something when it is defined } else { // do something else because it isn't } Commented Jan 13, 2021 at 7:41
  • @Angelin Calu No, it doesn't. The configuration file contains a huge mix of existing includes and defines. Defines with the same name as in my configuration, but different values for e.a. path and so on. Commented Jan 13, 2021 at 8:03
  • @Hammad Ahmed khan configuration file has no functions. Only defines and includes. Defines I can overwrite, but not the includes or can I "block" includes? Commented Jan 13, 2021 at 8:05
  • With php file I can read the defines I need and get an array with all defines: php.net/manual/de/function.file.php Commented Jan 13, 2021 at 8:48

0

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.