Development

/branches/1.3/lib/plugins/sfPropelPlugin/lib/builder/SfExtensionPeerBuilder.php

You must first sign up to be able to contribute.

root/branches/1.3/lib/plugins/sfPropelPlugin/lib/builder/SfExtensionPeerBuilder.php

Revision 23357, 1.4 kB (checked in by Kris.Wallsmith, 5 years ago)

[1.3] tagged custom propel builders as deprecated

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 require_once 'propel/engine/builder/om/php5/PHP5ExtensionPeerBuilder.php';
4
5 /*
6  * This file is part of the symfony package.
7  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
8  *
9  * For the full copyright and license information, please view the LICENSE
10  * file that was distributed with this source code.
11  */
12
13 /**
14  * @package    symfony
15  * @subpackage propel
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  *
19  * @deprecated since symfony 1.3
20  */
21 class SfExtensionPeerBuilder extends PHP5ExtensionPeerBuilder
22 {
23   public function build()
24   {
25     $code = parent::build();
26     if (!$this->getBuildProperty('builderAddComments'))
27     {
28       $code = sfToolkit::stripComments($code);
29     }
30
31     return $code;
32   }
33
34   /**
35    * Adds class phpdoc comment and openning of class.
36    *
37    * @param string &$script The script will be modified in this method
38    */
39   protected function addClassOpen(&$script)
40   {
41     parent::addClassOpen($script);
42
43     // remove comments and fix coding standards
44     $script = str_replace(array(" {\n", "\n\n\n"), array("\n{", "\n"), sfToolkit::stripComments($script));
45   }
46
47   /**
48    * Closes class.
49    *
50    * @param string &$script The script will be modified in this method
51    */
52   protected function addClassClose(&$script)
53   {
54     parent::addClassClose($script);
55
56     // fix coding standards
57     $script = preg_replace('#} // .+$#m', '}', $script);
58   }
59 }
60
Note: See TracBrowser for help on using the browser.