Alexandra Negrea
Quiz by , created more than 1 year ago

Expert Symfony Quiz on Symfony Components Quiz, created by Alexandra Negrea on 19/05/2015.

238
0
0
Alexandra Negrea
Created by Alexandra Negrea almost 9 years ago
Close

Symfony Components Quiz

Question 1 of 10

1

What functions can you call on an instance of \Symfony\Component\ClassLoader\ClassLoader, apart from the register() function?

Select one or more of the following:

  • $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');

Explanation

Question 2 of 10

1

What classes allow you to cache the mapping from a class to its containing file?

Select one or more of the following:

  • ApcClassLoader

  • AppClassLoader

  • XDebugClassLoader

  • XcacheClassLoader

Explanation

Question 3 of 10

1

How can you instantiate an ApcClassLoader?

Select one of the following:

  • new ApcClassLoader($loader, sha1(__FILE__));

  • new ApcClassLoader($loader);

  • new ApcClassLoader(sha1(__FILE__), $loader);

  • new ApcClassLoader('../app/cache', $loader);

Explanation

Question 4 of 10

1

Two class loaders can co-exist in the application?

Select one of the following:

  • True
  • False

Explanation

Question 5 of 10

1

How many classes does the class loader component have?

Select one of the following:

  • Less than 10

  • About 20

  • More than 40

Explanation

Question 6 of 10

1

you can define a new file loader in Symfony, if the new loader class :

Select one or more of the following:

  • 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

Explanation

Question 7 of 10

1

You should merge all your configuration files into one and use it as cache.

Select one of the following:

  • True
  • False

Explanation

Question 8 of 10

1

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?

Select one or more of the following:

  • CacheConfig

  • ConfigurationCache

  • ConfigLoaderCache

  • ConfigCache

Explanation

Question 9 of 10

1

In the context of a TreeBuilder, which of the following are valid node types?

Select one or more of the following:

  • string

  • scalar

  • array

  • enum

  • serviceId

  • integer

  • boolean

  • float

  • parameter

  • variable

Explanation

Question 10 of 10

1

Which of the following are valid ways to define a scalar node type? (to replace .... below)

$treeBuilder
->children()
.....
->end();

Select one or more of the following:

  • ->node('name', 'scalar')

  • ->scalarNode('name')

  • ->addScalarNode('name')

  • ->nodeName('scalar')

Explanation