src/Config/Writer/SphinxConf.php
protected function substituteVars(Config $config, $prefix = '{', $suffix = '}')
    {
        $arrayConfig = $config->toArray();
        if (isset($arrayConfig['variables'])) {
            $vars = array_map(
                function ($x) use ($prefix, $suffix) {
                    return $prefix . $x . $suffix;
                },
                array_keys($arrayConfig['variables'])
            );
            $vals = array_values($arrayConfig['variables']);
            $tokens = array_combine($vars, $vals);
            $processor = new Token();
            $processor->setTokens($tokens);
            $processor->process($config);
            // Remove variables node
            unset($config->variables);
        }
        return $config;
    }
protected function substituteVars(Config $config, $prefix = '{', $suffix = '}')
    {
        $arrayConfig = $config->toArray();
        if (isset($arrayConfig['variables'])) {
            $vars = array_map(
                function ($x) use ($prefix, $suffix) {
                    return $prefix . $x . $suffix;
                },
                array_keys($arrayConfig['variables'])
            );
            $vals = array_values($arrayConfig['variables']);
            $tokens = array_combine($vars, $vals);
            $processor = new Token();
            $processor->setTokens($tokens);
            $processor->process($config);
            // Remove variables node
            unset($config->variables);
        }
        return $config;
    }
protected function substituteVars ( Config $ config , $ prefix = '{' , $ suffix = '}' ) { $ arrayConfig = $ config -> toArray ( ) ; if ( isset ( $ arrayConfig [ 'variables' ] ) ) { $ vars = array_map ( function ( $ x ) use ( $ prefix , $ suffix ) { return $ prefix . $ x . $ suffix ; } , array_keys ( $ arrayConfig [ 'variables' ] ) ) ; $ vals = array_values ( $ arrayConfig [ 'variables' ] ) ; $ tokens = array_combine ( $ vars , $ vals ) ; $ processor = new Token ( ) ; $ processor -> setTokens ( $ tokens ) ; $ processor -> process ( $ config ) ; // Remove variables node unset ( $ config -> variables ) ; } return $ config ; }
Substitute defined variables, if any found and return the new configuration object

@param Config $config
@param string $prefix
@param string $suffix
@return Config
Substitute defined variables if any found and return the new configuration object