Main Setup
The main setup file is located in the common "Library"
folder, and is named "This.pm".
We define in this file the settings common for all shops, like:
- the paths to the script and images directories
- the script method; recommended is the default: "POST"
- a list of the available shops, and their paths
- the sendmail settings
$ScriptBaseDir
This variable can have one of the two distinct values, depending on whether
you are running mod_perl or normal perl. Some ISP's offer the same directory
for both, but the correct approach is to have a different alias for each.
There is a good reason for that: when you are working on development,
and you change frequently the code, running mod_perl will cause the script
to ignore the changes, since all the modules are loaded in memory and
executed there.
Here is the standard form for it:
my $ScriptBaseDir = $UseModPerl ? '/mod-cgi/store': '/cgi-bin/store';
$RootPath
This is the root path to the script. On most systems you can get away
with using a dot, to make the paths
relative to the current directory.
Example(NT):
my $RootPath = 'w:/cgi/city/store';
or for Unix:
my $RootPath = '/var/www/cgi-bin/store';
In most cases, a simple dot will do:
my $RootPath = '.';
$WebRootPath
We need this path to provide support for static pages (form parameter:
'spage'). This path is usually the path to the directory where you keep
your site static content, or simply, where you upload your index.html.
Furthermore, you can customize it for every shop, in the shop description
hash.
Example(NT):
my $WebRootPath = 'w:/http/city';
or for Unix:
my $WebRootPath = '/home/city/www';
$ImageRootPath
The $ImageRootPath is the path to the images folder. It is used
to form the -SHOP_IMAGES_PATH.
If you look in the shop description hash, you will see that we append
there the true images path to this path.
Using this variable might not be what you want to use as a common path,
when every shop has a different root path for its contents. In that case,
replace it in every shop description with the complete and correct image
root path.
Example(NT):
my $ImageRootPath = 'w:/http/city';
or for Unix:
my $ImageRootPath = '/home/city/www';
$BasicURL
This is the URL to the standard, non-secure web site. It can be customized
for every shop, look in the shop description hash. If the shop does not
have one defined, the default will be considered.
Example:
my $BasicURL = 'http://www.mydomain.com';
$SecureURL
This is the URL to the secure web site. It can be customized for every
shop, look in the shop description hash. If the shop does not have one
defined, the default will be considered.
Example:
my $SecureURL = 'https://www.mydomain.com';
The description hash
Shop Paths
If your shops have different basic setups, you can customize that here.
Please be aware that these are paths, and it is recommended you use the
complete path from the root. If you don't know it, ask your ISP to provide
you with the information.
Shop URL's
These are URL's used to access the shop script and the images. Depending
on the degree of weirdness offered by your ISP, these URL's will be different
if you access a secure site, in some cases they even put the secure server
on a different physical machine. Currently the shop does NOT support the
secure server on a different machine.
Notice that some common keys were commented
out (# ***), to force an error when the shop corresponding values are
missing. Uncomment at your own risk!
-COMMON_SCRIPT_BASE_DIR
This key points to the variable $ScriptBaseDir, and is the root
path to the shop directory.
-COMMON_BASE_URL
This key points to the variable $BasicURL. This value is used
to provide a default, in case the -SHOP_BASE_URL is missing.
-COMMON_SECURE_BASE_URL
This key points to the variable $SecureURL. This value is used
to provide a default, in case the -SHOP_SECURE_BASE_URL is missing.
-COMMON_SCRIPT_URL
This key stores the full URL(non-secure) to the cgi script for the shop,
usually store.cgi. This value is used to provide a default, in
case the -SHOP_SCRIPT_URL is missing.
-COMMON_SECURE_SCRIPT_URL
This key stores the full URL(secure) to the cgi script for the shop,
usually store.cgi. This value is used to provide a default, in
case the -SHOP_SECURE_SCRIPT_URL is missing.
-COMMON_MANAGER_URL
This key stores the full URL to the cgi script for the shop manager,
usually manager.cgi. This value is used to provide a default, in
case the -SHOP_MANAGER_URL is missing. You can define it as secure or
non-secure, as you need.
-COMMON_IMAGE_URL # ***
This key stores the full URL to the common images folder. There is seldom
a reason to use it, since every shop has its own images folder. This value
is commented out by default.
... more will follow in a few
|