Symfony Components

Description

Expert Symfony Flashcards on Symfony Components, created by Alexandra Negrea on 19/05/2015.
Alexandra Negrea
Flashcards by Alexandra Negrea, updated more than 1 year ago
Alexandra Negrea
Created by Alexandra Negrea almost 9 years ago
35
0

Resource summary

Question Answer
What does the ClassLoader Component do? * provide tools to load classes * cache class locations to improve perfermance
Which autoloaders does Symfony provide? * the PSR-0 class loader * the PSR-4 class loader (2.5) * MapClassLoader
How to enable an autoloader in your app/autoload.php file? require_once '../path/to/autoloaderClass'; $autoloader = new AutoloaderClass(); $autoloader->register();
Which classes in the ClassLoaderComponent allow you to cache the mapping from a class to its containing file? * ApcClassLoader * XCacheClassLoader
What method does the object that the ApcClassLoader or XcacheClassLoader wrap around need to implement? findFile()
$locator = new FileLocator($configDirectories); $yamlUserFiles = $locator->locate('users.yml', null, false); What do the parameters of the locate() function represent? - first: the name of the file to look for..; - second : the current path and when supplied, the locator will look in this directory first. - third: indicates whether or not the locator should return the first file it has found, or an array containing all matches.
How does Symfony find the right loader to load your files? When a resource (for instance an XML file) should be loaded, the LoaderResolver loops through this collection of loaders and returns the loader which supports this particular resource type. The DelegatingLoader makes use of the LoaderResolver.
In the dev env, how does the ConfigCache determine if it isFresh()? In debug mode, a .meta file will be created in the same directory as the cache file itself, containing the serialized resources, whose timestamps are used to determine if the cache is still fresh.
What does your bundle need to return in order to have a custom, valid configuration? A TreeBuilder instance should be returned from a custom Configuration class which implements the ConfigurationInterface.
What is Normalization used for in the configuration? The normalization process is used to remove some of the differences that result from different configuration formats, mainly the differences between YAML and XML. The separator used in keys is typically _ in YAML and - in XML. For example, auto_connect in YAML and auto-connect in XML. The normalization would make both of these auto_connect. The target key will not be altered if it's mixed like foo-bar_moo or if it already exists.
Show full summary Hide full summary

Similar

Symfony Components Quiz
Alexandra Negrea
Flash messages
Elvis Moraes
Component Notes
Alexandra Negrea
Symfony Certification
Nash Delos Santos
Symfony Components Quiz 2
Adrian Caliman
Cookbook Quiz
Alexandra Negrea
Business Finance - Chapter 1
waynejonesjnr
Plate tectonics, earthquakes and volcanoes
Fleur Marie
Biology (level 0)
jmlari12
Biology Unit 1a - GCSE - AQA
RosettaStoneDecoded
Basic English Grammar
cwilson218@gmail.com