Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
2
<HTML>
3
<HEAD>
4
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
5
<LINK REL="Start" HREF="index.html">
6
<LINK REL="Contents" HREF="toc.html">
7
<LINK REL="Prev" HREF="1221AdjustingthesizeoftheLEDdigits.html">
8
<STYLE TYPE="text/css"><!--
9
BODY { font-family: serif }
10
H1 { font-family: sans-serif }
11
H2 { font-family: sans-serif }
12
H3 { font-family: sans-serif }
13
H4 { font-family: sans-serif }
14
H5 { font-family: sans-serif }
15
H6 { font-family: sans-serif }
16
SUB { font-size: smaller }
17
SUP { font-size: smaller }
18
PRE { font-family: monospace }
19
A { text-decoration: none }
20
--></STYLE>
21
</HEAD>
22
<BODY>
23
<A HREF="toc.html">Contents</A>
24
<A HREF="1221AdjustingthesizeoftheLEDdigits.html">Previous</A>
25
<HR NOSHADE>
26
 
27
<H1><A NAME="13">13 Code defines in JpGraph</A></H1>
28
<P> Various settings in JpGraph are controlled by overall DEFINEs in the
29
 configuration file &quot;jpg-config.inc.php&quot;. Most of these defines have
30
 default values that should be valid for most usage.</P>
31
<P> In the rest of this chapter all constants are described with default
32
 value and usage.</P>
33
<P></P>
34
<TABLE cellpadding="3" cellspacing="0" class="codedefines">
35
<TR><TH>Define, default value</TH><TH>Comment</TH></TR>
36
<TR><TD valign="top">&quot;CACHE_DIR&quot;, &quot;/tmp/jpgraph_cache/&quot;</TD><TD>The full
37
 absolute name of directory to be used as a cache. This directory<STRONG>
38
 must</STRONG> be readable and writable for PHP. Must end with '/'</TD></TR>
39
<TR><TD valign="top">&quot;TTF_DIR&quot;, &quot;/usr/local/fonts/ttf/&quot;</TD><TD>
40
Directory for JpGraph TTF fonts. Must end with '/' The fonts must follow
41
 the naming conventions as used by the supplied TTF fonts in JpGraph.</TD>
42
</TR>
43
<TR><TD valign="top">&quot;CSIMCACHE_DIR&quot;, &quot;csimcache/&quot;</TD><TD>Directory for
44
 cache directory for CSIM graphs. Must end with '/' Cache directory
45
 specification for use with CSIM graphs that are using the cache. The
46
 directory must be the filesystem name as seen by PHP and the 'http'
47
 version must be the same directory but as seen by the HTTP server
48
 relative to the 'htdocs' directory. If a relative path is specified it
49
 is taken to be relative from where the image script is executed. Note:
50
 The default setting is to create a subdirectory in the directory from
51
 where the image script is executed and store all files there. As usual
52
 this directory must be writable by the PHP process.</TD></TR>
53
<TR><TD valign="top">&quot;CSIMCACHE_HTTP_DIR&quot;, &quot;csimcache&quot;</TD><TD>Directory
54
 for JpGraph TTF fonts. Must end with '/' Cache directory specification
55
 for use with CSIM graphs that are using the cache. The directory must
56
 be the filesystem name as seen by PHP and the 'http' version must be
57
 the same directory but as seen by the HTTP server relative to the
58
 'htdocs' directory. If a relative path is specified it is taken to be
59
 relative from where the image script is executed. Note: The default
60
 setting is to create a subdirectory in the directory from where the
61
 image script is executed and store all files there. As usual this
62
 directory must be writable by the PHP process.</TD></TR>
63
<TR><TD valign="top">&quot;CHINESE_TTF_FONT&quot;, &quot;bkai00mp.ttf&quot;</TD><TD> Actual
64
 name of the TTF file used together with FF_CHINESE aka FF_BIG5 This is
65
 the TTF file being used when the font family is specified as either
66
 FF_CHINESE or FF_BIG5</TD></TR>
67
<TR><TD valign="top">&quot;LANGUAGE_CYRILLIC&quot;, false</TD><TD> Special unicode
68
 Cyrillic language support.</TD></TR>
69
<TR><TD valign="top">&quot;CYRILLIC_FROM_WINDOWS&quot;, false</TD><TD> If you are
70
 setting this config to true the conversion will assume that the input
71
 text is windows 1251, if false it will assume koi8-r</TD></TR>
72
<TR><TD valign="top">'MINCHO_TTF_FONT', 'ipam.ttf'</TD><TD> Japanese
73
 TrueType font used with FF_MINCHO</TD></TR>
74
<TR><TD valign="top">'PMINCHO_TTF_FONT', 'ipamp.ttf'</TD><TD> Japanese
75
 TrueType font used with FF_PMINCHO</TD></TR>
76
<TR><TD valign="top">'GOTHIC_TTF_FONT', 'ipag.ttf'</TD><TD> Japanese
77
 TrueType font used with FF_GOTHIC</TD></TR>
78
<TR><TD valign="top">'PGOTHIC_TTF_FONT', 'ipagp.ttf'</TD><TD> Japanese
79
 TrueType font used with FF_PGOTHIC</TD></TR>
80
<TR><TD valign="top">&quot;INSTALL_PHP_ERR_HANDLER&quot;, false</TD><TD> Determine
81
 if the library should also setup the default PHP error handler to
82
 generate a graphic error message. This is useful during development to
83
 be able to see the error message as an image instead as a &quot;red-cross&quot;
84
 in a page where an image is expected.</TD></TR>
85
<TR><TD valign="top">&quot;CATCH_PHPERRMSG&quot;, true</TD><TD> Should the library
86
 examine the global php_errmsg string and convert any error in it to a
87
 graphical representation. This is handy for the occasions when, for
88
 example, header files cannot be found and this results in the graph not
89
 being created and just a &quot;red-cross&quot; image would be seen. This should
90
 be turned off for a production site.</TD></TR>
91
<TR><TD valign="top">&quot;USE_LIBRARY_GD2&quot;,false</TD><TD>Specify if we
92
 should use GD 2.x or GD 1.x If you have GD 2.x installed it is
93
 recommended that you use it since it will give a slightly, slightly
94
 better visual appearance for arcs. If you don't have GD2 installed this
95
 must be set to false!</TD></TR>
96
<TR><TD valign="top">'USE_TRUECOLOR',true</TD><TD>Should the image be a
97
 truecolor image? Note 1: Can only be used with GD 2.0.2 and above. Note
98
 2: GD 2.0.1 + PHP 4.0.6 on Win32 crashes when trying to use truecolor.
99
 Truecolor support is to be considered alpha since GD 2.x is still not
100
 considered stable (especially on Win32). Note 3: MUST be enabled to get
101
 background images working with GD2 Note 4: If enabled then truetype
102
 fonts will look very ugly =&gt; You can't have both background images and
103
 truetype fonts in the same image until these bugs has been fixed in GD
104
 2.01</TD></TR>
105
<TR><TD valign="top">&quot;USE_CACHE&quot;,false</TD><TD>Should the cache be used
106
 at all? By setting this to false no files will be generated in the
107
 cache directory. The difference from READ_CACHE being that setting
108
 READ_CACHE to false will still create the image in the cache directory
109
 just not use it. By setting USE_CACHE=false no files will even be
110
 generated in the cache directory.</TD></TR>
111
<TR><TD valign="top">&quot;READ_CACHE&quot;,true</TD><TD>Should we try to find an
112
 image in the cache before generating it? Set this define to false to
113
 bypass the reading of the cache and always regenerate the image. Note
114
 that even if reading the cache is disabled the cached will still be
115
 updated with the newly generated image. Set also &quot;USE_CACHE&quot; below.</TD>
116
</TR>
117
<TR><TD valign="top">&quot;DEFAULT_GFORMAT&quot;,&quot;auto&quot;</TD><TD>Default graphic
118
 format set to &quot;auto&quot; which will automatically choose the best available
119
 format in the order png,gif,jpg (The supported format depends on what
120
 your PHP installation supports)</TD></TR>
121
<TR><TD valign="top">&quot;USE_IMAGE_ERROR_HANDLER&quot;,true</TD><TD> Determine
122
 if the error handler should be image based or purely text based. Image
123
 based makes it easier since the script will always return an image even
124
 in case of errors.</TD></TR>
125
<TR><TD valign="top">&quot;USE_APPROX_COLORS&quot;,true</TD><TD>If the color
126
 palette is full should JpGraph try to allocate the closest match? If
127
 you plan on using background image or gradient fills it might be a good
128
 idea to enable this. If not you will otherwise get an error saying that
129
 the color palette is exhausted. The drawback of using approximations is
130
 that the colors might not be exactly what you specified. Note1: This
131
 does only apply to a palette image, not true color images since they
132
 don't have the limitations of maximum number of colors.</TD></TR>
133
<TR><TD valign="top">&quot;ERR_DEPRECATED&quot;,false</TD><TD>Should usage of
134
 deprecated functions and parameters give a fatal error? (Useful to
135
 check if code is future proof.)</TD></TR>
136
<TR><TD valign="top">&quot;BRAND_TIMING&quot;,false</TD><TD>Should the time taken
137
 to generate each picture be branded to the lower left in corner in each
138
 generated image? Useful for performance measurements generating graphs</TD>
139
</TR>
140
<TR><TD valign="top">&quot;BRAND_TIME_FORMAT&quot;,&quot;Generated in: %01.3fs&quot;</TD><TD>
141
What format should be used for the timing string?</TD></TR>
142
</TABLE>
143
<P> The following defines should very rarely need to be changed</P>
144
<P></P>
145
<TABLE cellpadding="3" cellspacing="0" class="codedefines">
146
<TR><TH>Define, default value</TH><TH>Comment</TH></TR>
147
<TR><TD valign="top">&quot;CACHE_FILE_GROUP&quot;,&quot;wwwadmin&quot;</TD><TD>What group
148
 should the cached file belong to (Set to &quot;&quot; will give the default group
149
 for the &quot;PHP-user&quot;) Please note that the Apache user must be a member
150
 of the specified group since otherwise it is impossible for Apache to
151
 set the specified group.</TD></TR>
152
<TR><TD valign="top">&quot;CACHE_FILE_MOD&quot;,0664</TD><TD>What permissions
153
 should the cached file have (Set to &quot;&quot; will give the default
154
 permissions for the &quot;PHP-user&quot;)</TD></TR>
155
<TR><TD valign="top">&quot;USE_BRESENHAM&quot;,false</TD><TD>Decide if we should
156
 use the Bresenham circle algorithm or the built in Arc(). Bresenham
157
 gives better visual appearance of circles but is more CPU intensive and
158
 slower then the built in Arc() function in GD. Turned off by default
159
 for speed</TD></TR>
160
<TR><TD valign="top">&quot;_CSIM_SPECIALFILE&quot;,&quot;_csim_special_&quot;</TD><TD>
161
Special file name to indicate that we only want to calc the image map in
162
 the call to Graph::Stroke() used internally from the GetHTMLCSIM()
163
 method.</TD></TR>
164
<TR><TD valign="top">&quot;_CSIM_DISPLAY&quot;,&quot;_jpg_csimd&quot;</TD><TD>HTTP GET
165
 argument that is used with image map to indicate to the script to just
166
 generate the image and not the full CSIM HTML page.</TD></TR>
167
</TABLE>
168
 &nbsp;
169
<P>&nbsp;</P>
170
<P>&amp;nbsp</P>
171
</DIV><HR NOSHADE>
172
<A HREF="toc.html">Contents</A>
173
<A HREF="1221AdjustingthesizeoftheLEDdigits.html">Previous</A>
174
</BODY>
175
</HTML>