What functions can you call on an instance of \Symfony\Component\ClassLoader\ClassLoader, apart from the register() function?
$loader->addPrefix('Twig_', __DIR__.'/vendor/twig/twig/lib');
$loader->setUseIncludePath(true);
$loader->addPrefixes(array( 'Symfony' => __DIR__.'/../vendor/symfony/symfony/src', 'Monolog' => __DIR__.'/../vendor/monolog/monolog/src', ));
$loader->mapClass(Twig_', __DIR__.'/vendor/twig/twig/lib');
What classes allow you to cache the mapping from a class to its containing file?
ApcClassLoader
AppClassLoader
XDebugClassLoader
XcacheClassLoader
How can you instantiate an ApcClassLoader?
new ApcClassLoader($loader, sha1(__FILE__));
new ApcClassLoader($loader);
new ApcClassLoader(sha1(__FILE__), $loader);
new ApcClassLoader('../app/cache', $loader);
Two class loaders can co-exist in the application?
How many classes does the class loader component have?
Less than 10
About 20
More than 40
you can define a new file loader in Symfony, if the new loader class :
is registered in yml as a service with the config.file_loader tag
is registered with the DelagatingLoader
implements the LoaderInterface
extends the abstract FileLoader class
You should merge all your configuration files into one and use it as cache.
What class in the Config Component helps you manage and check if the generate cache file containing all the configuration is valid and if not regenerate it?
CacheConfig
ConfigurationCache
ConfigLoaderCache
ConfigCache
In the context of a TreeBuilder, which of the following are valid node types?
string
scalar
array
enum
serviceId
integer
boolean
float
parameter
variable
Which of the following are valid ways to define a scalar node type? (to replace .... below)
$treeBuilder ->children() ..... ->end();
->node('name', 'scalar')
->scalarNode('name')
->addScalarNode('name')
->nodeName('scalar')