On 20.10.2010 16:25, Josh Fisher wrote: > > On 10/19/2010 8:28 AM, Yuri Timofeev wrote: >> Hi >> >> During development the prototype of the my new system (Webacula 5.5), >> I tried to parse the bacula-dir.conf. >> However, this is probably not possible with simple regexp's. >> It turned out that some applications, for example, Webmin does this >> with a regexp > > I don't think regexp will work. The best way is to translate the C code > from the Bacula source into PHP. Since you are requiring PHP 5.0 or > above, I think, then the values could be placed in a class object, just > as Bacula puts them in C struct. Or, since all directives are key=value > pairs, you could just put them in an associative array. > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Bacula-users mailing list > Bacula-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bacula-users
a better solution still would be to enable bacula to dump its configuration as a (e.g.) XML or JSON file, probably in a rather generic way so that future changes to the structure/content of the config files would not need additional work on behalf of the bacula developers. XML or JSON - as examples - could be easily picked up by php, ruby, perl, python, java you name it whatever..... -- this is an empty signature :-) ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users