Zusammenfassung der Ressource
Frage 1
Frage
What functions can you call on an instance of \Symfony\Component\ClassLoader\ClassLoader, apart from the register() function?
Antworten
-
$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');
Frage 2
Frage
What classes allow you to cache the mapping from a class to its containing file?
Antworten
-
ApcClassLoader
-
AppClassLoader
-
XDebugClassLoader
-
XcacheClassLoader
Frage 3
Frage
How can you instantiate an ApcClassLoader?
Antworten
-
new ApcClassLoader($loader, sha1(__FILE__));
-
new ApcClassLoader($loader);
-
new ApcClassLoader(sha1(__FILE__), $loader);
-
new ApcClassLoader('../app/cache', $loader);
Frage 4
Frage
Two class loaders can co-exist in the application?
Frage 5
Frage
How many classes does the class loader component have?
Antworten
-
Less than 10
-
About 20
-
More than 40
Frage 6
Frage
you can define a new file loader in Symfony, if the new loader class :
Antworten
-
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
Frage 7
Frage
You should merge all your configuration files into one and use it as cache.
Frage 8
Frage
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?
Antworten
-
CacheConfig
-
ConfigurationCache
-
ConfigLoaderCache
-
ConfigCache
Frage 9
Frage
In the context of a TreeBuilder, which of the following are valid node types?
Antworten
-
string
-
scalar
-
array
-
enum
-
serviceId
-
integer
-
boolean
-
float
-
parameter
-
variable
Frage 10
Frage
Which of the following are valid ways to define a scalar node type? (to replace .... below)
$treeBuilder
->children()
.....
->end();
Antworten
-
->node('name', 'scalar')
-
->scalarNode('name')
-
->addScalarNode('name')
-
->nodeName('scalar')