File/structure/config.php

Description

Program's configuration/MySQL queries (unicode utf8!!!)

Imortant note: all files of the program use utf8 encoding. To prevend therefore damage you should use an unicode compatible editor like notepad++ or the crimsoneditor both also with syntax highlighting. The default Notepad Editor in Windows is only a crutch (File ends has to be UNIX). Wordpad instead is capable to read utf8 files and the file ends correct. In contrast to Linux Windows unfortunately doesn't bother about using unicode at all by default in general. Because their interest is only in their own products which are desingned not to cooporate with humanity without the idea of profit.

  • author: Andreas Plank <andreas.plank@web.de>
  • version: 2009-06-10 09:27:51
  • todo: seems be done: enable to run different versions in different folders like /chip/larvae20091223
  • todo: minor issue: document further detailed
Variables
array $config (line 35)

Configurations

Sets all necessary configurations for database and program settings: popup, image defaults colornames...

string $config['BaseUrl'] (line 122)

Base URL of the key

Default "http://localhost/chip/".

string $config['colornames'] (line 143)

Colors' declaration for {color name}

This tries to illustrate different colors given in descriptions and to use them rather esyly with e.g.

  1. {red orange}
Corresponding to 'red orange' it *must* be exist an additional defined CSS class, which produces then by the parser:
  1. <span class='redorange'>red orange</span>
This can be set in /structure/css/basic.css as CSS-class without spaces:
  1.  span.redorange {
  2.    background-color:#FF7F50;
  3.  }

string $config['database'] (line 66)

Database name

Change this if you want to run different versions of the database. Default "chirokey_larvae". Important: if a database was renamed via phpmyadmin it's the case that in table `names_authors` for entry 'No reference given' ID=0 was altered to any other ID from the auto increment function for ID. You must restore this to 'No reference given' with ID=0 otherwise only images with a given descriptor name will be shown in the key (i.e. no NULL entries).

string $config['dbpassword'] (line 82)

MySQL password for the database

Change this if you want to run with another password but you have to alter settings for MySQL as well. Default "chiroproject". Note when you change this you have to change it for the MySQL database with phpmyadmin as well!

string $config['dbserver'] (line 53)

Server setting (host name)

Default "localhost".

string $config['dbuser'] (line 73)

MySQL user for the database

Change this if you want to run from a different user. Default "chiro_user".

array $config['debug'] (line 271)

Some debug information (for developers)

Information about queries and time consumation of the PHP parser. Values: true or false. Is stored in a $_SESSION

string $config['dirSpec'] (line 115)

Directory of taxa

Default "imglarvae/". Note: directories can be renamed and being set here, but the directory-level structure should not be changed. If you renamed species directory please update table characters in the database with this query:

  1.  UPDATE `characters`
  2.    SET ecology REPLACE(`ecology`'/speciesDirOld/','/speciesDirNew/'),
  3.    notes REPLACE(`notes`'/speciesDirOld/','/speciesDirNew/');

string $config['fontpath'] (line 205)

Font for reference in pictures

integer $config['img_max_filesize'] (line 153)

Allowed (maximal) file size in kB

integer $config['img_max_size'] (line 159)

Allowed (maximal) width or height of images

string $config['img_text_angle'] (line 190)

Default angle in transparency text images

Used for table headings.

array $config['img_types'] (line 168)

Allowed mime-types of images

Note: this has to correspond with fileWriteDelete::writeReference(). For each image mime type a handling procedure in fileWriteDelete::writeReference() has to be defined.

array $config['languages'] (line 215)

Language characters (eg. for menu in popup.php)

Is an array with languages. Use international URL code extension used also in the internet: 'de', 'ru', 'us' and so on.

array $config['languages']['default'] (line 223)

Default language characters (eg. for menu in popup.php)

See the PHP array key in configuration variable $config['languages']['keys'].

array $config['languages']['eu'] (line 251)

Europe language characters (eg. for menu in popup.php)

array $config['languages']['keys'] (line 235)

Language characters keys (eg. for menu in popup.php)

I recommend to use international abbreviations such as 'ru', 'cn', 'eu' and so on. If you want to add a new character set, add a new unique 'mykey' => 'My peculiar characters' and use 'mykey' to define a new character set with spaced characters like

  1. $config['languages']['mykey'"n e w c h a r a c t e r s";
Then you should hav a new character set available.

array $config['languages']['ru'] (line 245)

Russian language characters (eg. for menu in popup.php)

array $config['languages']['sy'] (line 261)

Symbol characters (eg. for menu in popup.php)

Important: you need also unicode compatible browsers to display the characters properly. If you see only boxes instead of characters use unicode fonts or another browser. I tested once Internet Explorer 6 but there was no proper display possible. With Opera everything was fine (on Linux).

string $config['max_comment_length'] (line 197)

n-characters of comments

Not used now. 2009-06-30 03:43:34. Suggested use in select options to shorten too long strings.

string $config['phpmyadminpath'] (line 45)

Path to phpmyadmin

Depending on PHP version > 5.2 use then phpmyadmin3 otherwise phpmyadmin2-11-4. Note that PHP 5.2 and phpmyadmin2-11-4 won't work together and PHP < 5.2 does not work with phpmyadmin3.

array $config['popup'] (line 178)

Settings for popup window with text area (editing texts)

Default width 800 (px) height 600

string $config['ServerKeyDir'] (line 99)

Key directory of the program

Default "key/". This folder contains all necessary files for the key. Note: directories can be renamed and being set here, but the directory-level structure should not be changed.

string $config['ServerRootDir'] (line 90)

Server root directory for the key

Default "chip/larvae/". Note: directories can be renamed and being set here, but the directory-level structure should not be changed.

array $MysqlInsert (line 1444)

MySQL's inserts

array $MysqlSelect (line 282)

MySQL Queries

Different queries used to connect to the database. If something is wrong or queries are too slow you can analyse manually MySQL's behavior by

  1. EXPLAIN SELECT ...
or
  1. DESCRIBE SELECT ...
If you reorder SELECT-statemanet in FROM `table1`, `table2` anew it is possible to force MySQL's SELECT to be faster with
  1. SELECT STRAIGHT_JOIN ...
But it is only necessary if the MySQL analyser will fail to optimize the SELECT query.

array $MysqlSelect['GeneraSynoCounted'] (line 340)

Query table names_synonyms gernera + #species

array $MysqlSelect['GeneraToIdAll'] (line 290)

Query table names_genera gernera + ID

  • annotation: $MysqlSelect['GeneraToIdAll']
array $MysqlSelect['GeneraValidId'] (line 310)

Query valid gernera + subfamily

It fetches only valid genera names, not all genera from table names_genera. Note that `names_valid`.`id` is needed in context of Genus sp. not `names_valid`.`genus_name_id`!

  • annotation: $MysqlSelect['GeneraValidId']
string $MysqlSelect['GenusCharacters'] (line 919)

Fetch characters of Genus sp.

string $MysqlSelect['SpecimenCharacters'] (line 944)

Fetch for select list for specimens

string $MysqlSelect['SpecimenCharactersBitlenght'] (line 985)

Fetch bitlength of additional data for page specimen

string $MysqlSelect['SpecimenCharactersSingle'] (line 1090)

Fetch characters for a single specimen

string $MysqlSelect['Synonyms'] (line 400)

MySQL queries to compose synonyms

It uses the variable $addMySQL to add for instance

  1. $addMySQL "AND `synonyms`.`note` LIKE 'this%'";

string $MysqlSelect['TaxaExistInCharacters'] (line 873)

Show data in table characters

array $MysqlUpdate (line 1375)

MySQL's updates

For altering the database.

Documentation generated on Mon, 14 Dec 2009 14:37:05 +0100 by phpDocumentor 1.4.2