Changeset 4340

Show
Ignore:
Timestamp:
05/07/08 01:14:06 (14 months ago)
Author:
hansbrix
Message:

converted all unix newlines to PHP_EOL (was already being used in some places, caused inconsistent newline SVN errors for windows users)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/lib/Doctrine/Import/Builder.php

    r4335 r4340  
    346346        } 
    347347 
    348         self::$_tpl =<<<END 
    349 /** 
    350  * This class has been auto-generated by the Doctrine ORM Framework 
    351  */ 
    352 %sclass %s extends %s 
    353 { 
    354 %s 
    355 %s 
    356 %s 
    357 } 
    358 END; 
     348        self::$_tpl = '/**' . PHP_EOL 
     349                    . ' * This class has been auto-generated by the Doctrine ORM Framework' . PHP_EOL 
     350                    . ' */' . PHP_EOL 
     351                    . '%sclass %s extends %s' . PHP_EOL 
     352                    . '{' . PHP_EOL 
     353                    . '%s' . PHP_EOL 
     354                    . '%s' . PHP_EOL 
     355                    . '%s' . PHP_EOL 
     356                    . '}' . PHP_EOL; 
    359357    } 
    360358 
     
    410408        } 
    411409         
    412         $code = implode("\n", $ret); 
     410        $code = implode(PHP_EOL, $ret); 
    413411        $code = trim($code); 
    414412         
    415         return "\n  public function setTableDefinition()"."\n  {\n    ".$code."\n  }"; 
     413        return PHP_EOL . "  public function setTableDefinition()" . PHP_EOL . '  {' . PHP_EOL . '    ' . $code . PHP_EOL . '  }'; 
    416414    } 
    417415 
     
    488486                } 
    489487             
    490                 $ret[$i] .= ');'."\n"; 
     488                $ret[$i] .= ');'.PHP_EOL; 
    491489                $i++; 
    492490            } 
     
    503501        } 
    504502 
    505         $code = implode("\n", $ret); 
     503        $code = implode(PHP_EOL, $ret); 
    506504        $code = trim($code); 
    507505         
    508         return "\n  public function setUp()\n  {\n    ".$code."\n  }"; 
     506        return PHP_EOL . '  public function setUp()' . PHP_EOL . '  {' . PHP_EOL . '    ' . $code . PHP_EOL . '  }'; 
    509507    } 
    510508 
     
    544542            } 
    545543     
    546             $build .= ");\n"; 
     544            $build .= ');' . PHP_EOL; 
    547545        } 
    548546         
     
    591589        foreach ($accessors as $name) { 
    592590            // getters 
    593             $ret .= "\n  public function get" . Doctrine_Inflector::classify(Doctrine_Inflector::tableize($name)) . "(\$load = true)\n"; 
    594             $ret .= "  {\n"; 
    595             $ret .= "    return \$this->get('{$name}', \$load);\n"; 
    596             $ret .= "  }\n"; 
     591            $ret .= PHP_EOL . '  public function get' . Doctrine_Inflector::classify(Doctrine_Inflector::tableize($name)) . "(\$load = true)" . PHP_EOL; 
     592            $ret .= "  {" . PHP_EOL; 
     593            $ret .= "    return \$this->get('{$name}', \$load);" . PHP_EOL; 
     594            $ret .= "  }" . PHP_EOL; 
    597595 
    598596            // setters 
    599             $ret .= "\n  public function set" . Doctrine_Inflector::classify(Doctrine_Inflector::tableize($name)) . "(\${$name}, \$load = true)\n"; 
    600             $ret .= "  {\n"; 
    601             $ret .= "    return \$this->set('{$name}', \${$name}, \$load);\n"; 
    602             $ret .= "  }\n"; 
     597            $ret .= PHP_EOL . '  public function set' . Doctrine_Inflector::classify(Doctrine_Inflector::tableize($name)) . "(\${$name}, \$load = true)" . PHP_EOL; 
     598                $ret .= "  {" . PHP_EOL; 
     599            $ret .= "    return \$this->set('{$name}', \${$name}, \$load);" . PHP_EOL; 
     600            $ret .= "  }" . PHP_EOL; 
    603601        } 
    604602 
     
    620618                $optionsPhp = $this->varExport($options); 
    621619             
    622                 $build .= "    \$this->loadTemplate('" . $name . "', " . $optionsPhp . ");\n"; 
     620                $build .= "    \$this->loadTemplate('" . $name . "', " . $optionsPhp . ");" . PHP_EOL; 
    623621            } else { 
    624622                if (isset($templates[0])) { 
    625                     $build .= "    \$this->loadTemplate('" . $options . "');\n"; 
     623                    $build .= "    \$this->loadTemplate('" . $options . "');" . PHP_EOL; 
    626624                } else { 
    627                     $build .= "    \$this->loadTemplate('" . $name . "');\n"; 
     625                    $build .= "    \$this->loadTemplate('" . $name . "');" . PHP_EOL; 
    628626                } 
    629627            } 
     
    646644                $optionsPhp = $this->varExport($options); 
    647645                 
    648                 $build .= "    \$this->actAs('" . $name . "', " . $optionsPhp . ");\n"; 
     646                $build .= "    \$this->actAs('" . $name . "', " . $optionsPhp . ");" . PHP_EOL; 
    649647            } else { 
    650648                if (isset($actAs[0])) { 
    651                     $build .= "    \$this->actAs('" . $options . "');\n"; 
     649                    $build .= "    \$this->actAs('" . $options . "');" . PHP_EOL; 
    652650                } else { 
    653                     $build .= "    \$this->actAs('" . $name . "');\n"; 
     651                    $build .= "    \$this->actAs('" . $name . "');" . PHP_EOL; 
    654652                } 
    655653            } 
     
    667665    public function buildAttributes(array $attributes) 
    668666    { 
    669         $build = "\n"; 
     667        $build = PHP_EOL; 
    670668        foreach ($attributes as $key => $value) { 
    671669           
     
    687685            } 
    688686             
    689             $build .= "    \$this->setAttribute(Doctrine::ATTR_" . strtoupper($key) . ", " . $values . ");\n"; 
     687            $build .= "    \$this->setAttribute(Doctrine::ATTR_" . strtoupper($key) . ", " . $values . ");" . PHP_EOL; 
    690688        } 
    691689         
     
    703701        $build = ''; 
    704702        foreach ($options as $name => $value) { 
    705             $build .= "    \$this->option('$name', " . $this->varExport($value) . ");\n"; 
     703            $build .= "    \$this->option('$name', " . $this->varExport($value) . ");" . PHP_EOL; 
    706704        } 
    707705         
     
    720718 
    721719      foreach ($indexes as $indexName => $definitions) { 
    722           $build .= "\n    \$this->index('" . $indexName . "'"; 
     720          $build .= PHP_EOL . "    \$this->index('" . $indexName . "'"; 
    723721          $build .= ', ' . $this->varExport($definitions); 
    724722          $build .= ');'; 
     
    946944 
    947945        if (isset($definition['connection']) && $definition['connection']) { 
    948             $code .= "// Connection Component Binding\n"; 
    949             $code .= "Doctrine_Manager::getInstance()->bindComponent('" . $definition['connectionClassName'] . "', '" . $definition['connection'] . "');\n"; 
     946            $code .= "// Connection Component Binding" . PHP_EOL; 
     947            $code .= "Doctrine_Manager::getInstance()->bindComponent('" . $definition['connectionClassName'] . "', '" . $definition['connection'] . "');" . PHP_EOL; 
    950948        } 
    951949