root/trunk/config/ProjectConfiguration.class.php

Revision 75, 1.2 kB (checked in by nperriault, 2 years ago)

[1.1]:

  • Companies and people modules migrated, with according form classes and templates, and functional test suite
  • Enhanced SymfoniansTestBrowser?
Line 
1 <?php
2 require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
3 sfCoreAutoload::register();
4
5 class ProjectConfiguration extends sfProjectConfiguration
6 {
7   public function setup()
8   {
9     // Base forms configuration
10     sfWidgetFormSchema::setDefaultFormFormatterName('div');
11     sfValidatorBase::setRequiredMessage('This field is required.');
12     sfValidatorBase::setInvalidMessage('The value provided is invalid.');
13
14     // symfonians constants definition
15     if (!defined('SYMFONIANS_MAIN_DOMAIN'))
16     {
17       $main_host = 'symfonians.dev'; // only used for CLI mode
18       if (array_key_exists('HTTP_HOST', $_SERVER))
19       {
20         $host_parts = explode('.', $_SERVER['HTTP_HOST']);
21         $main_host = implode('.', array($host_parts[count($host_parts) -2],
22                                         $host_parts[count($host_parts) -1]));
23       }
24       define('SYMFONIANS_MAIN_DOMAIN', $main_host);
25     }
26   }
27
28   public function getWebDir()
29   {
30     return sfConfig::get('sf_web_dir');
31   }
32
33   public function getUploadDir()
34   {
35     return sfConfig::get('sf_upload_dir');
36   }
37
38   public function getUploadDirName()
39   {
40     $t = explode('/', sfConfig::get('sf_upload_dir'));
41     return (count($t) > 0) ? array_pop($t) : null;
42   }
43 }
44
Note: See TracBrowser for help on using the browser.