Development

Changeset 19582

You must first sign up to be able to contribute.

Changeset 19582

Show
Ignore:
Timestamp:
06/26/09 09:25:52 (8 months ago)
Author:
fabien
Message:

[dependency_injection] allowed empty YAML file for service definitions, and simplified the YAML output when no parameter or service are defined

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • components/dependency_injection/trunk/lib/sfServiceContainerDumperYaml.php

    r16840 r19582  
    9292  protected function addServices() 
    9393  { 
     94    if (!$this->container->getServiceDefinitions()) 
     95    { 
     96      return ''; 
     97    } 
     98 
    9499    $code = "services:\n"; 
    95100    foreach ($this->container->getServiceDefinitions() as $id => $definition) 
     
    103108  protected function addParameters() 
    104109  { 
     110    if (!$this->container->getParameters()) 
     111    { 
     112      return ''; 
     113    } 
     114 
    105115    return sfYaml::dump(array('parameters' => $this->escape($this->container->getParameters())), 2); 
    106116  } 
  • components/dependency_injection/trunk/lib/sfServiceContainerLoaderFileYaml.php

    r16840 r19582  
    177177  protected function validate($content, $file) 
    178178  { 
     179    if (is_null($content)) 
     180    { 
     181      return $content; 
     182    } 
     183 
    179184    if (!is_array($content)) 
    180185    { 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.