Development

Changeset 19545

You must first sign up to be able to contribute.

Changeset 19545

Show
Ignore:
Timestamp:
06/25/09 16:24:22 (8 months ago)
Author:
fabien
Message:

[dependency_injection] added a way to change the base class of the dumped PHP classes

Files:

Legend:

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

    r16896 r19545  
    3333  public function dump(array $options = array()) 
    3434  { 
    35     $class = isset($options['class']) ? $options['class'] : 'ProjectServiceContainer'; 
    36  
    37     return $this->startClass($class).$this->addServices().$this->endClass(); 
     35    $options = array_merge(array( 
     36      'class'      => 'ProjectServiceContainer', 
     37      'base_class' => 'sfServiceContainer', 
     38    ), $options); 
     39 
     40    return $this->startClass($options['class'], $options['base_class']).$this->addServices().$this->endClass(); 
    3841  } 
    3942 
     
    192195  } 
    193196 
    194   protected function startClass($class
     197  protected function startClass($class, $baseClass
    195198  { 
    196199    $code = <<<EOF 
    197200<?php 
    198201 
    199 class $class extends sfServiceContainer 
     202class $class extends $baseClass 
    200203{ 
    201204  protected \$shared = array(); 

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.