LazyRecord\ConfigLoader::initForBuild PHP Method

initForBuild() public method

public initForBuild ( )
    public function initForBuild()
    {
        if (!$this->loaded) {
            throw new Exception('Can not initialize config: Config is not loaded.');
        }
        $this->loadDataSources();
        $this->loadBootstrap();
        if (!$this->loadExternalSchemaLoader()) {
            // Load default schema loader
            $paths = $this->getSchemaPaths();
            if (!empty($paths)) {
                $finder = new SchemaFinder($paths);
                $finder->find();
            }
        }
    }

Usage Example

Example #1
0
 public function prepare()
 {
     // softly load the config file.
     $this->config = ConfigLoader::getInstance();
     $this->config->loadFromSymbol(true);
     // force loading
     if ($this->config->isLoaded()) {
         $this->config->initForBuild();
     }
 }