|
From: Alex B. <en...@tu...> - 2001-08-17 19:06:53
|
Fantastic!!!!!! :) > Hello Alex, > I didn't send this message to the dev list because it includes files. _If > you want, u can later forward it to the list._ > > I have managed make xml2php a bit functional. In fact, I had to add a > function which converts XML array to PHP array definition string, I mean, > the library was (and is) far from being complete. Got it. > I have included some > auto-generated example files. Please note that datasources.xml didn't work > until I removed that strange mcrypt key from it. I'm actually comfortable changing that to an import path, so we can store keys in files. That would probably be better anyway. I'd still like to store them in some kind of php structure, so we can run them through zend encoder as part of make. > Also, since the xml2php > needs to use import stuff & friends, I modified makefiles to compile user > directory after all other dircetories. Furthermore, I modified makefile to > pass SITEBUILD_DIR variable to xml2php so it knows where to find > prepend.php. Got it. > _problem #1_ > As it currently seems, I'll have to make a seperate function for each type > of XML file, for example, makefile should run > xml2php c:\bc\ c:\bc\some_where\page_def.xml.php > c:\bc\some_other_where\page_def.xml.php PAGE_DEF or > xml2php c:\bc\ c:\bc\some_where\conf_def.xml.php > c:\bc\some_other_where\conf_def.xml.php CONF_DEF > because of the very different structures of generated page_def.php (aka bcp) > and conf.php files. I was afraid of this, but to be honest I don't see a way around it. We _can_ have a 'normal' style of declaring arrays that will work for many .php.xml files, but there are some (like conf.xml) that I can't see working without a special function. maybe we should store those functions as classes in binarycloud/base/utils/doctypes/. I'll look up at the code and come up with a proposal. > _problem #2_ > Right now I don't know how to use makefile variables quite well. The idea is > that it should find xml2.php files, rename them to .php files and pass to > xml2php.php one at a time. I have tried (but not succeeded) to have makefile > to rename the files. I'm currently using something like the following (its a > piece of code from $BCHOME/user/makefile) and renaming the files with the > use of PHP which is not quite what I want. > > XMLDIRS= \ > something \ > $(EMPTY) > > XMLFILES=`find $(XMLDIRS) -name '*.php.xml' | grep '[.]'` > > all: xml > > xml: > @for xmlfile in $(XMLFILES); do \ > $(XML2PHP) $(SITEBUILD_DIR) $(USER_DIR)/$$xmlfile > $(USERBUILD_DIR)/$$xmlfile; \ > done You can run mv on the files after you write them into the build directory... I'll play around with something to get it working. great work! _alex |