Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
/*
4
 * This file is part of the symfony package.
5
 * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
 
11
require_once 'propel/engine/database/model/Behavior.php';
12
 
13
/**
14
 * Base behavior class.
15
 *
16
 * @package     sfPropelPlugin
17
 * @subpackage  behavior
18
 * @author      Kris Wallsmith <kris.wallsmith@symfony-project.com>
19
 * @version     SVN: $Id: SfPropelBehaviorBase.php 23310 2009-10-24 15:27:41Z Kris.Wallsmith $
20
 */
21
abstract class SfPropelBehaviorBase extends Behavior
22
{
23
  protected
24
    $buildProperties = null;
25
 
26
  /**
27
   * Returns a build property from propel.ini.
28
   *
29
   * @param string $name
30
   *
31
   * @return mixed
32
   */
33
  protected function getBuildProperty($name)
34
  {
35
    if (null === $this->buildProperties)
36
    {
37
      $this->buildProperties = new Properties();
38
      $this->buildProperties->load(new PhingFile(sfConfig::get('sf_config_dir').'/propel.ini'));
39
    }
40
 
41
    return $this->buildProperties->getProperty($name);
42
  }
43
 
44
  /**
45
   * Returns true if the current behavior has been disabled.
46
   *
47
   * @return boolean
48
   */
49
  protected function isDisabled()
50
  {
51
    return 'true' == $this->getParameter('disabled');
52
  }
53
}