Changeset 1314
- Timestamp:
- 02/07/07 12:35:30 (2 years ago)
- Files:
-
- feedmelinks/_config/parse-config.xsl (modified) (2 diffs)
- feedmelinks/bin/.cvsignore (modified) (1 diff)
- feedmelinks/bin/configure.sh (modified) (1 diff)
- feedmelinks/lib/FeedMeLinks (added)
- feedmelinks/lib/FeedMeLinks.pm (added)
- feedmelinks/lib/FeedMeLinks/.cvsignore (added)
- feedmelinks/lib/FeedMeLinks/Environment-template.pm (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks/_config/parse-config.xsl
r927 r1314 1 1 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 2 2 <!-- 3 Reads in a servers.xml config file and spits out application server configs 4 in formats that all the different rube-goldberg-esque spinning gears need: 5 perl, 6 sh, 7 php, 8 etc. 9 --> 3 10 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 4 11 <xsl:output method="text" /> … … 8 15 <xsl:choose> 9 16 <xsl:when test="$mode = 'php'"><% 10 function get_env() {11 return "<xsl:value-of select="$server-name" />";12 }17 function get_env() { 18 return "<xsl:value-of select="$server-name" />"; 19 } 13 20 <xsl:for-each select="/servers/server[@name=$server-name]/@*"> 14 function get_<xsl:value-of select="translate(name(.), '-', '_')" />() {15 return "<xsl:value-of select="." />";16 }21 function get_<xsl:value-of select="translate(name(.), '-', '_')" />() { 22 return "<xsl:value-of select="." />"; 23 } 17 24 </xsl:for-each> 18 25 <xsl:call-template name="CRLF" /> 19 26 %></xsl:when> 27 28 <xsl:when test="$mode = 'sh'"> 29 # This file is autogenerated by _config/parse-config.xsl 30 # DO NOT EDIT! or your changes will be blown away the next time someone runs bin/configure.sh 31 32 function get_env () { 33 echo "<xsl:value-of select="$server-name" />" 34 } 35 <xsl:for-each select="/servers/server[@name=$server-name]/@*"> 36 function get_<xsl:value-of select="translate(name(.), '-', '_')" /> () { 37 echo "<xsl:value-of select="." />"; 38 } 39 </xsl:for-each> 40 </xsl:when> 41 42 <xsl:when test="$mode = 'perl'"> 43 sub get_env { 44 return "<xsl:value-of select="$server-name" />" 45 } 46 <xsl:for-each select="/servers/server[@name=$server-name]/@*"> 47 sub get_<xsl:value-of select="translate(name(.), '-', '_')" /> { 48 return "<xsl:value-of select="." />"; 49 } 50 </xsl:for-each> 51 1; # modules must return a true value 52 </xsl:when> 20 53 21 54 <xsl:when test="$mode = 'htaccess'"> feedmelinks/bin/.cvsignore
r751 r1314 1 1 test-mail.txt 2 env.sh feedmelinks/bin/configure.sh
r1032 r1314 42 42 echo $domain > $root/_config/domain.txt 43 43 44 echo 3. Saving your configurations in env.inc.php44 echo "3. Saving your configurations in env.inc.php (for site application to read)" 45 45 xsltproc --$sp server-name $s --$sp mode php $xsl $xml > $root/modules/env.inc.php 46 46 47 echo 4. FIXME: need to ALSO save these to a perl and/or sh-readable format for the maintenance scripts to read 48 echo 5. FIXME: need to ALSO build the crontab with the right paths 47 echo "4. ...and in shell-script format (for maintenance scripts to read)..." 48 xsltproc --$sp server-name $s --$sp mode sh $xsl $xml > $root/bin/env.sh 49 50 echo "5. ...and as a perl modules format (for other maintenance scripts to read)..." 51 cp $root/lib/FeedMeLinks/Environment-template.pm $root/lib/FeedMeLinks/Environment.pm 52 xsltproc --$sp server-name $s --$sp mode perl $xsl $xml >> $root/lib/FeedMeLinks/Environment.pm 53 54 echo 6. FIXME: need to ALSO build a crontab file with the correct paths 49 55 50 56 exit 0