public function generateAndLoadClass($className)
    {
        if (class_exists($className, false)) {
            throw new \RuntimeException("Unable to generate and load already existing class '$className'");
        }

        $filename = $this->findFile($className);

        if (!$filename || !file_exists($filename)) {
            $classFileGenerator = $this->_builder->build($className);

            if ($filename) {
                file_put_contents($filename, $classFileGenerator->generate());
            } else {
                $this->evalContent($classFileGenerator);
            }
        }
        if ($filename && file_exists($filename)) {
            include $filename;
        }
    }
public function generateAndLoadClass($className)
    {
        if (class_exists($className, false)) {
            throw new \RuntimeException("Unable to generate and load already existing class '$className'");
        }

        $filename = $this->findFile($className);

        if (!$filename || !file_exists($filename)) {
            $classFileGenerator = $this->_builder->build($className);

            if ($filename) {
                file_put_contents($filename, $classFileGenerator->generate());
            } else {
                $this->evalContent($classFileGenerator);
            }
        }
        if ($filename && file_exists($filename)) {
            include $filename;
        }
    }
public function generateAndLoadClass ( $ className ) { if ( class_exists ( $ className , false ) ) { throw new \ RuntimeException ( "Unable to generate and load already existing class '$className'" ) ; } $ filename = $ this -> findFile ( $ className ) ; if ( ! $ filename || ! file_exists ( $ filename ) ) { $ classFileGenerator = $ this -> _builder -> build ( $ className ) ; if ( $ filename ) { file_put_contents ( $ filename , $ classFileGenerator -> generate ( ) ) ; } else { $ this -> evalContent ( $ classFileGenerator ) ; } } if ( $ filename && file_exists ( $ filename ) ) { include $ filename ; } }
Generate and load the given class

@param string $className

@throws \Exception
@return void
Generate and load the given class