• Increase font size
  • Default font size
  • Decrease font size
Home Software Automap Automap advanced concepts - Base path

Automap advanced concepts - Base path

E-mail Print
Read : 9,093 times
(0 votes, average 0 out of 5)
Article Index
Automap advanced concepts
Base path
Structure of a map file
All Pages

Map file location and base path

Map files store the paths of script files as relative paths. At runtime, when a symbol is resolved, the relative path is combined with what we call the base path.

The default base path is the directory containing the map file. This way, a map file and the related code can be moved anywhere, provided the scripts are accessible from the map file using the same relative paths. This is what you will use in most cases. Remember that the path you specify on the command line when registering your scripts will be registered along with your symbols.

It is also possible to set a base_path option in the map file. It can be used, for instance, when the relative path from the map to the scripts is modified, and the map cannot be rebuilt. In this case, the base_path option contains the relative path from the directory containing the map to the root of the file tree.

In other words, the scripts are accessed using this path combination :

<map file directory>/<base_path>/<path registered in the map>

where the default base_path is empty.

It is also possible to set an absolute path as base_path option. In this case, the location of the map file is not used anymore when accessing script files. This practice is discouraged because it is generally better to keep the scripts and their map in the same file tree, no matter where this tree is physically located. But, if you know what you're doing, it is supported.

The syntax to add and remove a base path to/from a map file is :

php automap.phk set_option [-m <map path>] base_path <new-base-path>

php automap.phk unset_option [-m <map path>] base_path


Please login or register to add a comment