Prerequisites:
a) Functioning Apache install with PHP support
Optional:
b) Functioning MySQL install
c) Jpgraph downloaded (http://www.aditus.nu/jpgraph/)
Note! In order to use jpgraph, your PHP installation needs to be
configured with the GD library.
----------------------------------
1) Download polaring
2) Extract archive and put the files on your server
3) Set configuration up:
By default web-config is only allowed from IP address 127.0.0.1.
(i) access polaring from address 127.0.0.1
I e something like "http://127.0.0.1/path-to-polaring/"
OR
(ii) in file "$POLARING/configuration.php", for every pages that you want to access
from a given server, exchange "127.0.0.1" to the IP of that server.
I e, to be able to change settings from the browser accessing polaring from
server at address 192.168.1.1, change the following line:
$configValidIp['settings'] = "127.0.0.1";
into
$configValidIp['settings'] = "192.168.1.99";
OR
(iii) manually edit settings. That is, fire up your favourite editor; figure out what
the different variables means -- I *have* tried to make it somewhat intelligeble --;
edit to suit your needs.
Should you choose to edit settings through your browser, make sure the file is
writable by webserver.
4) Configure to your needs. The following are stuff you might want to consider modifying:
*Name* : If you don't use MySQL, it doesn't really matter what you have here. But if
youse MySQL, the info will be saved in the table with this name as a reference.
So having individual names here enables you to have different, separate setups
of Polaring using the same MySQL table.
*Hr max* : Used in all graphs utilizing maximum heartrate.
*Path to Jpgraph* : If you don't have a valid jpgraph directory at this path, you
won't have any graphs. So this is a good thing to _set right._ :-) Luckily, it's very
easy to setup jpgraph. You really only need to download it; extract; put the resulting
directory anywhere in your server-space, and, here, direct polaring to it. Presto!
*Use TTY-fonts* : It will look better if you do! But you need to point polaring to a
directory with valid TTF fonts. (See below.)
*Path to TTY-fonts* : Where on your server TrueType fonts can be found. If it's a
local install on a linux machine, it might be at /usr/share/fonts/TTF; at a mac try
/usr/X11/lib/X11/fonts/TTF. Wouldn't know about a windows-machine; sorry. :-S
*Activate MySQL-support* : Without MySQL polaring reads your workouts each time the
page is loaded. The performance quickly grows to something horribly slow as your
workouts increase. MySQL enables polaring to keep a cache, and accessing that is *way*
quicker. But you need a functioning MySQL environment.
*Directory containing workouts* : Pretty self-explanatory. But one of the most
important settings for you to get something out of polaring.
*Userdata* : Make sure the directory you point polaring at, here, is writable by
server!
*Path to srd2hrm-executable* : This is only needed if you have workouts saved as
SRD-files. If you don't, just ignore this. If you do have; this is only used to create
graphs. Acquire it with Daves s710 package (http://code.google.com/p/s710/).
*Google Maps API key* : No need what so ever for this -- unless you have workouts
saved in Garmins HST or TCX format, which contains GPS-data. If you, however, do have
that, then you can enter a valid API key for your server here, and have
Google-provided maps of your workouts. (http://code.google.com/apis/maps/signup.html)
OPTIONAL
5) Set up MySQL for polaring:
* Create database for polaring. You can use the polaring.sql script found in
$POLARING/functions, like so: mysql -u USER -p < $POLARING/functions/polaring.sql
This creates a database 'polaring', and some tables.
Should you, for some reason, need the database to be called something else,
simply edit the polaring.sql file to suit your needs, and configuration.php to
reflect it.
6) Increase allowed memory usage.
In case you get any errors like "Allowed memory size of x bytes exhausted...",
this is for you. The Garmin-part(s) of Polaring are very sloppily coded, and
use far more memory than should be the case. ***Help is very much appreciated,***
if you would have any suggestions on how to improve it. I hope to do it myself
eventually, but I'm really out on too deep water here, so don't hold your breath.
In the meantime, to get things working you will have to increase memory available
for PHP. You can either do it [A] "server-wide", by making the necessary changes
in php.ini, or [B] project-specificly, by adding one or more lines in the Polaring
code. [A] is foolproof and will only require change in one line. [B] would
probably be better practice though --- it's your *safest* bet, if not the best.
[A] Open up your php.ini and find a line like
memory_limit = 8M
The number may vary depending on your settings.
Now, simply increase the variable until you stop getting the error. The
larger your garmin files are, the larger the variable will have to be.
I've had to increase it up to 512M... (Which is a testament of my coding
inabilities...)
[B] Open up polaring.php. Early on in the settings, there's a line like
//ini_set("memory_limit", "256M");
Uncomment it (read: remove the two slashes at the beginning of the line) and
reload Polaring to see if it was enough. If not, increase the number.
If things don't improve no matter how high you set the variable to, you'll
need to insert a line _just like the one above_ just before the line that's
exhausting the memory.
So, if your error says something like "in functions/garminparser.php on line
40", then fire up your editor and insert a line like the above just before
line 40.
Really, it's a lot easier than what it sounds like!