Česky
Kamil Dudka

Web components

File detail

Name:Downloadconfig.php [Download]
Location: src
Size:2.7 KB
Last modification:2007-09-07 12:58

Source code

<?php
/**
 * @attention Do not forget update next line when chaging documentRoot or classDir!
 */
include_once($_SERVER['DOCUMENT_ROOT'].'/lib/base.php');
function initConfig() {
  $config = Config::instance();
 
  /**
   * Base path for all files accessed at @b server's @b side
   */
  $config->setDocumentRoot($_SERVER['DOCUMENT_ROOT']);
 
  /**
   * URL base for all files accessed from @b web @b browser
   */
  $config->setWebRoot('http://10.0.0.2');
 
  /**
   * Visible name of the web
   */
  $config->setWebName('Dudka.cz');
 
  /**
   * Webmaster's email address
   */
  $config->setWebmasterMail('webmaster@dudka.cz');
 
  /**
   * Relative path to class definition files
   */
  $config->setClassDir('/lib');
 
  /**
   * Relative path to Javascript files
   */
  $config->setScriptDir('/script');
 
  /**
   * Relative path to CSS files
   */
  $config->setStyleDir('/style');
 
  /**
   * Relative path to images
   * @note There should be only common usage images.
   * Page-specific images can be in filesDir or htmlDir.
   */
  $config->setImgDir('/img');
 
  /**
   * Relative path to XML and XSL templates
   * containing visible web data.
   */
  $config->setPageDir('/page');
 
  /**
   * Relative path to FileBrowser data root.
   */
  $config->setFilesDir('/files');
 
  /**
   * Relative path to directory used for
   * FileBrowser's action=directAccess
   */
  $config->setHtmlDir('/html');
 
  /**
   * Relative path to directory used for
   * FileBrowser's action=execPHP
   */
  $config->setExecPhpDir('/php');
 
  /**
   * Relative path to temp directory
   * @note Write privileges are required.
   */
  $config->setTmpDir('/tmp');
 
  /**
   * Relative path to long-term cache directory.
   * @note Write privileges are required.
   */
  $config->setCacheDir('/cache');
 
  /**
   * Relative path to GeSHi
   */
  $config->setGeshiDir('/geshi');
 
  /**
   * Absolute path to Smarty templates directory
   * @note This path is @b not @b relative due to historical reasons.
   */
  $config->smartyConf['template_dir'] = $config->documentRoot().'/templates';
 
  /**
   * Absolute path to Smarty
   * @note This path is @b not @b relative due to historical reasons.
   */
  $smartyDir = $config->documentRoot().'/smarty';
  $config->setSmartyDir($smartyDir);
 
  /**
   * Smarty configuration directory
   */
  $config->smartyConf['config_dir'] = $smartyDir.'/configs';
 
  /**
   * Directory for compiled Smarty's templates.
   * @note Write privileges are required
   */
  $config->smartyConf['compile_dir'] = $smartyDir.'/templates_c';
 
  /**
   * Directroy fro Smarty's cache
   * @note Write privileges are required
   */
  $config->smartyConf['cache_dir'] = $smartyDir.'/cache';
}
initConfig();
?>