Typo3 Sample Files

This article has been archived for one of the following reasons:

  • It contains information that no longer applies, that is inaccurate, or that is duplicated in a current article.
  • It contains inaccurate or incomplete information and is being rewritten. We are working on new content and will replace this article when it’s ready.
  • Published on August 07, 2009 by stjacobs
  • Updated on February 08, 2012 by stjacobs

This is a set of sample files for the typo3 application. These files could be used for designing an application package for typo3 designed for the Web Application Gallery. The samples are annotated with comments throughout that explan specific issues encountered with the typo3 application, as well as general commentary on the files themselves.

Typo3 offers a rich set of features that can be customized at installation time using the "Install Tool". These samples make the beginnings of an attempt to supplement that configuration with information gathered from the user during the install. This information would get stored in a file called "localconf.php". The samples below include a copy of a sample.localconf.php file that I created to illustrate how some of the parameter substitutions could be performed with that file.

A sample web.config file is included at the end. We recommend that all PHP applications have this base web.config file at the root of their applications.


Sample manifest.xml file


<!-- TODO - Annotate properly -->
<msdeploy.iisapp>
  <!-- iisapp path identifies the subdirectory in the ZIP file which
  contains all of the application files -->
  <iisapp path="typo3" />

  <!-- dbmysql path identifies the SQL script file that will be executed
  for database setup.  In this app's case, the script is being used
  to create the database user for the application -->
  <dbmysql path="install.sql" commandDelimiter="//" removeCommandDelimiter="true" />
  
  <!-- alias is used to make a copy of a distribution file to a location
  where it will be used.  Note that when you specify the Application
  name in the "to" attribute, you should specify the full path using
  the value of iisapp above for the root.  Alias doesn't actually
  copy the file within the package.  It creates an alias to the
  original file using the new file's path and name.  This alias then
  gets copied to the file system as if it were a real file within
  the package -->
  <alias from="sample.localconf.php" to="typo3/typo3conf/localconf.php" />
  <alias from="web.config" to="typo3/web.config" />

  <!-- setACL with no setAclResourceType set will default to setting an ACL
  on a directory.  We are setting an ACL here for the files directory.
  This directory is used to store files that are uploaded for the
  application -->
  <setAcl path="typo3/typo3conf" setAclAccess="Modify" setAclUser="anonymousAuthenticationUser" />
  <setAcl path="typo3/typo3temp" setAclAccess="Modify" setAclUser="anonymousAuthenticationUser" />
  <setAcl path="typo3/typo3/ext" setAclAccess="Modify" setAclUser="anonymousAuthenticationUser" />
  <setAcl path="typo3/uploads" setAclAccess="Modify" setAclUser="anonymousAuthenticationUser" />
  <setAcl path="typo3/fileadmin" setAclAccess="Modify" setAclUser="anonymousAuthenticationUser" />
  <setAcl path="typo3/typo3conf/localconf.php" setAclResourceType="File" setAclAccess="Modify" setAclUser="anonymousAuthenticationUser" />
</msdeploy.iisapp>


Sample parameters.xml file


<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\typo3 )." 
    defaultValue="typo3" 
    tags="iisapp">
    <parameterEntry 
      type="ProviderPath" 
      scope="iisapp" 
      match="typo3" 
      />
  </parameter>

  <parameter
    name="SetAclParameter1" 
    defaultValue="{Application Path}/typo3conf" 
    tags="Hidden"
    >
    <parameterEntry 
      type="ProviderPath" 
      scope="setAcl" 
      match="typo3/typo3conf" 
      />
  </parameter>

  <parameter
    name="SetAclParameter2" 
    defaultValue="{Application Path}/typo3temp" 
    tags="Hidden"
    >
    <parameterEntry 
      type="ProviderPath" 
      scope="setAcl" 
      match="typo3/typo3temp" 
      />
  </parameter>

  <parameter
    name="SetAclParameter3" 
    defaultValue="{Application Path}/typo3/ext" 
    tags="Hidden"
    >
    <parameterEntry 
      type="ProviderPath" 
      scope="setAcl" 
      match="typo3/typo3/ext" 
      />
  </parameter>

  <parameter
    name="SetAclParameter4" 
    defaultValue="{Application Path}/uploads" 
    tags="Hidden">
    <parameterEntry 
      type="ProviderPath" 
      scope="setAcl" 
      match="typo3/uploads" 
      />
  </parameter>

  <parameter
    name="SetAclParameter5"
    defaultValue="{Application Path}/fileadmin" 
    tags="Hidden">
    <parameterEntry 
      type="ProviderPath" 
      scope="setAcl" 
      match="typo3/fileadmin" 
      />
  </parameter>

  <parameter
    name="SetAclParameter6"
    defaultValue="{Application Path}/typo3conf/localconf.php" 
    tags="Hidden">
    <parameterEntry 
      type="ProviderPath" 
      scope="setAcl" 
      match="typo3/typo3conf/localconf.php" 
      />
  </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. -->

  <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="typo3\\typo3conf\\localconf.php" 
      match="PlaceholderForDbHostName" 
      />
  </parameter>
  <!-- This parameter prompts the user for the database name. -->

  <parameter
    name="Database Name"
    description="Name of the database for your application." 
    defaultValue="sugarcrm" 
    tags="MySQL, dbName">
    <parameterEntry 
      type="TextFile" 
      scope="install.sql" 
      match="PlaceHolderForDbName" 
      />
    <parameterEntry 
      type="TextFile" 
      scope="typo3\\typo3conf\\localconf.php" 
      match="PlaceholderForDbName" 
      />
  </parameter>
  <!-- This parameter prompts the user for the database username. -->

  <parameter
    name="Database Username"
    description="Username to access your application database." 
    defaultValue="sugaruser" 
    tags="MySQL, DbUsername">
    <parameterEntry 
      type="TextFile" 
      scope="install.sql" 
      match="PlaceHolderForUser" 
      />
    <parameterEntry 
      type="TextFile" 
      scope="typo3\\typo3conf\\localconf.php" 
      match="PlaceholderForDbUser" 
      />
  </parameter>
  <!-- This parameter prompts the user for the database user's password. -->

  <parameter
    name="Database Password" 
    description="Password that is associated with the Database Username." 
    tags="New, Password, MySQL, DbUserPassword">
    <parameterEntry 
      type="TextFile" 
      scope="install.sql" 
      match="PlaceHolderForPassword" 
      />
    <parameterEntry 
      type="TextFile" 
      scope="typo3\\typo3conf\\localconf.php" 
      match="PlaceholderForDbPassword" 
      />
  </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">
    <parameterEntry 
      type="ProviderPath" 
      scope="dbmysql" 
      match="install.sql" 
      />
  </parameter>

  <!-- Typo3 configuration parameters -->

  <parameter
    name="Site Name"
    description="Please provide a name for your site"
    defaultValue="TYPO3"
    >
    <parameterEntry
      type="TextFile"
      scope="typo3\\typo3conf\\localconf.php" 
      match="PlaceholderForSiteName" 
      />
  </parameter>

  <parameter
    name="Encryption Key"
    description="Please provide a random series of characters to be used as an Encryption Key Salt"
    defaultValue="TYPO3"
    >
    <parameterEntry
      type="TextFile"
      scope="typo3\\typo3conf\\localconf.php" 
      match="PlaceholderForEncryptionKey" 
      />
  </parameter>


</parameters>


sample.localconfig.php file


<?php
$TYPO3_CONF_VARS['SYS']['sitename'] = 'PlaceholderForSiteName';

  // Default password is "joh316" :
$TYPO3_CONF_VARS['BE']['installToolPassword'] = 'bacb98acf97e0b6112b1d1b650b84971';

$TYPO3_CONF_VARS['EXT']['extList'] = 'tsconfig_help,context_help,extra_page_cm_options,impexp,sys_note,tstemplate,tstemplate_ceditor,tstemplate_info,tstemplate_objbrowser,tstemplate_analyzer,func_wizards,wizard_crpages,wizard_sortpages,lowlevel,install,belog,beuser,aboutmodules,setup,taskcenter,info_pagetsconfig,viewpage,rtehtmlarea,css_styled_content,t3skin';

$typo_db_extTableDef_script = 'extTables.php';

## INSTALL SCRIPT EDIT POINT TOKEN - all lines after this points may be changed by the install script!

$typo_db_username = 'PlaceholderForDbUser'; //  Modified or inserted by TYPO3 Install Tool.
$typo_db_password = 'PlaceHolderForPassword'; //  Modified or inserted by TYPO3 Install Tool.
$typo_db_host = 'PlaceholderForDbHostName'; //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['encryptionKey'] = 'PlaceholderForEncryptionKey'; //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['compat_version'] = '4.2';  //  Modified or inserted by TYPO3 Install Tool.
$typo_db = 'PlaceholderForDbName';  //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['GFX']['gdlib_2'] = '1'; //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['GFX']['im'] = '0';  //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['FE']['disableNoCacheParameter'] = '0';  //  Modified or inserted by TYPO3 Install Tool.
// Updated by TYPO3 Install Tool 31-07-09 16:58:47
?>

Sample web.config file


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <defaultDocument>
      <files>
        <remove value="index.php" />
        <add value="index.php" />
      </files>
    </defaultDocument>
  </system.webServer>
</configuration>

Submit article feedback

You must Log In to submit feedback.