PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Images » Image_Graph » Bug #4451

Unable to define IMAGE_GRAPH_SYSTEM_FONT_PATH outside of Config.php

Details

Request #4451Unable to define IMAGE_GRAPH_SYSTEM_FONT_PATH outside of Config.php
Submitted2005-05-27 12:51 UTC
Fromandrew at m3 dot net
Assignednosey
StatusClosed
PackageImage_Graph
PHP Version4.3.10
OSFedora Core 3
Roadmaps(Not assigned)

Comments

[2005-05-27 12:51 UTC] andrew at m3 dot net

Description:
------------
It would be nice to be able to define the IMAGE_GRAPH_SYSTEM_FONT_PATH value outside of the package's Config.php file.

We develop a product that uses Image_Graph, and we distribute the required PEAR packages with the product. However, we want to be able to upgrade the packages using pear, so we don't want to make changes to the files in the package, otherwise we have to check the changes are applied each time we update the package.

Being able to define the IMAGE_GRAPH_SYSTEM_FONT_PATH value outside of the package would allow us to do this.

(The process is very similar to the way the DATE_CALC_BEGIN_WEEKDAY value for the PEAR Date package can be defined outside of the package files.)

Reproduce code:
---------------
Change:

if (isset($_SERVER['SystemRoot'])) {
define('IMAGE_GRAPH_SYSTEM_FONT_PATH', $_SERVER['SystemRoot'] . '/Fonts/');
} else {
define('IMAGE_GRAPH_SYSTEM_FONT_PATH', '');
}

to:

if (!defined('IMAGE_GRAPH_SYSTEM_FONT_PATH')) {
if (isset($_SERVER['SystemRoot'])) {
define('IMAGE_GRAPH_SYSTEM_FONT_PATH', $_SERVER['SystemRoot'] . '/Fonts/');
} else {
define('IMAGE_GRAPH_SYSTEM_FONT_PATH', '');
}
}

[2005-05-27 19:05 UTC] pear dot nosey at veggerby dot dk

That is indeed a good idea, and I will most definitely (and have already) add this.

I have added it in CVS.

/Jesper