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/pupae20091223
  • todo: minor issue: document further detailed
Variables
array $config (line 33)

Configurations

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

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

Base URL of the key

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

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

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 55)

Database name

Change this if you want to run different versions of the database. Default "chirokey_pupae". 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 71)

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 42)

Server setting (host name)

Default "localhost".

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

MySQL user for the database

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

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

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 104)

Directory of taxa

Default "imgpupae/". 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 194)

Font for reference in pictures

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

Allowed (maximal) file size in kB

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

Allowed (maximal) width or height of images

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

Default angle in transparency text images

Used for table headings.

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

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 204)

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 212)

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 240)

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

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

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 234)

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

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

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 186)

n-characters of comments

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

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

Settings for popup window with text area (editing texts)

Default width 800 (px) height 600

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

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 79)

Server root directory for the key

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

array $MysqlInsert (line 1314)

MySQL's inserts

array $MysqlSelect (line 271)

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 329)

Query table names_synonyms gernera + #species

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

Query table names_genera gernera + ID

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

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 908)

Fetch characters of Genus sp.

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

Fetch for select list for specimens

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

Fetch characters for a single specimen

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

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 862)

Show data in table characters

array $MysqlUpdate (line 1245)

MySQL's updates

For altering the database.

Documentation generated on Sun, 19 Jul 2009 14:48:41 +0800 by phpDocumentor 1.4.2