31,003
edits
PolyglotBot (talk | contribs) m (Import interlang links (links to translated versions of this page in other languages) from Multi Language Manager table.) |
Tag: 2017 source edit |
||
| Line 229: | Line 229: | ||
if (! $res) die("Include of main fails"); | if (! $res) die("Include of main fails"); | ||
</source> | </source> | ||
As you can see, there si several tries to load the main.inc.php (or master.inc.php). The goal is to succeed in the most cases as possible. The minimum is 2 lines: one to try to load the master/main.inc.php into the dolibarr root directory and another one to try to load the file to support the case when the module is deployed into the "custom" directory. But you can have more to deal more situation. The provided example should be able to load the file main/master.inc.php in nearly all situation/setups. | |||
Note that you may add more "../" depending on the depth of the file relative to your module directory tree. | Note that you may add more "../" depending on the depth of the file relative to your module directory tree. | ||
It's in the main.inc.php file that is loaded technical environment variables and permissions. The following variables are objects positioned in this file: | It's in the main.inc.php file that is loaded technical environment variables and permissions. The following variables are objects positioned in this file: | ||