From: Justin F. <je...@ey...> - 2001-07-07 18:32:03
|
Alex: Another "usuability issue" and/or I don't know where to do something in this BC environment. You have already pre-empted the name "BC_" prefix for define()'s, and you call these "user constants". Now, what if I want a page-scope/all module defined constant. What should I do? Where do I define() something that I wish all modules to see in global scope. Is this going to be possible in the *.xml file that will be ripped into the index.php? If so, will it be put up there at the top like: // ripped from /path/to/binarycloud/user/htdocs/index.xml $SITE_EMAIL="jo...@so..."; //for email all over $SITE_ROWS_BEFORE_PAGING=15; //for paging lists $SITE_TEL_NO="1-800-6969"; // for telno all over $SITE_WEBMASTER="wi...@so..."; or define(SITE_EMAIL,"jo...@so..."); and so forth. As an aside, I sort of think of these as "user constants", but I suppose they are "site constants" or "page constants". So, the question(s) are: 1. Where should I define them for global scope? 2. If you tell me some module that I will have to load, such as a SiteLibrary.php, then I guess I would have to go along with it, but this seems wrong-headded. Now I want to be able to put them in the *.xml and have them work as I described above, defining them in global scope for THAT PAGE with any set of modules called from and set of packages, and not have to worry that I didn't load, say, the SiteLibrary.php that would do it, with its potential omission. If I create a new page(s) for the site six months after it has been up, I might forget which bloody module globaled my constants. What if I want: define(BUTTONS,"../resources/images/buttons/"); define(SITE_GIZMOS,"resources/images/gizmos/"); Where? I suppose that now I am starting to get into the operation of the XML --> php file thingy. I will be happy when that is ready. And I would like to have defines()'s available in that XML --> php. -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 |
From: alex b. <en...@tu...> - 2001-07-07 22:36:55
|
> You have already pre-empted the name "BC_" prefix for > define()'s, and you call these "user constants". correct. these are constants that are used by the system, but always set by the user. > Now, what if I want a page-scope/all module defined constant. > What should I do? Where do I define() something that I wish > all modules to see in global scope. all constants are implicitly global. you can put a declare in conf.php, or you can declare a constant in your module. it's up to you. > Is this going to be possible in the *.xml file that will be > ripped into the index.php? If so, will it be put up there > at the top like: Yes. The .xml won't know anything about the set of constants, just that a certain xml structure should be ripped into a php define. so you can add whatever you like. > // ripped from /path/to/binarycloud/user/htdocs/index.xml > $SITE_EMAIL="jo...@so..."; //for email all over > $SITE_ROWS_BEFORE_PAGING=15; //for paging lists > $SITE_TEL_NO="1-800-6969"; // for telno all over > $SITE_WEBMASTER="wi...@so..."; > > or > > define(SITE_EMAIL,"jo...@so..."); It would be the latter, define. > and so forth. > > As an aside, I sort of think of these as "user constants", > but I suppose they are "site constants" or "page constants". They are also user constants. Agreed, the BC_ prefix ones are "special" and I may make an effort to make that a little more clear - but both 'sets' of constants come from the dev. > So, the question(s) are: > 1. Where should I define them for global scope? user/conf/conf.php (for the moment, soon the conf.xml) > 2. If you tell me some module that I will have to > load, such as a SiteLibrary.php, then I > guess I would have to go along with it, > but this seems wrong-headded. That would be stupid. So, yes, you are correct. > Now I want to be able to put them in the *.xml and > have them work as I described above, defining them > in global scope for THAT PAGE with any set of modules > called from and set of packages, and not have to worry > that I didn't load, say, the SiteLibrary.php that > would do it, with its potential omission. If I create > a new page(s) for the site six months after it has > been up, I might forget which bloody module globaled > my constants. This I don't understand - all 'constants' loaded by the system are system-wide (not page specific) and implicitly global. > What if I want: > > define(BUTTONS,"../resources/images/buttons/"); > define(SITE_GIZMOS,"resources/images/gizmos/"); > > Where? conf.php. > I suppose that now I am starting to get into the > operation of the XML --> php file thingy. I will > be happy when that is ready. > > And I would like to have defines()'s available in > that XML --> php. You will _only_ have defines available there. _a |
From: Jimmy H. <ji...@ha...> - 2001-07-08 00:51:25
|
Hi > > So, the question(s) are: > > 1. Where should I define them for global scope? > > user/conf/conf.php (for the moment, soon the conf.xml) Why would you want to use xml configuration file instead of php? Wouldn't you think php parser works faster (even without with the help of php cache / zend cache) than xml parser? Please enlighten me on the reason. Thanks |
From: alex b. <en...@tu...> - 2001-07-08 01:23:57
|
because we run those xml files thourgh an xml->php makefile that (you guessed it) turns xml into php with various filters. that allows us to use xml because it is convenient and clean, while avoiding the performance problems associated with parsing xml at runtime. _a ----- Original Message ----- From: "Jimmy Harlindong" <ji...@ha...> To: <bin...@li...> Sent: Saturday, July 07, 2001 5:52 PM Subject: RE: [binarycloud-dev] So-called user constants > Hi > > > > > So, the question(s) are: > > > 1. Where should I define them for global scope? > > > > user/conf/conf.php (for the moment, soon the conf.xml) > > > Why would you want to use xml configuration file instead of php? > Wouldn't you think php parser works faster (even without with the help > of php cache / zend cache) than xml parser? > > Please enlighten me on the reason. > > Thanks > > > > _______________________________________________ > binarycloud-dev mailing list > bin...@li... > http://lists.sourceforge.net/lists/listinfo/binarycloud-dev > |
From: alex b. <en...@tu...> - 2001-07-08 01:24:21
|
I should qualify this and way we _will_ run the xml through xml2php, we don't right now. _a ----- Original Message ----- From: "Jimmy Harlindong" <ji...@ha...> To: <bin...@li...> Sent: Saturday, July 07, 2001 5:52 PM Subject: RE: [binarycloud-dev] So-called user constants > Hi > > > > > So, the question(s) are: > > > 1. Where should I define them for global scope? > > > > user/conf/conf.php (for the moment, soon the conf.xml) > > > Why would you want to use xml configuration file instead of php? > Wouldn't you think php parser works faster (even without with the help > of php cache / zend cache) than xml parser? > > Please enlighten me on the reason. > > Thanks > > > > _______________________________________________ > binarycloud-dev mailing list > bin...@li... > http://lists.sourceforge.net/lists/listinfo/binarycloud-dev > |