Simple Machines Forums (SMF) Parameters.xml sample

  • Published on August 28, 2009 by stjacobs
  • Updated on August 28, 2009 by stjacobs

<parameters>

  <!-- Prompts where to copy the content files and takes a web site
  path (such as "contoso.com/app").
  -->

  <parameter name="Application Path"
    description="Full site path you would like to install your application to(i.e. Default Web Site/smf-pkg)."
    defaultValue="Default Web Site/smf"
    tags="iisapp"
    >
    <parameterEntry
      type="ProviderPath"
      scope="iisapp"
      match="smf-pkg"
      />
  </parameter>
  <!-- #SMF - for most applications, we use the Application Path as a
  variable to be used in constructing other parameters, as in the
  setACL parameters below.  However, we can also use the Path as
  the tail end of the URL for setting the "boardurl" variable in
  the SMF Settings.php file.
  -->
  <parameter name="Board URL"
    defaultValue="' . basename('{Application Path}')"
    tags="hidden"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\Settings.php"
      match="(?&lt;=boardurl\s=\s&#039;http://127.0.0.1/)smf'"
      />
  </parameter>

  <!-- This is the parameter that is used to set the ACL for the
  configuration file.  Note that the {Application Path} in the
  defaultValue below gets expanded to the Application Path
  entered by the user.  The name of this variable (in the {}s)
  matches the parameter name above.  The user is never prompted
  for this - the Web Deployment Tool has all it needs to generate
  this. 
  -->

  <!-- #SMF - The list of paths and files to apply ACLs to came from
  the SMF setup program.  These were all the items that were
  identified as needing to be written to by SMF.
  -->

  <parameter
    name="SetAclParameter1"
    defaultValue="{Application Path}/attachments"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/attachments"
      />
  </parameter>

  <parameter
    name="SetAclParameter2"
    defaultValue="{Application Path}/avatars"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/avatars"
      />
  </parameter>

  <parameter
    name="SetAclParameter3"
    defaultValue="{Application Path}/Packages"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/Packages"
      />
  </parameter>

  <parameter
    name="SetAclParameter4"
    defaultValue="{Application Path}/Packages/installed.list"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/Packages/installed.list"
      />
  </parameter>

  <parameter
    name="SetAclParameter5"
    defaultValue="{Application Path}/Smileys"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/Smileys"
      />
  </parameter>

  <parameter
    name="SetAclParameter6"
    defaultValue="{Application Path}/Themes"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/Themes"
      />
  </parameter>

  <parameter
    name="SetAclParameter7"
    defaultValue="{Application Path}/agreement.txt"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/agreement.txt"
      />
  </parameter>

  <parameter
    name="SetAclParameter8"
    defaultValue="{Application Path}/Settings.php"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/Settings.php"
      />
  </parameter>

  <parameter
    name="SetAclParameter9"
    defaultValue="{Application Path}/Settings_bak.php"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/Settings_bak.php"
      />
  </parameter>

  <parameter
    name="SetAclParameterA"
    defaultValue="{Application Path}/install.php"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/install.php"
      />
  </parameter>

  <parameter
    name="SetAclParameterB"
    defaultValue="{Application Path}/silent-install.php"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/silent-install.php"
      />
  </parameter>

  <parameter
    name="SetAclParameterC"
    defaultValue="{Application Path}/webinstall.php"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/webinstall.php"
      />
  </parameter>

  <parameter
    name="SetAclParameterD"
    defaultValue="{Application Path}/install_1-1.sql"
    tags="Hidden"
    >
    <parameterEntry
      type="ProviderPath"
      scope="setAcl"
      match="smf-pkg/install_1-1.sql"
      />
  </parameter>


  <!-- Database Parameters
  The tags provided here tells the UI being used what type of
  parameter this is.  The UI can then construct an appropriate
  dialog for the database parameters, or fill them in if the user
  doesn't need to provide them
  -->

  <!-- This parameter prompts the user for the database server name. 
  Note that this parameter has only one parameterEntry element.
  This parameter is used with the configuration file and the
  connection string.  It is not used within the SQL script itself
  like the other paramters are. 
  -->

  <!-- #SMF For the database parameters, we are also updating the
  Settings.php file.  There were some moderately complex Regular
  Expressions required to make sure we got the right variables.
  When we create the settings files for other applications, we
  frequently use easily identifiable contents for the variables
  that we want to parameterize.  i.e. PlaceholderForDbServer for
  the Database Server value.  There are cases where we cannot add
  an additional configuration file or modify a currently shipping
  one.  For those, we use complex RegExes like these.
  -->

  <parameter
    name="Database Server"
    description="Location of your database server (i.e., localhost, server name or IP address)"
    defaultValue="localhost"
    tags="MySQL, dbServer"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\Settings.php"
      match="(?&lt;=_server\s=\s&#039;)localhost"
      />
  </parameter>

  <!-- This parameter prompts the user for the database name. 
  -->
  <parameter
    name="Database Name"
    description="Name of the database for your application."
    defaultValue="smf"
    tags="MySQL, dbName"
    >
    <parameterEntry
      type="TextFile"
      scope="install.sql"
      match="PlaceholderForDbName"
      />
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\Settings.php"
      match="(?&lt;=_name\s=\s&#039;)smf"
      />
  </parameter>

  <!-- This parameter prompts the user for the database username. 
  -->
  <parameter
    name="Database Username"
    description="User name to access your application database."
    defaultValue="smfuser"
    tags="MySQL, DbUsername"
    >
    <parameterEntry
      type="TextFile"
      scope="install.sql"
      match="PlaceholderForDbUser"
      />
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\Settings.php"
      match="(?&lt;=_user\s=\s&#039;)root"
      />
  </parameter>

  <!-- This parameter prompts the user for the database user's password. 
  -->
  <parameter
    name="Database Password"
    description="Password for the database username."
    tags="New, Password, MySQL, DbUserPassword"
    >
    <parameterEntry
      type="TextFile"
      scope="install.sql"
      match="PlaceholderForDbPassword"
      />
  </parameter>

  <!--  #SMF For the Database password parameter, we can't use a
  lookbehind RegEx as the section of text we are looking to
  replace has zero length.  To avoid the use of TextFilePosition
  we use a compound parameter which replaces the entire targeted
  line.  The second parameter builds its default value from the
  text that shouldn't be replaced and a substitution of the
  DbName value to be inserted between the quotes. 
  -->

  <parameter
    name="SMFDbPasswordSubstitution"
    defaultValue="$db_passwd = '{Database Password}';"
    tags="hidden,MySQL"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\Settings.php"
      match="\$db_passwd = &#039;&#039;;"
      />
  </parameter>


  <!-- Prompts for the admin creds and uses it for the administrator
  connection string. This is used to create a login and assign
  permissions. The MySQL tag indicates it is a parameter required
  for MySQL. 

  The DbAdminUsername tag indicates it should be used
  when the user is creating a new database. If they're not, it
  can be filled in with the DbUsername value.  The UI should be
  able to figure out whether or not the user needs to be prompted
  for this. 
  -->

  <parameter
    name="Database Administrator"
    description="Administrator user name for your database."
    defaultValue="root"
    tags="MySQL, DbAdminUsername"
    >
  </parameter>

  <!-- Prompts for the admin password and uses it for the administrator
  connection string.
  -->

  <parameter
    name="Database Administrator Password"
    description="Password for the database administrator account."
    tags="Password, MySQL, DbAdminPassword"
    >
  </parameter>

  <!-- This is the hidden admin connection string used to run the
  database scripts.  Note that this connection string is just
  used here, and will probably be different from the connection
  string that is used by the application itself. 
  -->

  <parameter
    name="Connection String"
    description="Automatically sets the connection string for the connection request."
    defaultValue="Server={Database Server};Database={Database Name};uid={Database Administrator};Pwd={Database Administrator Password};"
    tags="Hidden,MySQL,MySQLConnectionString,Validate"
    >
    <parameterEntry
      type="ProviderPath"
      scope="dbmysql"
      match="install.sql"
      />
  </parameter>

  <!--  #SMF - SMF specific parameters for setting up the environment
  -->

  <parameter
    name="Database Table Prefix"
    description="The prefix for every table in the database"
    defaultValue="smf_"
    tags="MySQL"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\Settings.php"
      match="(?&lt;=_prefix\s=\s&#039;)smf_"
      />
  </parameter>

  <parameter
    name="Forum Name"
    description="This is the name of your forume."
    defaultValue="My Community"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\Settings.php"
      match="(?&lt;=mbname\s=\s&#039;)My Community"
      />
  </parameter>


  <!-- #SMF - install.php hack.  When SMF loads the Settings.php file,
  the script checks for the existence of the install.php file.  If
  the install.php file exists, it redirects to that file.  This
  forces the board into installation mode only when the
  install.php file is there.  After running through the install,
  the instal script has the ability to delete itself, returning
  the board to normal operations.  Since we're covering the main
  things from the install within this parameters.xml file, we
  don't need to go through the install.php file.  So, we are
  going to modify the check in the Settings.php file to redirect
  to a silent-install.php file if it finds it, rather than redirecting to
  install.php.

  NOTE:  This is an incomplete hack.  Install.php performs
  database and other setup functions that are required for SMF to function
  fully.  We have scaled down a version of install.php which is in the root of
  the archive and called "silent-install.php".  While it is likely that the
  scaled down version is missing some important features (especially for
  localization), it does leave you with a working site, with all of the
  installation info gathered from the user by the Web Deployment Tool or the
  Web PI.

  This scaled down version of silent-install.php is offered as an example of
  potential techniques.  It is not complete code, and should not be included in
  any distribution of SMF or any other application.
  -->

  <parameter
    name="use silent-install.php"
    defaultValue="silent-install.php"
    tags="Hidden"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\Settings.php"
      match="install.php"
      />
  </parameter>


  <parameter
    name="Compress Output"
    description="Should SMF compress the output to save on bandwidth?  (0=No, 1=Yes)"
    defaultValue="0"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\silent-install.php"
      match="PlaceholderForEnableCompressedOutput"
      />
  </parameter>

  <parameter
    name="Enable Database Sessions"
    description="Should SMF store Session information in the database, or on the file
    system?  (0=Filesystem, 1=Database)"
    defaultValue="1"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\silent-install.php"
      match="PlaceholderForEnableDatabaseSessions"
      />
  </parameter>

  <parameter
    name="Administrative User Name"
    description="Please specify a user name to be the Board Administrator."
    defaultValue="admin"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\silent-install.php"
      match="PlaceholderForUsername"
      />
  </parameter>

  <parameter
    name="Administrative User Password"
    description="Please set a password for the Board Administrator."
    defaultValue="admin"
    tags="Password,New"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\silent-install.php"
      match="PlaceholderForPassword"
      />
  </parameter>

  <parameter
    name="Administrative User E-mail"
    description="Please provide an e-mail address for the Board Administrator"
    >
    <parameterEntry
      type="TextFile"
      scope="smf-pkg\\silent-install.php"
      match="PlaceholderForWebmasterEmail"
      />
  </parameter>

</parameters> 

Submit article feedback

You must Log In to submit feedback.