├── .gitignore ├── MyApplication ├── .gitignore ├── .phpcomplete_extended │ ├── core_index │ └── index_cache ├── README.md ├── app │ ├── .htaccess │ ├── AppCache.php │ ├── AppKernel.php │ ├── DoctrineMigrations │ │ ├── Version20150524202209.php │ │ └── Version20150524205751.php │ ├── Resources │ │ └── views │ │ │ ├── base.html.twig │ │ │ └── default │ │ │ └── index.html.twig │ ├── SymfonyRequirements.php │ ├── autoload.php │ ├── cache │ │ └── .gitkeep │ ├── check.php │ ├── config │ │ ├── config.yml │ │ ├── config_dev.yml │ │ ├── config_prod.yml │ │ ├── config_test.yml │ │ ├── parameters.yml.dist │ │ ├── routing.yml │ │ ├── routing_dev.yml │ │ ├── security.yml │ │ └── services.yml │ ├── console │ ├── logs │ │ └── .gitkeep │ └── phpunit.xml.dist ├── composer.json ├── composer.lock ├── src │ ├── .htaccess │ ├── Acme │ │ └── DemoBundle │ │ │ ├── AcmeDemoBundle.php │ │ │ ├── Command │ │ │ └── HelloWorldCommand.php │ │ │ ├── Controller │ │ │ ├── DemoController.php │ │ │ ├── SecuredController.php │ │ │ └── WelcomeController.php │ │ │ ├── DependencyInjection │ │ │ └── AcmeDemoExtension.php │ │ │ ├── EventListener │ │ │ └── ControllerListener.php │ │ │ ├── Form │ │ │ └── ContactType.php │ │ │ ├── Resources │ │ │ ├── config │ │ │ │ ├── routing.yml │ │ │ │ └── services.xml │ │ │ ├── public │ │ │ │ ├── css │ │ │ │ │ └── demo.css │ │ │ │ └── images │ │ │ │ │ ├── blue-arrow.png │ │ │ │ │ ├── field-background.gif │ │ │ │ │ ├── logo.gif │ │ │ │ │ ├── search.png │ │ │ │ │ ├── welcome-configure.gif │ │ │ │ │ ├── welcome-demo.gif │ │ │ │ │ └── welcome-quick-tour.gif │ │ │ └── views │ │ │ │ ├── Demo │ │ │ │ ├── contact.html.twig │ │ │ │ ├── hello.html.twig │ │ │ │ └── index.html.twig │ │ │ │ ├── Secured │ │ │ │ ├── hello.html.twig │ │ │ │ ├── helloadmin.html.twig │ │ │ │ ├── layout.html.twig │ │ │ │ └── login.html.twig │ │ │ │ ├── Welcome │ │ │ │ └── index.html.twig │ │ │ │ └── layout.html.twig │ │ │ ├── Tests │ │ │ └── Controller │ │ │ │ └── DemoControllerTest.php │ │ │ └── Twig │ │ │ └── Extension │ │ │ └── DemoExtension.php │ └── AppBundle │ │ ├── AppBundle.php │ │ ├── Controller │ │ ├── ArticlesController.php │ │ └── DefaultController.php │ │ ├── Entity │ │ └── Article.php │ │ ├── Form │ │ └── ArticleType.php │ │ ├── Resources │ │ └── config │ │ │ └── api-routing.yml │ │ └── Tests │ │ └── Controller │ │ └── DefaultControllerTest.php └── web │ ├── .htaccess │ ├── app.php │ ├── app_dev.php │ ├── apple-touch-icon.png │ ├── config.php │ ├── favicon.ico │ └── robots.txt ├── README.md ├── Vagrantfile └── provisioning ├── roles ├── apache │ ├── handlers │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── hhvm │ ├── handlers │ │ └── main.yml │ └── tasks │ │ ├── main.yml │ │ └── pdo_psql.yml ├── php │ ├── files │ │ └── php-extra.ini │ ├── handlers │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── postgresql │ └── tasks │ │ └── main.yml ├── symfony │ └── tasks │ │ └── main.yml ├── vagrantbox │ ├── files │ │ └── php.ini │ ├── handlers │ │ └── main.yml │ └── tasks │ │ ├── main.yml │ │ ├── vagrantify_apache.yml │ │ ├── vagrantify_hhvm.yml │ │ ├── vagrantify_php5-fpm.yml │ │ └── vm_swapfile.yml └── webapp │ ├── files │ └── Symfony.gitignore │ ├── tasks │ ├── init_app_via_composer.yml │ ├── init_app_via_installer.yml │ └── main.yml │ └── templates │ ├── apache2.vhost.j2 │ └── php-fpm-pool.conf.j2 └── site.yml /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *.phar 3 | -------------------------------------------------------------------------------- /MyApplication/.gitignore: -------------------------------------------------------------------------------- 1 | /app/bootstrap.php.cache 2 | /app/cache/* 3 | !app/cache/.gitkeep 4 | /app/config/parameters.yml 5 | /app/logs/* 6 | !app/logs/.gitkeep 7 | /app/phpunit.xml 8 | /bin/ 9 | /composer.phar 10 | /vendor/ 11 | /web/bundles/ 12 | -------------------------------------------------------------------------------- /MyApplication/.phpcomplete_extended/index_cache: -------------------------------------------------------------------------------- 1 | {'namespace_cache': {}, 'classname_cache': {}, 'methods_cache': {}, 'fqcn_classkey_cache': {}} 2 | -------------------------------------------------------------------------------- /MyApplication/README.md: -------------------------------------------------------------------------------- 1 | # Symfony2 rest API example 2 | 3 | This project is meant to be an application of the tutorial created here: 4 | [http://allan-simon.github.io/blog/posts/create-a-rest-api-with-symfony2/](http://allan-simon.github.io/blog/posts/create-a-rest-api-with-symfony2/) 5 | 6 | the reader is adviced to read through the history of commits as well 7 | as the code itself as it is heavily commented in order to serve as a 8 | base of example for people wanting to create a REST Api with symfony2 9 | 10 | each release tagged correspond to the result at the end of each blog post 11 | -------------------------------------------------------------------------------- /MyApplication/app/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Order deny,allow 6 | Deny from all 7 | 8 | -------------------------------------------------------------------------------- /MyApplication/app/AppCache.php: -------------------------------------------------------------------------------- 1 | getEnvironment(), array('dev', 'test'))) { 26 | $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); 27 | $bundles[] = new Acme\DemoBundle\AcmeDemoBundle(); 28 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 29 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 30 | $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 31 | } 32 | 33 | return $bundles; 34 | } 35 | 36 | public function registerContainerConfiguration(LoaderInterface $loader) 37 | { 38 | $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /MyApplication/app/DoctrineMigrations/Version20150524202209.php: -------------------------------------------------------------------------------- 1 | abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); 20 | 21 | $this->addSql('CREATE TABLE Article (id INT NOT NULL, title VARCHAR(255) NOT NULL, body VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); 22 | } 23 | 24 | /** 25 | * @param Schema $schema 26 | */ 27 | public function down(Schema $schema) 28 | { 29 | // this down() migration is auto-generated, please modify it to your needs 30 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); 31 | 32 | $this->addSql('DROP TABLE Article'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /MyApplication/app/DoctrineMigrations/Version20150524205751.php: -------------------------------------------------------------------------------- 1 | abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); 20 | 21 | $this->addSql('CREATE SEQUENCE Article_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); 22 | } 23 | 24 | /** 25 | * @param Schema $schema 26 | */ 27 | public function down(Schema $schema) 28 | { 29 | // this down() migration is auto-generated, please modify it to your needs 30 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); 31 | 32 | $this->addSql('DROP SEQUENCE Article_id_seq CASCADE'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /MyApplication/app/Resources/views/base.html.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% block title %}Welcome!{% endblock %} 6 | {% block stylesheets %}{% endblock %} 7 | 8 | 9 | 10 | {% block body %}{% endblock %} 11 | {% block javascripts %}{% endblock %} 12 | 13 | 14 | -------------------------------------------------------------------------------- /MyApplication/app/Resources/views/default/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block body %} 4 | Homepage. 5 | {% endblock %} 6 | -------------------------------------------------------------------------------- /MyApplication/app/SymfonyRequirements.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | /* 13 | * Users of PHP 5.2 should be able to run the requirements checks. 14 | * This is why the file and all classes must be compatible with PHP 5.2+ 15 | * (e.g. not using namespaces and closures). 16 | * 17 | * ************** CAUTION ************** 18 | * 19 | * DO NOT EDIT THIS FILE as it will be overridden by Composer as part of 20 | * the installation/update process. The original file resides in the 21 | * SensioDistributionBundle. 22 | * 23 | * ************** CAUTION ************** 24 | */ 25 | 26 | /** 27 | * Represents a single PHP requirement, e.g. an installed extension. 28 | * It can be a mandatory requirement or an optional recommendation. 29 | * There is a special subclass, named PhpIniRequirement, to check a php.ini configuration. 30 | * 31 | * @author Tobias Schultze 32 | */ 33 | class Requirement 34 | { 35 | private $fulfilled; 36 | private $testMessage; 37 | private $helpText; 38 | private $helpHtml; 39 | private $optional; 40 | 41 | /** 42 | * Constructor that initializes the requirement. 43 | * 44 | * @param bool $fulfilled Whether the requirement is fulfilled 45 | * @param string $testMessage The message for testing the requirement 46 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 47 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 48 | * @param bool $optional Whether this is only an optional recommendation not a mandatory requirement 49 | */ 50 | public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) 51 | { 52 | $this->fulfilled = (bool) $fulfilled; 53 | $this->testMessage = (string) $testMessage; 54 | $this->helpHtml = (string) $helpHtml; 55 | $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; 56 | $this->optional = (bool) $optional; 57 | } 58 | 59 | /** 60 | * Returns whether the requirement is fulfilled. 61 | * 62 | * @return bool true if fulfilled, otherwise false 63 | */ 64 | public function isFulfilled() 65 | { 66 | return $this->fulfilled; 67 | } 68 | 69 | /** 70 | * Returns the message for testing the requirement. 71 | * 72 | * @return string The test message 73 | */ 74 | public function getTestMessage() 75 | { 76 | return $this->testMessage; 77 | } 78 | 79 | /** 80 | * Returns the help text for resolving the problem. 81 | * 82 | * @return string The help text 83 | */ 84 | public function getHelpText() 85 | { 86 | return $this->helpText; 87 | } 88 | 89 | /** 90 | * Returns the help text formatted in HTML. 91 | * 92 | * @return string The HTML help 93 | */ 94 | public function getHelpHtml() 95 | { 96 | return $this->helpHtml; 97 | } 98 | 99 | /** 100 | * Returns whether this is only an optional recommendation and not a mandatory requirement. 101 | * 102 | * @return bool true if optional, false if mandatory 103 | */ 104 | public function isOptional() 105 | { 106 | return $this->optional; 107 | } 108 | } 109 | 110 | /** 111 | * Represents a PHP requirement in form of a php.ini configuration. 112 | * 113 | * @author Tobias Schultze 114 | */ 115 | class PhpIniRequirement extends Requirement 116 | { 117 | /** 118 | * Constructor that initializes the requirement. 119 | * 120 | * @param string $cfgName The configuration name used for ini_get() 121 | * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, 122 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 123 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 124 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 125 | * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 126 | * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) 127 | * @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) 128 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 129 | * @param bool $optional Whether this is only an optional recommendation not a mandatory requirement 130 | */ 131 | public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false) 132 | { 133 | $cfgValue = ini_get($cfgName); 134 | 135 | if (is_callable($evaluation)) { 136 | if (null === $testMessage || null === $helpHtml) { 137 | throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.'); 138 | } 139 | 140 | $fulfilled = call_user_func($evaluation, $cfgValue); 141 | } else { 142 | if (null === $testMessage) { 143 | $testMessage = sprintf('%s %s be %s in php.ini', 144 | $cfgName, 145 | $optional ? 'should' : 'must', 146 | $evaluation ? 'enabled' : 'disabled' 147 | ); 148 | } 149 | 150 | if (null === $helpHtml) { 151 | $helpHtml = sprintf('Set %s to %s in php.ini*.', 152 | $cfgName, 153 | $evaluation ? 'on' : 'off' 154 | ); 155 | } 156 | 157 | $fulfilled = $evaluation == $cfgValue; 158 | } 159 | 160 | parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional); 161 | } 162 | } 163 | 164 | /** 165 | * A RequirementCollection represents a set of Requirement instances. 166 | * 167 | * @author Tobias Schultze 168 | */ 169 | class RequirementCollection implements IteratorAggregate 170 | { 171 | private $requirements = array(); 172 | 173 | /** 174 | * Gets the current RequirementCollection as an Iterator. 175 | * 176 | * @return Traversable A Traversable interface 177 | */ 178 | public function getIterator() 179 | { 180 | return new ArrayIterator($this->requirements); 181 | } 182 | 183 | /** 184 | * Adds a Requirement. 185 | * 186 | * @param Requirement $requirement A Requirement instance 187 | */ 188 | public function add(Requirement $requirement) 189 | { 190 | $this->requirements[] = $requirement; 191 | } 192 | 193 | /** 194 | * Adds a mandatory requirement. 195 | * 196 | * @param bool $fulfilled Whether the requirement is fulfilled 197 | * @param string $testMessage The message for testing the requirement 198 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 199 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 200 | */ 201 | public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null) 202 | { 203 | $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false)); 204 | } 205 | 206 | /** 207 | * Adds an optional recommendation. 208 | * 209 | * @param bool $fulfilled Whether the recommendation is fulfilled 210 | * @param string $testMessage The message for testing the recommendation 211 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 212 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 213 | */ 214 | public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null) 215 | { 216 | $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true)); 217 | } 218 | 219 | /** 220 | * Adds a mandatory requirement in form of a php.ini configuration. 221 | * 222 | * @param string $cfgName The configuration name used for ini_get() 223 | * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, 224 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 225 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 226 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 227 | * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 228 | * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) 229 | * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) 230 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 231 | */ 232 | public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) 233 | { 234 | $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false)); 235 | } 236 | 237 | /** 238 | * Adds an optional recommendation in form of a php.ini configuration. 239 | * 240 | * @param string $cfgName The configuration name used for ini_get() 241 | * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, 242 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 243 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 244 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 245 | * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 246 | * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) 247 | * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) 248 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 249 | */ 250 | public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) 251 | { 252 | $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true)); 253 | } 254 | 255 | /** 256 | * Adds a requirement collection to the current set of requirements. 257 | * 258 | * @param RequirementCollection $collection A RequirementCollection instance 259 | */ 260 | public function addCollection(RequirementCollection $collection) 261 | { 262 | $this->requirements = array_merge($this->requirements, $collection->all()); 263 | } 264 | 265 | /** 266 | * Returns both requirements and recommendations. 267 | * 268 | * @return array Array of Requirement instances 269 | */ 270 | public function all() 271 | { 272 | return $this->requirements; 273 | } 274 | 275 | /** 276 | * Returns all mandatory requirements. 277 | * 278 | * @return array Array of Requirement instances 279 | */ 280 | public function getRequirements() 281 | { 282 | $array = array(); 283 | foreach ($this->requirements as $req) { 284 | if (!$req->isOptional()) { 285 | $array[] = $req; 286 | } 287 | } 288 | 289 | return $array; 290 | } 291 | 292 | /** 293 | * Returns the mandatory requirements that were not met. 294 | * 295 | * @return array Array of Requirement instances 296 | */ 297 | public function getFailedRequirements() 298 | { 299 | $array = array(); 300 | foreach ($this->requirements as $req) { 301 | if (!$req->isFulfilled() && !$req->isOptional()) { 302 | $array[] = $req; 303 | } 304 | } 305 | 306 | return $array; 307 | } 308 | 309 | /** 310 | * Returns all optional recommendations. 311 | * 312 | * @return array Array of Requirement instances 313 | */ 314 | public function getRecommendations() 315 | { 316 | $array = array(); 317 | foreach ($this->requirements as $req) { 318 | if ($req->isOptional()) { 319 | $array[] = $req; 320 | } 321 | } 322 | 323 | return $array; 324 | } 325 | 326 | /** 327 | * Returns the recommendations that were not met. 328 | * 329 | * @return array Array of Requirement instances 330 | */ 331 | public function getFailedRecommendations() 332 | { 333 | $array = array(); 334 | foreach ($this->requirements as $req) { 335 | if (!$req->isFulfilled() && $req->isOptional()) { 336 | $array[] = $req; 337 | } 338 | } 339 | 340 | return $array; 341 | } 342 | 343 | /** 344 | * Returns whether a php.ini configuration is not correct. 345 | * 346 | * @return bool php.ini configuration problem? 347 | */ 348 | public function hasPhpIniConfigIssue() 349 | { 350 | foreach ($this->requirements as $req) { 351 | if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) { 352 | return true; 353 | } 354 | } 355 | 356 | return false; 357 | } 358 | 359 | /** 360 | * Returns the PHP configuration file (php.ini) path. 361 | * 362 | * @return string|false php.ini file path 363 | */ 364 | public function getPhpIniConfigPath() 365 | { 366 | return get_cfg_var('cfg_file_path'); 367 | } 368 | } 369 | 370 | /** 371 | * This class specifies all requirements and optional recommendations that 372 | * are necessary to run the Symfony Standard Edition. 373 | * 374 | * @author Tobias Schultze 375 | * @author Fabien Potencier 376 | */ 377 | class SymfonyRequirements extends RequirementCollection 378 | { 379 | const REQUIRED_PHP_VERSION = '5.3.3'; 380 | 381 | /** 382 | * Constructor that initializes the requirements. 383 | */ 384 | public function __construct() 385 | { 386 | /* mandatory requirements follow */ 387 | 388 | $installedPhpVersion = phpversion(); 389 | 390 | $this->addRequirement( 391 | version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>='), 392 | sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $installedPhpVersion), 393 | sprintf('You are running PHP version "%s", but Symfony needs at least PHP "%s" to run. 394 | Before using Symfony, upgrade your PHP installation, preferably to the latest version.', 395 | $installedPhpVersion, self::REQUIRED_PHP_VERSION), 396 | sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion) 397 | ); 398 | 399 | $this->addRequirement( 400 | version_compare($installedPhpVersion, '5.3.16', '!='), 401 | 'PHP version must not be 5.3.16 as Symfony won\'t work properly with it', 402 | 'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)' 403 | ); 404 | 405 | $this->addRequirement( 406 | is_dir(__DIR__.'/../vendor/composer'), 407 | 'Vendor libraries must be installed', 408 | 'Vendor libraries are missing. Install composer following instructions from http://getcomposer.org/. '. 409 | 'Then run "php composer.phar install" to install them.' 410 | ); 411 | 412 | $cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache'; 413 | 414 | $this->addRequirement( 415 | is_writable($cacheDir), 416 | 'app/cache/ or var/cache/ directory must be writable', 417 | 'Change the permissions of either "app/cache/" or "var/cache/" directory so that the web server can write into it.' 418 | ); 419 | 420 | $logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs'; 421 | 422 | $this->addRequirement( 423 | is_writable($logsDir), 424 | 'app/logs/ or var/logs/ directory must be writable', 425 | 'Change the permissions of either "app/logs/" or "var/logs/" directory so that the web server can write into it.' 426 | ); 427 | 428 | $this->addPhpIniRequirement( 429 | 'date.timezone', true, false, 430 | 'date.timezone setting must be set', 431 | 'Set the "date.timezone" setting in php.ini* (like Europe/Paris).' 432 | ); 433 | 434 | if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) { 435 | $timezones = array(); 436 | foreach (DateTimeZone::listAbbreviations() as $abbreviations) { 437 | foreach ($abbreviations as $abbreviation) { 438 | $timezones[$abbreviation['timezone_id']] = true; 439 | } 440 | } 441 | 442 | $this->addRequirement( 443 | isset($timezones[@date_default_timezone_get()]), 444 | sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()), 445 | 'Your default timezone is not supported by PHP. Check for typos in your php.ini file and have a look at the list of deprecated timezones at http://php.net/manual/en/timezones.others.php.' 446 | ); 447 | } 448 | 449 | $this->addRequirement( 450 | function_exists('json_encode'), 451 | 'json_encode() must be available', 452 | 'Install and enable the JSON extension.' 453 | ); 454 | 455 | $this->addRequirement( 456 | function_exists('session_start'), 457 | 'session_start() must be available', 458 | 'Install and enable the session extension.' 459 | ); 460 | 461 | $this->addRequirement( 462 | function_exists('ctype_alpha'), 463 | 'ctype_alpha() must be available', 464 | 'Install and enable the ctype extension.' 465 | ); 466 | 467 | $this->addRequirement( 468 | function_exists('token_get_all'), 469 | 'token_get_all() must be available', 470 | 'Install and enable the Tokenizer extension.' 471 | ); 472 | 473 | $this->addRequirement( 474 | function_exists('simplexml_import_dom'), 475 | 'simplexml_import_dom() must be available', 476 | 'Install and enable the SimpleXML extension.' 477 | ); 478 | 479 | if (function_exists('apc_store') && ini_get('apc.enabled')) { 480 | if (version_compare($installedPhpVersion, '5.4.0', '>=')) { 481 | $this->addRequirement( 482 | version_compare(phpversion('apc'), '3.1.13', '>='), 483 | 'APC version must be at least 3.1.13 when using PHP 5.4', 484 | 'Upgrade your APC extension (3.1.13+).' 485 | ); 486 | } else { 487 | $this->addRequirement( 488 | version_compare(phpversion('apc'), '3.0.17', '>='), 489 | 'APC version must be at least 3.0.17', 490 | 'Upgrade your APC extension (3.0.17+).' 491 | ); 492 | } 493 | } 494 | 495 | $this->addPhpIniRequirement('detect_unicode', false); 496 | 497 | if (extension_loaded('suhosin')) { 498 | $this->addPhpIniRequirement( 499 | 'suhosin.executor.include.whitelist', 500 | create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'), 501 | false, 502 | 'suhosin.executor.include.whitelist must be configured correctly in php.ini', 503 | 'Add "phar" to suhosin.executor.include.whitelist in php.ini*.' 504 | ); 505 | } 506 | 507 | if (extension_loaded('xdebug')) { 508 | $this->addPhpIniRequirement( 509 | 'xdebug.show_exception_trace', false, true 510 | ); 511 | 512 | $this->addPhpIniRequirement( 513 | 'xdebug.scream', false, true 514 | ); 515 | 516 | $this->addPhpIniRecommendation( 517 | 'xdebug.max_nesting_level', 518 | create_function('$cfgValue', 'return $cfgValue > 100;'), 519 | true, 520 | 'xdebug.max_nesting_level should be above 100 in php.ini', 521 | 'Set "xdebug.max_nesting_level" to e.g. "250" in php.ini* to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.' 522 | ); 523 | } 524 | 525 | $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null; 526 | 527 | $this->addRequirement( 528 | null !== $pcreVersion, 529 | 'PCRE extension must be available', 530 | 'Install the PCRE extension (version 8.0+).' 531 | ); 532 | 533 | if (extension_loaded('mbstring')) { 534 | $this->addPhpIniRequirement( 535 | 'mbstring.func_overload', 536 | create_function('$cfgValue', 'return (int) $cfgValue === 0;'), 537 | true, 538 | 'string functions should not be overloaded', 539 | 'Set "mbstring.func_overload" to 0 in php.ini* to disable function overloading by the mbstring extension.' 540 | ); 541 | } 542 | 543 | /* optional recommendations follow */ 544 | 545 | if (file_exists(__DIR__.'/../vendor/composer')) { 546 | require_once __DIR__.'/../vendor/autoload.php'; 547 | 548 | try { 549 | $r = new \ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); 550 | 551 | $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); 552 | } catch (\ReflectionException $e) { 553 | $contents = ''; 554 | } 555 | $this->addRecommendation( 556 | file_get_contents(__FILE__) === $contents, 557 | 'Requirements file should be up-to-date', 558 | 'Your requirements file is outdated. Run composer install and re-check your configuration.' 559 | ); 560 | } 561 | 562 | $this->addRecommendation( 563 | version_compare($installedPhpVersion, '5.3.4', '>='), 564 | 'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions', 565 | 'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.' 566 | ); 567 | 568 | $this->addRecommendation( 569 | version_compare($installedPhpVersion, '5.3.8', '>='), 570 | 'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156', 571 | 'Install PHP 5.3.8 or newer if your project uses annotations.' 572 | ); 573 | 574 | $this->addRecommendation( 575 | version_compare($installedPhpVersion, '5.4.0', '!='), 576 | 'You should not use PHP 5.4.0 due to the PHP bug #61453', 577 | 'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.' 578 | ); 579 | 580 | $this->addRecommendation( 581 | version_compare($installedPhpVersion, '5.4.11', '>='), 582 | 'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)', 583 | 'Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.' 584 | ); 585 | 586 | $this->addRecommendation( 587 | (version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<')) 588 | || 589 | version_compare($installedPhpVersion, '5.4.8', '>='), 590 | 'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909', 591 | 'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.' 592 | ); 593 | 594 | if (null !== $pcreVersion) { 595 | $this->addRecommendation( 596 | $pcreVersion >= 8.0, 597 | sprintf('PCRE extension should be at least version 8.0 (%s installed)', $pcreVersion), 598 | 'PCRE 8.0+ is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.' 599 | ); 600 | } 601 | 602 | $this->addRecommendation( 603 | class_exists('DomDocument'), 604 | 'PHP-DOM and PHP-XML modules should be installed', 605 | 'Install and enable the PHP-DOM and the PHP-XML modules.' 606 | ); 607 | 608 | $this->addRecommendation( 609 | function_exists('mb_strlen'), 610 | 'mb_strlen() should be available', 611 | 'Install and enable the mbstring extension.' 612 | ); 613 | 614 | $this->addRecommendation( 615 | function_exists('iconv'), 616 | 'iconv() should be available', 617 | 'Install and enable the iconv extension.' 618 | ); 619 | 620 | $this->addRecommendation( 621 | function_exists('utf8_decode'), 622 | 'utf8_decode() should be available', 623 | 'Install and enable the XML extension.' 624 | ); 625 | 626 | $this->addRecommendation( 627 | function_exists('filter_var'), 628 | 'filter_var() should be available', 629 | 'Install and enable the filter extension.' 630 | ); 631 | 632 | if (!defined('PHP_WINDOWS_VERSION_BUILD')) { 633 | $this->addRecommendation( 634 | function_exists('posix_isatty'), 635 | 'posix_isatty() should be available', 636 | 'Install and enable the php_posix extension (used to colorize the CLI output).' 637 | ); 638 | } 639 | 640 | $this->addRecommendation( 641 | class_exists('Locale'), 642 | 'intl extension should be available', 643 | 'Install and enable the intl extension (used for validators).' 644 | ); 645 | 646 | if (class_exists('Collator')) { 647 | $this->addRecommendation( 648 | null !== new Collator('fr_FR'), 649 | 'intl extension should be correctly configured', 650 | 'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.' 651 | ); 652 | } 653 | 654 | if (class_exists('Locale')) { 655 | if (defined('INTL_ICU_VERSION')) { 656 | $version = INTL_ICU_VERSION; 657 | } else { 658 | $reflector = new ReflectionExtension('intl'); 659 | 660 | ob_start(); 661 | $reflector->info(); 662 | $output = strip_tags(ob_get_clean()); 663 | 664 | preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches); 665 | $version = $matches[1]; 666 | } 667 | 668 | $this->addRecommendation( 669 | version_compare($version, '4.0', '>='), 670 | 'intl ICU version should be at least 4+', 671 | 'Upgrade your intl extension with a newer ICU version (4+).' 672 | ); 673 | } 674 | 675 | $accelerator = 676 | (extension_loaded('eaccelerator') && ini_get('eaccelerator.enable')) 677 | || 678 | (extension_loaded('apc') && ini_get('apc.enabled')) 679 | || 680 | (extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.enable')) 681 | || 682 | (extension_loaded('Zend OPcache') && ini_get('opcache.enable')) 683 | || 684 | (extension_loaded('xcache') && ini_get('xcache.cacher')) 685 | || 686 | (extension_loaded('wincache') && ini_get('wincache.ocenabled')) 687 | ; 688 | 689 | $this->addRecommendation( 690 | $accelerator, 691 | 'a PHP accelerator should be installed', 692 | 'Install and/or enable a PHP accelerator (highly recommended).' 693 | ); 694 | 695 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { 696 | $this->addRecommendation( 697 | $this->getRealpathCacheSize() > 1000, 698 | 'realpath_cache_size should be above 1024 in php.ini', 699 | 'Set "realpath_cache_size" to e.g. "1024" in php.ini* to improve performance on windows.' 700 | ); 701 | } 702 | 703 | $this->addPhpIniRecommendation('short_open_tag', false); 704 | 705 | $this->addPhpIniRecommendation('magic_quotes_gpc', false, true); 706 | 707 | $this->addPhpIniRecommendation('register_globals', false, true); 708 | 709 | $this->addPhpIniRecommendation('session.auto_start', false); 710 | 711 | $this->addRecommendation( 712 | class_exists('PDO'), 713 | 'PDO should be installed', 714 | 'Install PDO (mandatory for Doctrine).' 715 | ); 716 | 717 | if (class_exists('PDO')) { 718 | $drivers = PDO::getAvailableDrivers(); 719 | $this->addRecommendation( 720 | count($drivers) > 0, 721 | sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'), 722 | 'Install PDO drivers (mandatory for Doctrine).' 723 | ); 724 | } 725 | } 726 | 727 | /** 728 | * Loads realpath_cache_size from php.ini and converts it to int. 729 | * 730 | * (e.g. 16k is converted to 16384 int) 731 | * 732 | * @return int 733 | */ 734 | protected function getRealpathCacheSize() 735 | { 736 | $size = ini_get('realpath_cache_size'); 737 | $size = trim($size); 738 | $unit = strtolower(substr($size, -1, 1)); 739 | switch ($unit) { 740 | case 'g': 741 | return $size * 1024 * 1024 * 1024; 742 | case 'm': 743 | return $size * 1024 * 1024; 744 | case 'k': 745 | return $size * 1024; 746 | default: 747 | return (int) $size; 748 | } 749 | } 750 | } 751 | -------------------------------------------------------------------------------- /MyApplication/app/autoload.php: -------------------------------------------------------------------------------- 1 | getPhpIniConfigPath(); 8 | 9 | echo_title('Symfony2 Requirements Checker'); 10 | 11 | echo '> PHP is using the following php.ini file:'.PHP_EOL; 12 | if ($iniPath) { 13 | echo_style('green', ' '.$iniPath); 14 | } else { 15 | echo_style('warning', ' WARNING: No configuration file (php.ini) used by PHP!'); 16 | } 17 | 18 | echo PHP_EOL.PHP_EOL; 19 | 20 | echo '> Checking Symfony requirements:'.PHP_EOL.' '; 21 | 22 | $messages = array(); 23 | foreach ($symfonyRequirements->getRequirements() as $req) { 24 | /** @var $req Requirement */ 25 | if ($helpText = get_error_message($req, $lineSize)) { 26 | echo_style('red', 'E'); 27 | $messages['error'][] = $helpText; 28 | } else { 29 | echo_style('green', '.'); 30 | } 31 | } 32 | 33 | $checkPassed = empty($messages['error']); 34 | 35 | foreach ($symfonyRequirements->getRecommendations() as $req) { 36 | if ($helpText = get_error_message($req, $lineSize)) { 37 | echo_style('yellow', 'W'); 38 | $messages['warning'][] = $helpText; 39 | } else { 40 | echo_style('green', '.'); 41 | } 42 | } 43 | 44 | if ($checkPassed) { 45 | echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects', true); 46 | } else { 47 | echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects', true); 48 | 49 | echo_title('Fix the following mandatory requirements', 'red'); 50 | 51 | foreach ($messages['error'] as $helpText) { 52 | echo ' * '.$helpText.PHP_EOL; 53 | } 54 | } 55 | 56 | if (!empty($messages['warning'])) { 57 | echo_title('Optional recommendations to improve your setup', 'yellow'); 58 | 59 | foreach ($messages['warning'] as $helpText) { 60 | echo ' * '.$helpText.PHP_EOL; 61 | } 62 | } 63 | 64 | echo PHP_EOL; 65 | echo_style('title', 'Note'); 66 | echo ' The command console could use a different php.ini file'.PHP_EOL; 67 | echo_style('title', '~~~~'); 68 | echo ' than the one used with your web server. To be on the'.PHP_EOL; 69 | echo ' safe side, please check the requirements from your web'.PHP_EOL; 70 | echo ' server using the '; 71 | echo_style('yellow', 'web/config.php'); 72 | echo ' script.'.PHP_EOL; 73 | echo PHP_EOL; 74 | 75 | exit($checkPassed ? 0 : 1); 76 | 77 | function get_error_message(Requirement $requirement, $lineSize) 78 | { 79 | if ($requirement->isFulfilled()) { 80 | return; 81 | } 82 | 83 | $errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL; 84 | $errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL; 85 | 86 | return $errorMessage; 87 | } 88 | 89 | function echo_title($title, $style = null) 90 | { 91 | $style = $style ?: 'title'; 92 | 93 | echo PHP_EOL; 94 | echo_style($style, $title.PHP_EOL); 95 | echo_style($style, str_repeat('~', strlen($title)).PHP_EOL); 96 | echo PHP_EOL; 97 | } 98 | 99 | function echo_style($style, $message) 100 | { 101 | // ANSI color codes 102 | $styles = array( 103 | 'reset' => "\033[0m", 104 | 'red' => "\033[31m", 105 | 'green' => "\033[32m", 106 | 'yellow' => "\033[33m", 107 | 'error' => "\033[37;41m", 108 | 'success' => "\033[37;42m", 109 | 'title' => "\033[34m", 110 | ); 111 | $supports = has_color_support(); 112 | 113 | echo($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : ''); 114 | } 115 | 116 | function echo_block($style, $title, $message) 117 | { 118 | $message = ' '.trim($message).' '; 119 | $width = strlen($message); 120 | 121 | echo PHP_EOL.PHP_EOL; 122 | 123 | echo_style($style, str_repeat(' ', $width).PHP_EOL); 124 | echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT).PHP_EOL); 125 | echo_style($style, str_pad($message, $width, ' ', STR_PAD_RIGHT).PHP_EOL); 126 | echo_style($style, str_repeat(' ', $width).PHP_EOL); 127 | } 128 | 129 | function has_color_support() 130 | { 131 | static $support; 132 | 133 | if (null === $support) { 134 | if (DIRECTORY_SEPARATOR == '\\') { 135 | $support = false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'); 136 | } else { 137 | $support = function_exists('posix_isatty') && @posix_isatty(STDOUT); 138 | } 139 | } 140 | 141 | return $support; 142 | } 143 | -------------------------------------------------------------------------------- /MyApplication/app/config/config.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: parameters.yml } 3 | - { resource: security.yml } 4 | - { resource: services.yml } 5 | 6 | framework: 7 | #esi: ~ 8 | #translator: { fallbacks: ["%locale%"] } 9 | secret: "%secret%" 10 | router: 11 | resource: "%kernel.root_dir%/config/routing.yml" 12 | strict_requirements: ~ 13 | form: ~ 14 | csrf_protection: ~ 15 | validation: { enable_annotations: true } 16 | templating: 17 | engines: ['twig'] 18 | #assets_version: SomeVersionScheme 19 | default_locale: "%locale%" 20 | trusted_hosts: ~ 21 | trusted_proxies: ~ 22 | session: 23 | # handler_id set to null will use default session handler from php.ini 24 | handler_id: ~ 25 | fragments: ~ 26 | http_method_override: true 27 | serializer: 28 | enabled: true 29 | 30 | # Twig Configuration 31 | twig: 32 | debug: "%kernel.debug%" 33 | strict_variables: "%kernel.debug%" 34 | 35 | # Assetic Configuration 36 | assetic: 37 | debug: "%kernel.debug%" 38 | use_controller: false 39 | bundles: [ ] 40 | #java: /usr/bin/java 41 | filters: 42 | cssrewrite: ~ 43 | #closure: 44 | # jar: "%kernel.root_dir%/Resources/java/compiler.jar" 45 | #yui_css: 46 | # jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar" 47 | 48 | # Doctrine Configuration 49 | doctrine: 50 | dbal: 51 | driver: "%database_driver%" 52 | host: "%database_host%" 53 | port: "%database_port%" 54 | dbname: "%database_name%" 55 | user: "%database_user%" 56 | password: "%database_password%" 57 | charset: UTF8 58 | # if using pdo_sqlite as your database driver: 59 | # 1. add the path in parameters.yml 60 | # e.g. database_path: "%kernel.root_dir%/data/data.db3" 61 | # 2. Uncomment database_path in parameters.yml.dist 62 | # 3. Uncomment next line: 63 | # path: "%database_path%" 64 | 65 | orm: 66 | auto_generate_proxy_classes: "%kernel.debug%" 67 | auto_mapping: true 68 | 69 | # Swiftmailer Configuration 70 | swiftmailer: 71 | transport: "%mailer_transport%" 72 | host: "%mailer_host%" 73 | username: "%mailer_user%" 74 | password: "%mailer_password%" 75 | spool: { type: memory } 76 | 77 | fos_rest: 78 | view: 79 | view_response_listener: 'force' 80 | formats: 81 | json: true 82 | format_listener: 83 | rules: 84 | - { path: ^/api, priorities: [ json ], fallback_format: json, prefer_extension: true } 85 | -------------------------------------------------------------------------------- /MyApplication/app/config/config_dev.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | framework: 5 | router: 6 | resource: "%kernel.root_dir%/config/routing_dev.yml" 7 | strict_requirements: true 8 | profiler: { only_exceptions: false } 9 | 10 | web_profiler: 11 | toolbar: true 12 | intercept_redirects: false 13 | 14 | monolog: 15 | handlers: 16 | main: 17 | type: stream 18 | path: "%kernel.logs_dir%/%kernel.environment%.log" 19 | level: debug 20 | console: 21 | type: console 22 | bubble: false 23 | verbosity_levels: 24 | VERBOSITY_VERBOSE: INFO 25 | VERBOSITY_VERY_VERBOSE: DEBUG 26 | channels: ["!doctrine"] 27 | console_very_verbose: 28 | type: console 29 | bubble: false 30 | verbosity_levels: 31 | VERBOSITY_VERBOSE: NOTICE 32 | VERBOSITY_VERY_VERBOSE: NOTICE 33 | VERBOSITY_DEBUG: DEBUG 34 | channels: ["doctrine"] 35 | # uncomment to get logging in your browser 36 | # you may have to allow bigger header sizes in your Web server configuration 37 | #firephp: 38 | # type: firephp 39 | # level: info 40 | #chromephp: 41 | # type: chromephp 42 | # level: info 43 | 44 | assetic: 45 | use_controller: true 46 | 47 | #swiftmailer: 48 | # delivery_address: me@example.com 49 | -------------------------------------------------------------------------------- /MyApplication/app/config/config_prod.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | #framework: 5 | # validation: 6 | # cache: apc 7 | 8 | #doctrine: 9 | # orm: 10 | # metadata_cache_driver: apc 11 | # result_cache_driver: apc 12 | # query_cache_driver: apc 13 | 14 | monolog: 15 | handlers: 16 | main: 17 | type: fingers_crossed 18 | action_level: error 19 | handler: nested 20 | nested: 21 | type: stream 22 | path: "%kernel.logs_dir%/%kernel.environment%.log" 23 | level: debug 24 | console: 25 | type: console 26 | -------------------------------------------------------------------------------- /MyApplication/app/config/config_test.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config_dev.yml } 3 | 4 | framework: 5 | test: ~ 6 | session: 7 | storage_id: session.storage.mock_file 8 | profiler: 9 | collect: false 10 | 11 | web_profiler: 12 | toolbar: false 13 | intercept_redirects: false 14 | 15 | swiftmailer: 16 | disable_delivery: true 17 | -------------------------------------------------------------------------------- /MyApplication/app/config/parameters.yml.dist: -------------------------------------------------------------------------------- 1 | # This file is a "template" of what your parameters.yml file should look like 2 | parameters: 3 | database_driver: pdo_pgsql 4 | database_host: 127.0.0.1 5 | database_port: ~ 6 | database_name: symfony 7 | database_user: root 8 | database_password: ~ 9 | # You should uncomment this if you want use pdo_sqlite 10 | # database_path: "%kernel.root_dir%/data.db3" 11 | 12 | mailer_transport: smtp 13 | mailer_host: 127.0.0.1 14 | mailer_user: ~ 15 | mailer_password: ~ 16 | 17 | locale: en 18 | 19 | # A secret key that's used to generate certain security-related tokens 20 | secret: ThisTokenIsNotSoSecretChangeIt 21 | -------------------------------------------------------------------------------- /MyApplication/app/config/routing.yml: -------------------------------------------------------------------------------- 1 | blog_api: 2 | type: rest 3 | prefix: /api 4 | resource: "@AppBundle/Resources/config/api-routing.yml" 5 | -------------------------------------------------------------------------------- /MyApplication/app/config/routing_dev.yml: -------------------------------------------------------------------------------- 1 | _wdt: 2 | resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml" 3 | prefix: /_wdt 4 | 5 | _profiler: 6 | resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml" 7 | prefix: /_profiler 8 | 9 | _configurator: 10 | resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml" 11 | prefix: /_configurator 12 | 13 | _errors: 14 | resource: "@TwigBundle/Resources/config/routing/errors.xml" 15 | prefix: /_error 16 | 17 | _main: 18 | resource: routing.yml 19 | 20 | # AcmeDemoBundle routes (to be removed) 21 | _acme_demo: 22 | resource: "@AcmeDemoBundle/Resources/config/routing.yml" -------------------------------------------------------------------------------- /MyApplication/app/config/security.yml: -------------------------------------------------------------------------------- 1 | # you can read more about security in the related section of the documentation 2 | # http://symfony.com/doc/current/book/security.html 3 | security: 4 | # http://symfony.com/doc/current/book/security.html#encoding-the-user-s-password 5 | encoders: 6 | Symfony\Component\Security\Core\User\User: plaintext 7 | 8 | # http://symfony.com/doc/current/book/security.html#hierarchical-roles 9 | role_hierarchy: 10 | ROLE_ADMIN: ROLE_USER 11 | ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] 12 | 13 | # http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers 14 | providers: 15 | in_memory: 16 | memory: 17 | users: 18 | user: { password: userpass, roles: [ 'ROLE_USER' ] } 19 | admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] } 20 | 21 | # the main part of the security, where you can set up firewalls 22 | # for specific sections of your app 23 | firewalls: 24 | # disables authentication for assets and the profiler, adapt it according to your needs 25 | dev: 26 | pattern: ^/(_(profiler|wdt)|css|images|js)/ 27 | security: false 28 | # the login page has to be accessible for everybody 29 | demo_login: 30 | pattern: ^/demo/secured/login$ 31 | security: false 32 | 33 | # secures part of the application 34 | demo_secured_area: 35 | pattern: ^/demo/secured/ 36 | # it's important to notice that in this case _demo_security_check and _demo_login 37 | # are route names and that they are specified in the AcmeDemoBundle 38 | form_login: 39 | check_path: _demo_security_check 40 | login_path: _demo_login 41 | logout: 42 | path: _demo_logout 43 | target: _demo 44 | #anonymous: ~ 45 | #http_basic: 46 | # realm: "Secured Demo Area" 47 | 48 | # with these settings you can restrict or allow access for different parts 49 | # of your application based on roles, ip, host or methods 50 | # http://symfony.com/doc/current/cookbook/security/access_control.html 51 | access_control: 52 | #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https } -------------------------------------------------------------------------------- /MyApplication/app/config/services.yml: -------------------------------------------------------------------------------- 1 | # Learn more about services, parameters and containers at 2 | # http://symfony.com/doc/current/book/service_container.html 3 | parameters: 4 | # parameter_name: value 5 | 6 | services: 7 | # service_name: 8 | # class: AppBundle\Directory\ClassName 9 | # arguments: ["@another_service_name", "plain_value", "%parameter_name%"] 10 | -------------------------------------------------------------------------------- /MyApplication/app/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev'); 19 | $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod'; 20 | 21 | if ($debug) { 22 | Debug::enable(); 23 | } 24 | 25 | $kernel = new AppKernel($env, $debug); 26 | $application = new Application($kernel); 27 | $application->run($input); 28 | -------------------------------------------------------------------------------- /MyApplication/app/logs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allan-simon/symfony2-rest-api-example/1a9fd0d26f9db1d88b5c1ea01d707147c0a49694/MyApplication/app/logs/.gitkeep -------------------------------------------------------------------------------- /MyApplication/app/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | ../src/*/*Bundle/Tests 13 | ../src/*/Bundle/*Bundle/Tests 14 | ../src/*Bundle/Tests 15 | 16 | 17 | 18 | 23 | 24 | 25 | 26 | ../src 27 | 28 | ../src/*Bundle/Resources 29 | ../src/*Bundle/Tests 30 | ../src/*/*Bundle/Resources 31 | ../src/*/*Bundle/Tests 32 | ../src/*/Bundle/*Bundle/Resources 33 | ../src/*/Bundle/*Bundle/Tests 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /MyApplication/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vagrant/my-application-install", 3 | "license": "proprietary", 4 | "type": "project", 5 | "autoload": { 6 | "psr-0": { 7 | "": "src/", 8 | "SymfonyStandard": "app/" 9 | } 10 | }, 11 | "require": { 12 | "php": ">=5.3.3", 13 | "symfony/symfony": "2.6.*", 14 | "doctrine/orm": "~2.2,>=2.2.3,<2.5", 15 | "doctrine/dbal": "<2.5", 16 | "doctrine/doctrine-bundle": "~1.2", 17 | "twig/extensions": "~1.0", 18 | "symfony/assetic-bundle": "~2.3", 19 | "symfony/swiftmailer-bundle": "~2.3", 20 | "symfony/monolog-bundle": "~2.4", 21 | "sensio/distribution-bundle": "~3.0,>=3.0.12", 22 | "sensio/framework-extra-bundle": "~3.0,>=3.0.2", 23 | "incenteev/composer-parameter-handler": "~2.0", 24 | "friendsofsymfony/rest-bundle": "^1.6", 25 | "doctrine/migrations": "1.0.*@dev", 26 | "doctrine/doctrine-migrations-bundle": "1.0.*", 27 | "jms/serializer-bundle": "^0.13.0" 28 | }, 29 | "require-dev": { 30 | "sensio/generator-bundle": "~2.3" 31 | }, 32 | "scripts": { 33 | "post-root-package-install": [ 34 | "SymfonyStandard\\Composer::hookRootPackageInstall" 35 | ], 36 | "post-install-cmd": [ 37 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 38 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 39 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 40 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 41 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 42 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles", 43 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 44 | ], 45 | "post-update-cmd": [ 46 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 47 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 48 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 49 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 50 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 51 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles", 52 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 53 | ] 54 | }, 55 | "config": { 56 | "bin-dir": "bin" 57 | }, 58 | "extra": { 59 | "symfony-app-dir": "app", 60 | "symfony-web-dir": "web", 61 | "symfony-assets-install": "relative", 62 | "incenteev-parameters": { 63 | "file": "app/config/parameters.yml" 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /MyApplication/composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "c30299299c98290faccadc598d8a76bb", 8 | "packages": [ 9 | { 10 | "name": "doctrine/annotations", 11 | "version": "v1.2.4", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/doctrine/annotations.git", 15 | "reference": "b5202eb9e83f8db52e0e58867e0a46e63be8332e" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/doctrine/annotations/zipball/b5202eb9e83f8db52e0e58867e0a46e63be8332e", 20 | "reference": "b5202eb9e83f8db52e0e58867e0a46e63be8332e", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "doctrine/lexer": "1.*", 25 | "php": ">=5.3.2" 26 | }, 27 | "require-dev": { 28 | "doctrine/cache": "1.*", 29 | "phpunit/phpunit": "4.*" 30 | }, 31 | "type": "library", 32 | "extra": { 33 | "branch-alias": { 34 | "dev-master": "1.3.x-dev" 35 | } 36 | }, 37 | "autoload": { 38 | "psr-0": { 39 | "Doctrine\\Common\\Annotations\\": "lib/" 40 | } 41 | }, 42 | "notification-url": "https://packagist.org/downloads/", 43 | "license": [ 44 | "MIT" 45 | ], 46 | "authors": [ 47 | { 48 | "name": "Roman Borschel", 49 | "email": "roman@code-factory.org" 50 | }, 51 | { 52 | "name": "Benjamin Eberlei", 53 | "email": "kontakt@beberlei.de" 54 | }, 55 | { 56 | "name": "Guilherme Blanco", 57 | "email": "guilhermeblanco@gmail.com" 58 | }, 59 | { 60 | "name": "Jonathan Wage", 61 | "email": "jonwage@gmail.com" 62 | }, 63 | { 64 | "name": "Johannes Schmitt", 65 | "email": "schmittjoh@gmail.com" 66 | } 67 | ], 68 | "description": "Docblock Annotations Parser", 69 | "homepage": "http://www.doctrine-project.org", 70 | "keywords": [ 71 | "annotations", 72 | "docblock", 73 | "parser" 74 | ], 75 | "time": "2014-12-23 22:40:37" 76 | }, 77 | { 78 | "name": "doctrine/cache", 79 | "version": "v1.4.1", 80 | "source": { 81 | "type": "git", 82 | "url": "https://github.com/doctrine/cache.git", 83 | "reference": "c9eadeb743ac6199f7eec423cb9426bc518b7b03" 84 | }, 85 | "dist": { 86 | "type": "zip", 87 | "url": "https://api.github.com/repos/doctrine/cache/zipball/c9eadeb743ac6199f7eec423cb9426bc518b7b03", 88 | "reference": "c9eadeb743ac6199f7eec423cb9426bc518b7b03", 89 | "shasum": "" 90 | }, 91 | "require": { 92 | "php": ">=5.3.2" 93 | }, 94 | "conflict": { 95 | "doctrine/common": ">2.2,<2.4" 96 | }, 97 | "require-dev": { 98 | "phpunit/phpunit": ">=3.7", 99 | "predis/predis": "~1.0", 100 | "satooshi/php-coveralls": "~0.6" 101 | }, 102 | "type": "library", 103 | "extra": { 104 | "branch-alias": { 105 | "dev-master": "1.5.x-dev" 106 | } 107 | }, 108 | "autoload": { 109 | "psr-0": { 110 | "Doctrine\\Common\\Cache\\": "lib/" 111 | } 112 | }, 113 | "notification-url": "https://packagist.org/downloads/", 114 | "license": [ 115 | "MIT" 116 | ], 117 | "authors": [ 118 | { 119 | "name": "Roman Borschel", 120 | "email": "roman@code-factory.org" 121 | }, 122 | { 123 | "name": "Benjamin Eberlei", 124 | "email": "kontakt@beberlei.de" 125 | }, 126 | { 127 | "name": "Guilherme Blanco", 128 | "email": "guilhermeblanco@gmail.com" 129 | }, 130 | { 131 | "name": "Jonathan Wage", 132 | "email": "jonwage@gmail.com" 133 | }, 134 | { 135 | "name": "Johannes Schmitt", 136 | "email": "schmittjoh@gmail.com" 137 | } 138 | ], 139 | "description": "Caching library offering an object-oriented API for many cache backends", 140 | "homepage": "http://www.doctrine-project.org", 141 | "keywords": [ 142 | "cache", 143 | "caching" 144 | ], 145 | "time": "2015-04-15 00:11:59" 146 | }, 147 | { 148 | "name": "doctrine/collections", 149 | "version": "v1.3.0", 150 | "source": { 151 | "type": "git", 152 | "url": "https://github.com/doctrine/collections.git", 153 | "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" 154 | }, 155 | "dist": { 156 | "type": "zip", 157 | "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", 158 | "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", 159 | "shasum": "" 160 | }, 161 | "require": { 162 | "php": ">=5.3.2" 163 | }, 164 | "require-dev": { 165 | "phpunit/phpunit": "~4.0" 166 | }, 167 | "type": "library", 168 | "extra": { 169 | "branch-alias": { 170 | "dev-master": "1.2.x-dev" 171 | } 172 | }, 173 | "autoload": { 174 | "psr-0": { 175 | "Doctrine\\Common\\Collections\\": "lib/" 176 | } 177 | }, 178 | "notification-url": "https://packagist.org/downloads/", 179 | "license": [ 180 | "MIT" 181 | ], 182 | "authors": [ 183 | { 184 | "name": "Roman Borschel", 185 | "email": "roman@code-factory.org" 186 | }, 187 | { 188 | "name": "Benjamin Eberlei", 189 | "email": "kontakt@beberlei.de" 190 | }, 191 | { 192 | "name": "Guilherme Blanco", 193 | "email": "guilhermeblanco@gmail.com" 194 | }, 195 | { 196 | "name": "Jonathan Wage", 197 | "email": "jonwage@gmail.com" 198 | }, 199 | { 200 | "name": "Johannes Schmitt", 201 | "email": "schmittjoh@gmail.com" 202 | } 203 | ], 204 | "description": "Collections Abstraction library", 205 | "homepage": "http://www.doctrine-project.org", 206 | "keywords": [ 207 | "array", 208 | "collections", 209 | "iterator" 210 | ], 211 | "time": "2015-04-14 22:21:58" 212 | }, 213 | { 214 | "name": "doctrine/common", 215 | "version": "v2.5.0", 216 | "source": { 217 | "type": "git", 218 | "url": "https://github.com/doctrine/common.git", 219 | "reference": "cd8daf2501e10c63dced7b8b9b905844316ae9d3" 220 | }, 221 | "dist": { 222 | "type": "zip", 223 | "url": "https://api.github.com/repos/doctrine/common/zipball/cd8daf2501e10c63dced7b8b9b905844316ae9d3", 224 | "reference": "cd8daf2501e10c63dced7b8b9b905844316ae9d3", 225 | "shasum": "" 226 | }, 227 | "require": { 228 | "doctrine/annotations": "1.*", 229 | "doctrine/cache": "1.*", 230 | "doctrine/collections": "1.*", 231 | "doctrine/inflector": "1.*", 232 | "doctrine/lexer": "1.*", 233 | "php": ">=5.3.2" 234 | }, 235 | "require-dev": { 236 | "phpunit/phpunit": "~3.7" 237 | }, 238 | "type": "library", 239 | "extra": { 240 | "branch-alias": { 241 | "dev-master": "2.6.x-dev" 242 | } 243 | }, 244 | "autoload": { 245 | "psr-0": { 246 | "Doctrine\\Common\\": "lib/" 247 | } 248 | }, 249 | "notification-url": "https://packagist.org/downloads/", 250 | "license": [ 251 | "MIT" 252 | ], 253 | "authors": [ 254 | { 255 | "name": "Roman Borschel", 256 | "email": "roman@code-factory.org" 257 | }, 258 | { 259 | "name": "Benjamin Eberlei", 260 | "email": "kontakt@beberlei.de" 261 | }, 262 | { 263 | "name": "Guilherme Blanco", 264 | "email": "guilhermeblanco@gmail.com" 265 | }, 266 | { 267 | "name": "Jonathan Wage", 268 | "email": "jonwage@gmail.com" 269 | }, 270 | { 271 | "name": "Johannes Schmitt", 272 | "email": "schmittjoh@gmail.com" 273 | } 274 | ], 275 | "description": "Common Library for Doctrine projects", 276 | "homepage": "http://www.doctrine-project.org", 277 | "keywords": [ 278 | "annotations", 279 | "collections", 280 | "eventmanager", 281 | "persistence", 282 | "spl" 283 | ], 284 | "time": "2015-04-02 19:55:44" 285 | }, 286 | { 287 | "name": "doctrine/dbal", 288 | "version": "v2.4.4", 289 | "source": { 290 | "type": "git", 291 | "url": "https://github.com/doctrine/dbal.git", 292 | "reference": "a370e5b95e509a7809d11f3d280acfc9310d464b" 293 | }, 294 | "dist": { 295 | "type": "zip", 296 | "url": "https://api.github.com/repos/doctrine/dbal/zipball/a370e5b95e509a7809d11f3d280acfc9310d464b", 297 | "reference": "a370e5b95e509a7809d11f3d280acfc9310d464b", 298 | "shasum": "" 299 | }, 300 | "require": { 301 | "doctrine/common": "~2.4", 302 | "php": ">=5.3.2" 303 | }, 304 | "require-dev": { 305 | "phpunit/phpunit": "3.7.*", 306 | "symfony/console": "~2.0" 307 | }, 308 | "suggest": { 309 | "symfony/console": "For helpful console commands such as SQL execution and import of files." 310 | }, 311 | "type": "library", 312 | "autoload": { 313 | "psr-0": { 314 | "Doctrine\\DBAL\\": "lib/" 315 | } 316 | }, 317 | "notification-url": "https://packagist.org/downloads/", 318 | "license": [ 319 | "MIT" 320 | ], 321 | "authors": [ 322 | { 323 | "name": "Roman Borschel", 324 | "email": "roman@code-factory.org" 325 | }, 326 | { 327 | "name": "Benjamin Eberlei", 328 | "email": "kontakt@beberlei.de" 329 | }, 330 | { 331 | "name": "Guilherme Blanco", 332 | "email": "guilhermeblanco@gmail.com" 333 | }, 334 | { 335 | "name": "Jonathan Wage", 336 | "email": "jonwage@gmail.com" 337 | } 338 | ], 339 | "description": "Database Abstraction Layer", 340 | "homepage": "http://www.doctrine-project.org", 341 | "keywords": [ 342 | "database", 343 | "dbal", 344 | "persistence", 345 | "queryobject" 346 | ], 347 | "time": "2015-01-12 21:57:01" 348 | }, 349 | { 350 | "name": "doctrine/doctrine-bundle", 351 | "version": "v1.4.0", 352 | "source": { 353 | "type": "git", 354 | "url": "https://github.com/doctrine/DoctrineBundle.git", 355 | "reference": "1986ff3a945b584c6505d07eae92d77e41131078" 356 | }, 357 | "dist": { 358 | "type": "zip", 359 | "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/1986ff3a945b584c6505d07eae92d77e41131078", 360 | "reference": "1986ff3a945b584c6505d07eae92d77e41131078", 361 | "shasum": "" 362 | }, 363 | "require": { 364 | "doctrine/dbal": "~2.3", 365 | "doctrine/doctrine-cache-bundle": "~1.0", 366 | "jdorn/sql-formatter": "~1.1", 367 | "php": ">=5.3.2", 368 | "symfony/doctrine-bridge": "~2.2", 369 | "symfony/framework-bundle": "~2.3" 370 | }, 371 | "require-dev": { 372 | "doctrine/orm": "~2.3", 373 | "phpunit/phpunit": "~4", 374 | "satooshi/php-coveralls": "~0.6.1", 375 | "symfony/validator": "~2.2", 376 | "symfony/yaml": "~2.2", 377 | "twig/twig": "~1.10" 378 | }, 379 | "suggest": { 380 | "doctrine/orm": "The Doctrine ORM integration is optional in the bundle.", 381 | "symfony/web-profiler-bundle": "to use the data collector" 382 | }, 383 | "type": "symfony-bundle", 384 | "extra": { 385 | "branch-alias": { 386 | "dev-master": "1.4.x-dev" 387 | } 388 | }, 389 | "autoload": { 390 | "psr-4": { 391 | "Doctrine\\Bundle\\DoctrineBundle\\": "" 392 | } 393 | }, 394 | "notification-url": "https://packagist.org/downloads/", 395 | "license": [ 396 | "MIT" 397 | ], 398 | "authors": [ 399 | { 400 | "name": "Symfony Community", 401 | "homepage": "http://symfony.com/contributors" 402 | }, 403 | { 404 | "name": "Benjamin Eberlei", 405 | "email": "kontakt@beberlei.de" 406 | }, 407 | { 408 | "name": "Doctrine Project", 409 | "homepage": "http://www.doctrine-project.org/" 410 | }, 411 | { 412 | "name": "Fabien Potencier", 413 | "email": "fabien@symfony.com" 414 | } 415 | ], 416 | "description": "Symfony DoctrineBundle", 417 | "homepage": "http://www.doctrine-project.org", 418 | "keywords": [ 419 | "database", 420 | "dbal", 421 | "orm", 422 | "persistence" 423 | ], 424 | "time": "2015-02-28 11:04:45" 425 | }, 426 | { 427 | "name": "doctrine/doctrine-cache-bundle", 428 | "version": "v1.0.1", 429 | "target-dir": "Doctrine/Bundle/DoctrineCacheBundle", 430 | "source": { 431 | "type": "git", 432 | "url": "https://github.com/doctrine/DoctrineCacheBundle.git", 433 | "reference": "e4b6f810aa047f9cbfe41c3d6a3d7e83d7477a9d" 434 | }, 435 | "dist": { 436 | "type": "zip", 437 | "url": "https://api.github.com/repos/doctrine/DoctrineCacheBundle/zipball/e4b6f810aa047f9cbfe41c3d6a3d7e83d7477a9d", 438 | "reference": "e4b6f810aa047f9cbfe41c3d6a3d7e83d7477a9d", 439 | "shasum": "" 440 | }, 441 | "require": { 442 | "doctrine/cache": "~1.3", 443 | "doctrine/inflector": "~1.0", 444 | "php": ">=5.3.2", 445 | "symfony/doctrine-bridge": "~2.2", 446 | "symfony/framework-bundle": "~2.2", 447 | "symfony/security": "~2.2" 448 | }, 449 | "require-dev": { 450 | "instaclick/coding-standard": "~1.1", 451 | "instaclick/object-calisthenics-sniffs": "dev-master", 452 | "instaclick/symfony2-coding-standard": "dev-remaster", 453 | "phpunit/phpunit": "~3.7", 454 | "satooshi/php-coveralls": "~0.6.1", 455 | "squizlabs/php_codesniffer": "dev-master", 456 | "symfony/console": "~2.2", 457 | "symfony/finder": "~2.2", 458 | "symfony/validator": "~2.2", 459 | "symfony/yaml": "~2.2" 460 | }, 461 | "type": "symfony-bundle", 462 | "extra": { 463 | "branch-alias": { 464 | "dev-master": "1.0.x-dev" 465 | } 466 | }, 467 | "autoload": { 468 | "psr-0": { 469 | "Doctrine\\Bundle\\DoctrineCacheBundle": "" 470 | } 471 | }, 472 | "notification-url": "https://packagist.org/downloads/", 473 | "license": [ 474 | "MIT" 475 | ], 476 | "authors": [ 477 | { 478 | "name": "Symfony Community", 479 | "homepage": "http://symfony.com/contributors" 480 | }, 481 | { 482 | "name": "Benjamin Eberlei", 483 | "email": "kontakt@beberlei.de" 484 | }, 485 | { 486 | "name": "Fabio B. Silva", 487 | "email": "fabio.bat.silva@gmail.com" 488 | }, 489 | { 490 | "name": "Guilherme Blanco", 491 | "email": "guilhermeblanco@hotmail.com" 492 | }, 493 | { 494 | "name": "Doctrine Project", 495 | "homepage": "http://www.doctrine-project.org/" 496 | }, 497 | { 498 | "name": "Fabien Potencier", 499 | "email": "fabien@symfony.com" 500 | } 501 | ], 502 | "description": "Symfony2 Bundle for Doctrine Cache", 503 | "homepage": "http://www.doctrine-project.org", 504 | "keywords": [ 505 | "cache", 506 | "caching" 507 | ], 508 | "time": "2014-11-28 09:43:36" 509 | }, 510 | { 511 | "name": "doctrine/doctrine-migrations-bundle", 512 | "version": "1.0.0", 513 | "target-dir": "Doctrine/Bundle/MigrationsBundle", 514 | "source": { 515 | "type": "git", 516 | "url": "https://github.com/doctrine/DoctrineMigrationsBundle.git", 517 | "reference": "81575a4316951125ce408c70f30547c77d98f78a" 518 | }, 519 | "dist": { 520 | "type": "zip", 521 | "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/81575a4316951125ce408c70f30547c77d98f78a", 522 | "reference": "81575a4316951125ce408c70f30547c77d98f78a", 523 | "shasum": "" 524 | }, 525 | "require": { 526 | "doctrine/doctrine-bundle": "~1.0", 527 | "doctrine/migrations": "~1.0@dev", 528 | "php": ">=5.3.2", 529 | "symfony/framework-bundle": "~2.1" 530 | }, 531 | "type": "symfony-bundle", 532 | "extra": { 533 | "branch-alias": { 534 | "dev-master": "2.1.x-dev" 535 | } 536 | }, 537 | "autoload": { 538 | "psr-0": { 539 | "Doctrine\\Bundle\\MigrationsBundle": "" 540 | } 541 | }, 542 | "notification-url": "https://packagist.org/downloads/", 543 | "license": [ 544 | "MIT" 545 | ], 546 | "authors": [ 547 | { 548 | "name": "Symfony Community", 549 | "homepage": "http://symfony.com/contributors" 550 | }, 551 | { 552 | "name": "Doctrine Project", 553 | "homepage": "http://www.doctrine-project.org" 554 | }, 555 | { 556 | "name": "Fabien Potencier", 557 | "email": "fabien@symfony.com" 558 | } 559 | ], 560 | "description": "Symfony DoctrineMigrationsBundle", 561 | "homepage": "http://www.doctrine-project.org", 562 | "keywords": [ 563 | "dbal", 564 | "migrations", 565 | "schema" 566 | ], 567 | "time": "2014-08-17 07:53:47" 568 | }, 569 | { 570 | "name": "doctrine/inflector", 571 | "version": "v1.0.1", 572 | "source": { 573 | "type": "git", 574 | "url": "https://github.com/doctrine/inflector.git", 575 | "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604" 576 | }, 577 | "dist": { 578 | "type": "zip", 579 | "url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604", 580 | "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604", 581 | "shasum": "" 582 | }, 583 | "require": { 584 | "php": ">=5.3.2" 585 | }, 586 | "require-dev": { 587 | "phpunit/phpunit": "4.*" 588 | }, 589 | "type": "library", 590 | "extra": { 591 | "branch-alias": { 592 | "dev-master": "1.0.x-dev" 593 | } 594 | }, 595 | "autoload": { 596 | "psr-0": { 597 | "Doctrine\\Common\\Inflector\\": "lib/" 598 | } 599 | }, 600 | "notification-url": "https://packagist.org/downloads/", 601 | "license": [ 602 | "MIT" 603 | ], 604 | "authors": [ 605 | { 606 | "name": "Roman Borschel", 607 | "email": "roman@code-factory.org" 608 | }, 609 | { 610 | "name": "Benjamin Eberlei", 611 | "email": "kontakt@beberlei.de" 612 | }, 613 | { 614 | "name": "Guilherme Blanco", 615 | "email": "guilhermeblanco@gmail.com" 616 | }, 617 | { 618 | "name": "Jonathan Wage", 619 | "email": "jonwage@gmail.com" 620 | }, 621 | { 622 | "name": "Johannes Schmitt", 623 | "email": "schmittjoh@gmail.com" 624 | } 625 | ], 626 | "description": "Common String Manipulations with regard to casing and singular/plural rules.", 627 | "homepage": "http://www.doctrine-project.org", 628 | "keywords": [ 629 | "inflection", 630 | "pluralize", 631 | "singularize", 632 | "string" 633 | ], 634 | "time": "2014-12-20 21:24:13" 635 | }, 636 | { 637 | "name": "doctrine/lexer", 638 | "version": "v1.0.1", 639 | "source": { 640 | "type": "git", 641 | "url": "https://github.com/doctrine/lexer.git", 642 | "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" 643 | }, 644 | "dist": { 645 | "type": "zip", 646 | "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", 647 | "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", 648 | "shasum": "" 649 | }, 650 | "require": { 651 | "php": ">=5.3.2" 652 | }, 653 | "type": "library", 654 | "extra": { 655 | "branch-alias": { 656 | "dev-master": "1.0.x-dev" 657 | } 658 | }, 659 | "autoload": { 660 | "psr-0": { 661 | "Doctrine\\Common\\Lexer\\": "lib/" 662 | } 663 | }, 664 | "notification-url": "https://packagist.org/downloads/", 665 | "license": [ 666 | "MIT" 667 | ], 668 | "authors": [ 669 | { 670 | "name": "Roman Borschel", 671 | "email": "roman@code-factory.org" 672 | }, 673 | { 674 | "name": "Guilherme Blanco", 675 | "email": "guilhermeblanco@gmail.com" 676 | }, 677 | { 678 | "name": "Johannes Schmitt", 679 | "email": "schmittjoh@gmail.com" 680 | } 681 | ], 682 | "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", 683 | "homepage": "http://www.doctrine-project.org", 684 | "keywords": [ 685 | "lexer", 686 | "parser" 687 | ], 688 | "time": "2014-09-09 13:34:57" 689 | }, 690 | { 691 | "name": "doctrine/migrations", 692 | "version": "dev-master", 693 | "source": { 694 | "type": "git", 695 | "url": "https://github.com/doctrine/migrations.git", 696 | "reference": "a4f14d3a3d397104e557ec65d1a4e43bb86e4ddf" 697 | }, 698 | "dist": { 699 | "type": "zip", 700 | "url": "https://api.github.com/repos/doctrine/migrations/zipball/a4f14d3a3d397104e557ec65d1a4e43bb86e4ddf", 701 | "reference": "a4f14d3a3d397104e557ec65d1a4e43bb86e4ddf", 702 | "shasum": "" 703 | }, 704 | "require": { 705 | "doctrine/dbal": "~2.0", 706 | "php": ">=5.3.2" 707 | }, 708 | "require-dev": { 709 | "doctrine/orm": "2.*", 710 | "phpunit/phpunit": "~4.0", 711 | "symfony/console": "2.*", 712 | "symfony/yaml": "2.*" 713 | }, 714 | "suggest": { 715 | "symfony/console": "to run the migration from the console" 716 | }, 717 | "type": "library", 718 | "extra": { 719 | "branch-alias": { 720 | "dev-master": "1.0.x-dev" 721 | } 722 | }, 723 | "autoload": { 724 | "psr-0": { 725 | "Doctrine\\DBAL\\Migrations": "lib" 726 | } 727 | }, 728 | "notification-url": "https://packagist.org/downloads/", 729 | "license": [ 730 | "LGPL-2.1" 731 | ], 732 | "authors": [ 733 | { 734 | "name": "Benjamin Eberlei", 735 | "email": "kontakt@beberlei.de" 736 | }, 737 | { 738 | "name": "Jonathan Wage", 739 | "email": "jonwage@gmail.com" 740 | } 741 | ], 742 | "description": "Database Schema migrations using Doctrine DBAL", 743 | "homepage": "http://www.doctrine-project.org", 744 | "keywords": [ 745 | "database", 746 | "migrations" 747 | ], 748 | "time": "2015-05-02 06:20:23" 749 | }, 750 | { 751 | "name": "doctrine/orm", 752 | "version": "v2.4.7", 753 | "source": { 754 | "type": "git", 755 | "url": "https://github.com/doctrine/doctrine2.git", 756 | "reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68" 757 | }, 758 | "dist": { 759 | "type": "zip", 760 | "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68", 761 | "reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68", 762 | "shasum": "" 763 | }, 764 | "require": { 765 | "doctrine/collections": "~1.1", 766 | "doctrine/dbal": "~2.4", 767 | "ext-pdo": "*", 768 | "php": ">=5.3.2", 769 | "symfony/console": "~2.0" 770 | }, 771 | "require-dev": { 772 | "satooshi/php-coveralls": "dev-master", 773 | "symfony/yaml": "~2.1" 774 | }, 775 | "suggest": { 776 | "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" 777 | }, 778 | "bin": [ 779 | "bin/doctrine", 780 | "bin/doctrine.php" 781 | ], 782 | "type": "library", 783 | "extra": { 784 | "branch-alias": { 785 | "dev-master": "2.4.x-dev" 786 | } 787 | }, 788 | "autoload": { 789 | "psr-0": { 790 | "Doctrine\\ORM\\": "lib/" 791 | } 792 | }, 793 | "notification-url": "https://packagist.org/downloads/", 794 | "license": [ 795 | "MIT" 796 | ], 797 | "authors": [ 798 | { 799 | "name": "Roman Borschel", 800 | "email": "roman@code-factory.org" 801 | }, 802 | { 803 | "name": "Benjamin Eberlei", 804 | "email": "kontakt@beberlei.de" 805 | }, 806 | { 807 | "name": "Guilherme Blanco", 808 | "email": "guilhermeblanco@gmail.com" 809 | }, 810 | { 811 | "name": "Jonathan Wage", 812 | "email": "jonwage@gmail.com" 813 | } 814 | ], 815 | "description": "Object-Relational-Mapper for PHP", 816 | "homepage": "http://www.doctrine-project.org", 817 | "keywords": [ 818 | "database", 819 | "orm" 820 | ], 821 | "time": "2014-12-16 13:45:01" 822 | }, 823 | { 824 | "name": "friendsofsymfony/rest-bundle", 825 | "version": "1.6.0", 826 | "target-dir": "FOS/RestBundle", 827 | "source": { 828 | "type": "git", 829 | "url": "https://github.com/FriendsOfSymfony/FOSRestBundle.git", 830 | "reference": "832d08199cadf1770ec43c2cba68b42b4d5e7f9f" 831 | }, 832 | "dist": { 833 | "type": "zip", 834 | "url": "https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/zipball/832d08199cadf1770ec43c2cba68b42b4d5e7f9f", 835 | "reference": "832d08199cadf1770ec43c2cba68b42b4d5e7f9f", 836 | "shasum": "" 837 | }, 838 | "require": { 839 | "doctrine/inflector": "~1.0", 840 | "php": ">=5.3.9", 841 | "psr/log": "~1.0", 842 | "symfony/framework-bundle": "~2.3", 843 | "symfony/http-kernel": "~2.3,>=2.3.24", 844 | "willdurand/jsonp-callback-validator": "~1.0", 845 | "willdurand/negotiation": "~1.2" 846 | }, 847 | "conflict": { 848 | "jms/serializer": "<0.12", 849 | "jms/serializer-bundle": "<0.11", 850 | "symfony/validator": ">=2.5.0,<2.5.5" 851 | }, 852 | "require-dev": { 853 | "jms/serializer": "~0.13", 854 | "jms/serializer-bundle": "~0.12", 855 | "phpoption/phpoption": "~1.1.0", 856 | "sensio/framework-extra-bundle": "~3.0", 857 | "symfony/browser-kit": "~2.3", 858 | "symfony/dependency-injection": "~2.3", 859 | "symfony/form": "~2.3", 860 | "symfony/security": "~2.3", 861 | "symfony/serializer": "~2.3", 862 | "symfony/validator": "~2.3", 863 | "symfony/yaml": "~2.3" 864 | }, 865 | "suggest": { 866 | "jms/serializer-bundle": "Add support for advanced serialization capabilities, recommended, requires ~0.12", 867 | "sensio/framework-extra-bundle": "Add support for route annotations and the view response listener, requires ~3.0", 868 | "symfony/serializer": "Add support for basic serialization capabilities and xml decoding, requires ~2.3", 869 | "symfony/validator": "Add support for validation capabilities in the ParamFetcher, requires ~2.3" 870 | }, 871 | "type": "symfony-bundle", 872 | "extra": { 873 | "branch-alias": { 874 | "dev-master": "1.6-dev" 875 | } 876 | }, 877 | "autoload": { 878 | "psr-0": { 879 | "FOS\\RestBundle": "" 880 | } 881 | }, 882 | "notification-url": "https://packagist.org/downloads/", 883 | "license": [ 884 | "MIT" 885 | ], 886 | "authors": [ 887 | { 888 | "name": "Lukas Kahwe Smith", 889 | "email": "smith@pooteeweet.org" 890 | }, 891 | { 892 | "name": "FriendsOfSymfony Community", 893 | "homepage": "https://github.com/friendsofsymfony/FOSRestBundle/contributors" 894 | }, 895 | { 896 | "name": "Konstantin Kudryashov", 897 | "email": "ever.zet@gmail.com" 898 | } 899 | ], 900 | "description": "This Bundle provides various tools to rapidly develop RESTful API's with Symfony2", 901 | "homepage": "http://friendsofsymfony.github.com", 902 | "keywords": [ 903 | "rest" 904 | ], 905 | "time": "2015-05-22 20:17:35" 906 | }, 907 | { 908 | "name": "incenteev/composer-parameter-handler", 909 | "version": "v2.1.0", 910 | "target-dir": "Incenteev/ParameterHandler", 911 | "source": { 912 | "type": "git", 913 | "url": "https://github.com/Incenteev/ParameterHandler.git", 914 | "reference": "143272a0a09c62616a3c8011fc165a10c6b35241" 915 | }, 916 | "dist": { 917 | "type": "zip", 918 | "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/143272a0a09c62616a3c8011fc165a10c6b35241", 919 | "reference": "143272a0a09c62616a3c8011fc165a10c6b35241", 920 | "shasum": "" 921 | }, 922 | "require": { 923 | "php": ">=5.3.3", 924 | "symfony/yaml": "~2.0" 925 | }, 926 | "require-dev": { 927 | "composer/composer": "1.0.*@dev", 928 | "phpspec/prophecy-phpunit": "~1.0", 929 | "symfony/filesystem": "~2.2" 930 | }, 931 | "type": "library", 932 | "extra": { 933 | "branch-alias": { 934 | "dev-master": "2.1.x-dev" 935 | } 936 | }, 937 | "autoload": { 938 | "psr-0": { 939 | "Incenteev\\ParameterHandler": "" 940 | } 941 | }, 942 | "notification-url": "https://packagist.org/downloads/", 943 | "license": [ 944 | "MIT" 945 | ], 946 | "authors": [ 947 | { 948 | "name": "Christophe Coevoet", 949 | "email": "stof@notk.org" 950 | } 951 | ], 952 | "description": "Composer script handling your ignored parameter file", 953 | "homepage": "https://github.com/Incenteev/ParameterHandler", 954 | "keywords": [ 955 | "parameters management" 956 | ], 957 | "time": "2013-12-07 10:10:39" 958 | }, 959 | { 960 | "name": "jdorn/sql-formatter", 961 | "version": "v1.2.17", 962 | "source": { 963 | "type": "git", 964 | "url": "https://github.com/jdorn/sql-formatter.git", 965 | "reference": "64990d96e0959dff8e059dfcdc1af130728d92bc" 966 | }, 967 | "dist": { 968 | "type": "zip", 969 | "url": "https://api.github.com/repos/jdorn/sql-formatter/zipball/64990d96e0959dff8e059dfcdc1af130728d92bc", 970 | "reference": "64990d96e0959dff8e059dfcdc1af130728d92bc", 971 | "shasum": "" 972 | }, 973 | "require": { 974 | "php": ">=5.2.4" 975 | }, 976 | "require-dev": { 977 | "phpunit/phpunit": "3.7.*" 978 | }, 979 | "type": "library", 980 | "extra": { 981 | "branch-alias": { 982 | "dev-master": "1.3.x-dev" 983 | } 984 | }, 985 | "autoload": { 986 | "classmap": [ 987 | "lib" 988 | ] 989 | }, 990 | "notification-url": "https://packagist.org/downloads/", 991 | "license": [ 992 | "MIT" 993 | ], 994 | "authors": [ 995 | { 996 | "name": "Jeremy Dorn", 997 | "email": "jeremy@jeremydorn.com", 998 | "homepage": "http://jeremydorn.com/" 999 | } 1000 | ], 1001 | "description": "a PHP SQL highlighting library", 1002 | "homepage": "https://github.com/jdorn/sql-formatter/", 1003 | "keywords": [ 1004 | "highlight", 1005 | "sql" 1006 | ], 1007 | "time": "2014-01-12 16:20:24" 1008 | }, 1009 | { 1010 | "name": "jms/metadata", 1011 | "version": "1.5.1", 1012 | "source": { 1013 | "type": "git", 1014 | "url": "https://github.com/schmittjoh/metadata.git", 1015 | "reference": "22b72455559a25777cfd28c4ffda81ff7639f353" 1016 | }, 1017 | "dist": { 1018 | "type": "zip", 1019 | "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/22b72455559a25777cfd28c4ffda81ff7639f353", 1020 | "reference": "22b72455559a25777cfd28c4ffda81ff7639f353", 1021 | "shasum": "" 1022 | }, 1023 | "require": { 1024 | "php": ">=5.3.0" 1025 | }, 1026 | "require-dev": { 1027 | "doctrine/cache": "~1.0" 1028 | }, 1029 | "type": "library", 1030 | "extra": { 1031 | "branch-alias": { 1032 | "dev-master": "1.5.x-dev" 1033 | } 1034 | }, 1035 | "autoload": { 1036 | "psr-0": { 1037 | "Metadata\\": "src/" 1038 | } 1039 | }, 1040 | "notification-url": "https://packagist.org/downloads/", 1041 | "license": [ 1042 | "Apache" 1043 | ], 1044 | "authors": [ 1045 | { 1046 | "name": "Johannes Schmitt", 1047 | "email": "schmittjoh@gmail.com", 1048 | "homepage": "https://github.com/schmittjoh", 1049 | "role": "Developer of wrapped JMSSerializerBundle" 1050 | } 1051 | ], 1052 | "description": "Class/method/property metadata management in PHP", 1053 | "keywords": [ 1054 | "annotations", 1055 | "metadata", 1056 | "xml", 1057 | "yaml" 1058 | ], 1059 | "time": "2014-07-12 07:13:19" 1060 | }, 1061 | { 1062 | "name": "jms/parser-lib", 1063 | "version": "1.0.0", 1064 | "source": { 1065 | "type": "git", 1066 | "url": "https://github.com/schmittjoh/parser-lib.git", 1067 | "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" 1068 | }, 1069 | "dist": { 1070 | "type": "zip", 1071 | "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", 1072 | "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", 1073 | "shasum": "" 1074 | }, 1075 | "require": { 1076 | "phpoption/phpoption": ">=0.9,<2.0-dev" 1077 | }, 1078 | "type": "library", 1079 | "extra": { 1080 | "branch-alias": { 1081 | "dev-master": "1.0-dev" 1082 | } 1083 | }, 1084 | "autoload": { 1085 | "psr-0": { 1086 | "JMS\\": "src/" 1087 | } 1088 | }, 1089 | "notification-url": "https://packagist.org/downloads/", 1090 | "license": [ 1091 | "Apache2" 1092 | ], 1093 | "description": "A library for easily creating recursive-descent parsers.", 1094 | "time": "2012-11-18 18:08:43" 1095 | }, 1096 | { 1097 | "name": "jms/serializer", 1098 | "version": "0.16.0", 1099 | "source": { 1100 | "type": "git", 1101 | "url": "https://github.com/schmittjoh/serializer.git", 1102 | "reference": "c8a171357ca92b6706e395c757f334902d430ea9" 1103 | }, 1104 | "dist": { 1105 | "type": "zip", 1106 | "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/c8a171357ca92b6706e395c757f334902d430ea9", 1107 | "reference": "c8a171357ca92b6706e395c757f334902d430ea9", 1108 | "shasum": "" 1109 | }, 1110 | "require": { 1111 | "doctrine/annotations": "1.*", 1112 | "jms/metadata": "~1.1", 1113 | "jms/parser-lib": "1.*", 1114 | "php": ">=5.3.2", 1115 | "phpcollection/phpcollection": "~0.1" 1116 | }, 1117 | "require-dev": { 1118 | "doctrine/orm": "~2.1", 1119 | "doctrine/phpcr-odm": "~1.0.1", 1120 | "jackalope/jackalope-doctrine-dbal": "1.0.*", 1121 | "propel/propel1": "~1.7", 1122 | "symfony/filesystem": "2.*", 1123 | "symfony/form": "~2.1", 1124 | "symfony/translation": "~2.0", 1125 | "symfony/validator": "~2.0", 1126 | "symfony/yaml": "2.*", 1127 | "twig/twig": ">=1.8,<2.0-dev" 1128 | }, 1129 | "suggest": { 1130 | "symfony/yaml": "Required if you'd like to serialize data to YAML format." 1131 | }, 1132 | "type": "library", 1133 | "extra": { 1134 | "branch-alias": { 1135 | "dev-master": "0.15-dev" 1136 | } 1137 | }, 1138 | "autoload": { 1139 | "psr-0": { 1140 | "JMS\\Serializer": "src/" 1141 | } 1142 | }, 1143 | "notification-url": "https://packagist.org/downloads/", 1144 | "license": [ 1145 | "Apache2" 1146 | ], 1147 | "authors": [ 1148 | { 1149 | "name": "Johannes Schmitt", 1150 | "email": "schmittjoh@gmail.com", 1151 | "homepage": "https://github.com/schmittjoh", 1152 | "role": "Developer of wrapped JMSSerializerBundle" 1153 | } 1154 | ], 1155 | "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", 1156 | "homepage": "http://jmsyst.com/libs/serializer", 1157 | "keywords": [ 1158 | "deserialization", 1159 | "jaxb", 1160 | "json", 1161 | "serialization", 1162 | "xml" 1163 | ], 1164 | "time": "2014-03-18 08:39:00" 1165 | }, 1166 | { 1167 | "name": "jms/serializer-bundle", 1168 | "version": "0.13.0", 1169 | "target-dir": "JMS/SerializerBundle", 1170 | "source": { 1171 | "type": "git", 1172 | "url": "https://github.com/schmittjoh/JMSSerializerBundle.git", 1173 | "reference": "bb15db3e661168f4310fad48b86915ff1ca33795" 1174 | }, 1175 | "dist": { 1176 | "type": "zip", 1177 | "url": "https://api.github.com/repos/schmittjoh/JMSSerializerBundle/zipball/bb15db3e661168f4310fad48b86915ff1ca33795", 1178 | "reference": "bb15db3e661168f4310fad48b86915ff1ca33795", 1179 | "shasum": "" 1180 | }, 1181 | "require": { 1182 | "jms/serializer": "~0.11", 1183 | "php": ">=5.3.2", 1184 | "symfony/framework-bundle": "~2.1" 1185 | }, 1186 | "require-dev": { 1187 | "doctrine/doctrine-bundle": "*", 1188 | "doctrine/orm": "*", 1189 | "symfony/browser-kit": "*", 1190 | "symfony/class-loader": "*", 1191 | "symfony/css-selector": "*", 1192 | "symfony/finder": "*", 1193 | "symfony/form": "*", 1194 | "symfony/process": "*", 1195 | "symfony/twig-bundle": "*", 1196 | "symfony/validator": "*", 1197 | "symfony/yaml": "*" 1198 | }, 1199 | "suggest": { 1200 | "jms/di-extra-bundle": "Required to get lazy loading (de)serialization visitors, ~1.3" 1201 | }, 1202 | "type": "symfony-bundle", 1203 | "extra": { 1204 | "branch-alias": { 1205 | "dev-master": "0.13-dev" 1206 | } 1207 | }, 1208 | "autoload": { 1209 | "psr-0": { 1210 | "JMS\\SerializerBundle": "" 1211 | } 1212 | }, 1213 | "notification-url": "https://packagist.org/downloads/", 1214 | "license": [ 1215 | "Apache2" 1216 | ], 1217 | "authors": [ 1218 | { 1219 | "name": "Johannes Schmitt", 1220 | "email": "schmittjoh@gmail.com", 1221 | "homepage": "https://github.com/schmittjoh", 1222 | "role": "Developer of wrapped JMSSerializerBundle" 1223 | } 1224 | ], 1225 | "description": "Allows you to easily serialize, and deserialize data of any complexity", 1226 | "homepage": "http://jmsyst.com/bundles/JMSSerializerBundle", 1227 | "keywords": [ 1228 | "deserialization", 1229 | "jaxb", 1230 | "json", 1231 | "serialization", 1232 | "xml" 1233 | ], 1234 | "time": "2013-12-05 14:36:11" 1235 | }, 1236 | { 1237 | "name": "kriswallsmith/assetic", 1238 | "version": "v1.2.1", 1239 | "source": { 1240 | "type": "git", 1241 | "url": "https://github.com/kriswallsmith/assetic.git", 1242 | "reference": "b20efe38845d20458702f97f3ff625d80805897b" 1243 | }, 1244 | "dist": { 1245 | "type": "zip", 1246 | "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/b20efe38845d20458702f97f3ff625d80805897b", 1247 | "reference": "b20efe38845d20458702f97f3ff625d80805897b", 1248 | "shasum": "" 1249 | }, 1250 | "require": { 1251 | "php": ">=5.3.1", 1252 | "symfony/process": "~2.1" 1253 | }, 1254 | "require-dev": { 1255 | "cssmin/cssmin": "*", 1256 | "joliclic/javascript-packer": "*", 1257 | "kamicane/packager": "*", 1258 | "leafo/lessphp": "*", 1259 | "leafo/scssphp": "*", 1260 | "leafo/scssphp-compass": "*", 1261 | "mrclay/minify": "*", 1262 | "patchwork/jsqueeze": "~1.0", 1263 | "phpunit/phpunit": "~4", 1264 | "psr/log": "~1.0", 1265 | "ptachoire/cssembed": "*", 1266 | "twig/twig": "~1.6" 1267 | }, 1268 | "suggest": { 1269 | "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", 1270 | "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", 1271 | "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin", 1272 | "patchwork/jsqueeze": "Assetic provides the integration with the JSqueeze JavaScript compressor", 1273 | "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", 1274 | "twig/twig": "Assetic provides the integration with the Twig templating engine" 1275 | }, 1276 | "type": "library", 1277 | "extra": { 1278 | "branch-alias": { 1279 | "dev-master": "1.2-dev" 1280 | } 1281 | }, 1282 | "autoload": { 1283 | "psr-0": { 1284 | "Assetic": "src/" 1285 | }, 1286 | "files": [ 1287 | "src/functions.php" 1288 | ] 1289 | }, 1290 | "notification-url": "https://packagist.org/downloads/", 1291 | "license": [ 1292 | "MIT" 1293 | ], 1294 | "authors": [ 1295 | { 1296 | "name": "Kris Wallsmith", 1297 | "email": "kris.wallsmith@gmail.com", 1298 | "homepage": "http://kriswallsmith.net/" 1299 | } 1300 | ], 1301 | "description": "Asset Management for PHP", 1302 | "homepage": "https://github.com/kriswallsmith/assetic", 1303 | "keywords": [ 1304 | "assets", 1305 | "compression", 1306 | "minification" 1307 | ], 1308 | "time": "2014-12-12 05:04:05" 1309 | }, 1310 | { 1311 | "name": "monolog/monolog", 1312 | "version": "1.13.1", 1313 | "source": { 1314 | "type": "git", 1315 | "url": "https://github.com/Seldaek/monolog.git", 1316 | "reference": "c31a2c4e8db5da8b46c74cf275d7f109c0f249ac" 1317 | }, 1318 | "dist": { 1319 | "type": "zip", 1320 | "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c31a2c4e8db5da8b46c74cf275d7f109c0f249ac", 1321 | "reference": "c31a2c4e8db5da8b46c74cf275d7f109c0f249ac", 1322 | "shasum": "" 1323 | }, 1324 | "require": { 1325 | "php": ">=5.3.0", 1326 | "psr/log": "~1.0" 1327 | }, 1328 | "provide": { 1329 | "psr/log-implementation": "1.0.0" 1330 | }, 1331 | "require-dev": { 1332 | "aws/aws-sdk-php": "~2.4, >2.4.8", 1333 | "doctrine/couchdb": "~1.0@dev", 1334 | "graylog2/gelf-php": "~1.0", 1335 | "phpunit/phpunit": "~4.0", 1336 | "raven/raven": "~0.5", 1337 | "ruflin/elastica": "0.90.*", 1338 | "swiftmailer/swiftmailer": "~5.3", 1339 | "videlalvaro/php-amqplib": "~2.4" 1340 | }, 1341 | "suggest": { 1342 | "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", 1343 | "doctrine/couchdb": "Allow sending log messages to a CouchDB server", 1344 | "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", 1345 | "ext-mongo": "Allow sending log messages to a MongoDB server", 1346 | "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", 1347 | "raven/raven": "Allow sending log messages to a Sentry server", 1348 | "rollbar/rollbar": "Allow sending log messages to Rollbar", 1349 | "ruflin/elastica": "Allow sending log messages to an Elastic Search server", 1350 | "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" 1351 | }, 1352 | "type": "library", 1353 | "extra": { 1354 | "branch-alias": { 1355 | "dev-master": "1.13.x-dev" 1356 | } 1357 | }, 1358 | "autoload": { 1359 | "psr-4": { 1360 | "Monolog\\": "src/Monolog" 1361 | } 1362 | }, 1363 | "notification-url": "https://packagist.org/downloads/", 1364 | "license": [ 1365 | "MIT" 1366 | ], 1367 | "authors": [ 1368 | { 1369 | "name": "Jordi Boggiano", 1370 | "email": "j.boggiano@seld.be", 1371 | "homepage": "http://seld.be" 1372 | } 1373 | ], 1374 | "description": "Sends your logs to files, sockets, inboxes, databases and various web services", 1375 | "homepage": "http://github.com/Seldaek/monolog", 1376 | "keywords": [ 1377 | "log", 1378 | "logging", 1379 | "psr-3" 1380 | ], 1381 | "time": "2015-03-09 09:58:04" 1382 | }, 1383 | { 1384 | "name": "phpcollection/phpcollection", 1385 | "version": "0.4.0", 1386 | "source": { 1387 | "type": "git", 1388 | "url": "https://github.com/schmittjoh/php-collection.git", 1389 | "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83" 1390 | }, 1391 | "dist": { 1392 | "type": "zip", 1393 | "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/b8bf55a0a929ca43b01232b36719f176f86c7e83", 1394 | "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83", 1395 | "shasum": "" 1396 | }, 1397 | "require": { 1398 | "phpoption/phpoption": "1.*" 1399 | }, 1400 | "type": "library", 1401 | "extra": { 1402 | "branch-alias": { 1403 | "dev-master": "0.3-dev" 1404 | } 1405 | }, 1406 | "autoload": { 1407 | "psr-0": { 1408 | "PhpCollection": "src/" 1409 | } 1410 | }, 1411 | "notification-url": "https://packagist.org/downloads/", 1412 | "license": [ 1413 | "Apache2" 1414 | ], 1415 | "authors": [ 1416 | { 1417 | "name": "Johannes Schmitt", 1418 | "email": "schmittjoh@gmail.com", 1419 | "homepage": "https://github.com/schmittjoh", 1420 | "role": "Developer of wrapped JMSSerializerBundle" 1421 | } 1422 | ], 1423 | "description": "General-Purpose Collection Library for PHP", 1424 | "keywords": [ 1425 | "collection", 1426 | "list", 1427 | "map", 1428 | "sequence", 1429 | "set" 1430 | ], 1431 | "time": "2014-03-11 13:46:42" 1432 | }, 1433 | { 1434 | "name": "phpoption/phpoption", 1435 | "version": "1.4.0", 1436 | "source": { 1437 | "type": "git", 1438 | "url": "https://github.com/schmittjoh/php-option.git", 1439 | "reference": "5d099bcf0393908bf4ad69cc47dafb785d51f7f5" 1440 | }, 1441 | "dist": { 1442 | "type": "zip", 1443 | "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/5d099bcf0393908bf4ad69cc47dafb785d51f7f5", 1444 | "reference": "5d099bcf0393908bf4ad69cc47dafb785d51f7f5", 1445 | "shasum": "" 1446 | }, 1447 | "require": { 1448 | "php": ">=5.3.0" 1449 | }, 1450 | "type": "library", 1451 | "extra": { 1452 | "branch-alias": { 1453 | "dev-master": "1.3-dev" 1454 | } 1455 | }, 1456 | "autoload": { 1457 | "psr-0": { 1458 | "PhpOption\\": "src/" 1459 | } 1460 | }, 1461 | "notification-url": "https://packagist.org/downloads/", 1462 | "license": [ 1463 | "Apache2" 1464 | ], 1465 | "authors": [ 1466 | { 1467 | "name": "Johannes Schmitt", 1468 | "email": "schmittjoh@gmail.com", 1469 | "homepage": "https://github.com/schmittjoh", 1470 | "role": "Developer of wrapped JMSSerializerBundle" 1471 | } 1472 | ], 1473 | "description": "Option Type for PHP", 1474 | "keywords": [ 1475 | "language", 1476 | "option", 1477 | "php", 1478 | "type" 1479 | ], 1480 | "time": "2014-01-09 22:37:17" 1481 | }, 1482 | { 1483 | "name": "psr/log", 1484 | "version": "1.0.0", 1485 | "source": { 1486 | "type": "git", 1487 | "url": "https://github.com/php-fig/log.git", 1488 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" 1489 | }, 1490 | "dist": { 1491 | "type": "zip", 1492 | "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", 1493 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", 1494 | "shasum": "" 1495 | }, 1496 | "type": "library", 1497 | "autoload": { 1498 | "psr-0": { 1499 | "Psr\\Log\\": "" 1500 | } 1501 | }, 1502 | "notification-url": "https://packagist.org/downloads/", 1503 | "license": [ 1504 | "MIT" 1505 | ], 1506 | "authors": [ 1507 | { 1508 | "name": "PHP-FIG", 1509 | "homepage": "http://www.php-fig.org/" 1510 | } 1511 | ], 1512 | "description": "Common interface for logging libraries", 1513 | "keywords": [ 1514 | "log", 1515 | "psr", 1516 | "psr-3" 1517 | ], 1518 | "time": "2012-12-21 11:40:51" 1519 | }, 1520 | { 1521 | "name": "sensio/distribution-bundle", 1522 | "version": "v3.0.24", 1523 | "target-dir": "Sensio/Bundle/DistributionBundle", 1524 | "source": { 1525 | "type": "git", 1526 | "url": "https://github.com/sensiolabs/SensioDistributionBundle.git", 1527 | "reference": "79b820aee1f1daeb2717fa9471ee19275cc1d638" 1528 | }, 1529 | "dist": { 1530 | "type": "zip", 1531 | "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/79b820aee1f1daeb2717fa9471ee19275cc1d638", 1532 | "reference": "79b820aee1f1daeb2717fa9471ee19275cc1d638", 1533 | "shasum": "" 1534 | }, 1535 | "require": { 1536 | "php": ">=5.3.3", 1537 | "sensiolabs/security-checker": "~2.0", 1538 | "symfony/class-loader": "~2.2", 1539 | "symfony/framework-bundle": "~2.3", 1540 | "symfony/process": "~2.2" 1541 | }, 1542 | "require-dev": { 1543 | "symfony/form": "~2.2", 1544 | "symfony/validator": "~2.2", 1545 | "symfony/yaml": "~2.2" 1546 | }, 1547 | "suggest": { 1548 | "symfony/form": "If you want to use the configurator", 1549 | "symfony/validator": "If you want to use the configurator", 1550 | "symfony/yaml": "If you want to use the configurator" 1551 | }, 1552 | "type": "symfony-bundle", 1553 | "extra": { 1554 | "branch-alias": { 1555 | "dev-master": "3.0.x-dev" 1556 | } 1557 | }, 1558 | "autoload": { 1559 | "psr-0": { 1560 | "Sensio\\Bundle\\DistributionBundle": "" 1561 | } 1562 | }, 1563 | "notification-url": "https://packagist.org/downloads/", 1564 | "license": [ 1565 | "MIT" 1566 | ], 1567 | "authors": [ 1568 | { 1569 | "name": "Fabien Potencier", 1570 | "email": "fabien@symfony.com" 1571 | } 1572 | ], 1573 | "description": "Base bundle for Symfony Distributions", 1574 | "keywords": [ 1575 | "configuration", 1576 | "distribution" 1577 | ], 1578 | "time": "2015-05-16 12:57:08" 1579 | }, 1580 | { 1581 | "name": "sensio/framework-extra-bundle", 1582 | "version": "v3.0.7", 1583 | "target-dir": "Sensio/Bundle/FrameworkExtraBundle", 1584 | "source": { 1585 | "type": "git", 1586 | "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git", 1587 | "reference": "5c37623576ea9e841b87dc0d85414d98fa6f7abb" 1588 | }, 1589 | "dist": { 1590 | "type": "zip", 1591 | "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/5c37623576ea9e841b87dc0d85414d98fa6f7abb", 1592 | "reference": "5c37623576ea9e841b87dc0d85414d98fa6f7abb", 1593 | "shasum": "" 1594 | }, 1595 | "require": { 1596 | "doctrine/common": "~2.2", 1597 | "symfony/framework-bundle": "~2.3" 1598 | }, 1599 | "require-dev": { 1600 | "symfony/expression-language": "~2.4", 1601 | "symfony/security-bundle": "~2.4" 1602 | }, 1603 | "suggest": { 1604 | "symfony/expression-language": "", 1605 | "symfony/security-bundle": "" 1606 | }, 1607 | "type": "symfony-bundle", 1608 | "extra": { 1609 | "branch-alias": { 1610 | "dev-master": "3.0.x-dev" 1611 | } 1612 | }, 1613 | "autoload": { 1614 | "psr-0": { 1615 | "Sensio\\Bundle\\FrameworkExtraBundle": "" 1616 | } 1617 | }, 1618 | "notification-url": "https://packagist.org/downloads/", 1619 | "license": [ 1620 | "MIT" 1621 | ], 1622 | "authors": [ 1623 | { 1624 | "name": "Fabien Potencier", 1625 | "email": "fabien@symfony.com" 1626 | } 1627 | ], 1628 | "description": "This bundle provides a way to configure your controllers with annotations", 1629 | "keywords": [ 1630 | "annotations", 1631 | "controllers" 1632 | ], 1633 | "time": "2015-04-02 12:28:58" 1634 | }, 1635 | { 1636 | "name": "sensiolabs/security-checker", 1637 | "version": "v2.0.3", 1638 | "source": { 1639 | "type": "git", 1640 | "url": "https://github.com/sensiolabs/security-checker.git", 1641 | "reference": "cde03c48d490d805ef1349e5108f8b3085981ead" 1642 | }, 1643 | "dist": { 1644 | "type": "zip", 1645 | "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/cde03c48d490d805ef1349e5108f8b3085981ead", 1646 | "reference": "cde03c48d490d805ef1349e5108f8b3085981ead", 1647 | "shasum": "" 1648 | }, 1649 | "require": { 1650 | "ext-curl": "*", 1651 | "symfony/console": "~2.0" 1652 | }, 1653 | "bin": [ 1654 | "security-checker" 1655 | ], 1656 | "type": "library", 1657 | "extra": { 1658 | "branch-alias": { 1659 | "dev-master": "2.0-dev" 1660 | } 1661 | }, 1662 | "autoload": { 1663 | "psr-0": { 1664 | "SensioLabs\\Security": "" 1665 | } 1666 | }, 1667 | "notification-url": "https://packagist.org/downloads/", 1668 | "license": [ 1669 | "MIT" 1670 | ], 1671 | "authors": [ 1672 | { 1673 | "name": "Fabien Potencier", 1674 | "email": "fabien.potencier@gmail.com" 1675 | } 1676 | ], 1677 | "description": "A security checker for your composer.lock", 1678 | "time": "2015-05-22 14:21:04" 1679 | }, 1680 | { 1681 | "name": "swiftmailer/swiftmailer", 1682 | "version": "v5.4.0", 1683 | "source": { 1684 | "type": "git", 1685 | "url": "https://github.com/swiftmailer/swiftmailer.git", 1686 | "reference": "31454f258f10329ae7c48763eb898a75c39e0a9f" 1687 | }, 1688 | "dist": { 1689 | "type": "zip", 1690 | "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/31454f258f10329ae7c48763eb898a75c39e0a9f", 1691 | "reference": "31454f258f10329ae7c48763eb898a75c39e0a9f", 1692 | "shasum": "" 1693 | }, 1694 | "require": { 1695 | "php": ">=5.3.3" 1696 | }, 1697 | "require-dev": { 1698 | "mockery/mockery": "~0.9.1" 1699 | }, 1700 | "type": "library", 1701 | "extra": { 1702 | "branch-alias": { 1703 | "dev-master": "5.4-dev" 1704 | } 1705 | }, 1706 | "autoload": { 1707 | "files": [ 1708 | "lib/swift_required.php" 1709 | ] 1710 | }, 1711 | "notification-url": "https://packagist.org/downloads/", 1712 | "license": [ 1713 | "MIT" 1714 | ], 1715 | "authors": [ 1716 | { 1717 | "name": "Chris Corbyn" 1718 | }, 1719 | { 1720 | "name": "Fabien Potencier", 1721 | "email": "fabien@symfony.com" 1722 | } 1723 | ], 1724 | "description": "Swiftmailer, free feature-rich PHP mailer", 1725 | "homepage": "http://swiftmailer.org", 1726 | "keywords": [ 1727 | "mail", 1728 | "mailer" 1729 | ], 1730 | "time": "2015-03-14 06:06:39" 1731 | }, 1732 | { 1733 | "name": "symfony/assetic-bundle", 1734 | "version": "v2.6.1", 1735 | "source": { 1736 | "type": "git", 1737 | "url": "https://github.com/symfony/AsseticBundle.git", 1738 | "reference": "422b0add2110f0cf9bc7a873a386ea053f4a89f0" 1739 | }, 1740 | "dist": { 1741 | "type": "zip", 1742 | "url": "https://api.github.com/repos/symfony/AsseticBundle/zipball/422b0add2110f0cf9bc7a873a386ea053f4a89f0", 1743 | "reference": "422b0add2110f0cf9bc7a873a386ea053f4a89f0", 1744 | "shasum": "" 1745 | }, 1746 | "require": { 1747 | "kriswallsmith/assetic": "~1.2", 1748 | "php": ">=5.3.0", 1749 | "symfony/console": "~2.3", 1750 | "symfony/dependency-injection": "~2.3", 1751 | "symfony/framework-bundle": "~2.3", 1752 | "symfony/yaml": "~2.3" 1753 | }, 1754 | "require-dev": { 1755 | "kriswallsmith/spork": "~0.2", 1756 | "patchwork/jsqueeze": "~1.0", 1757 | "symfony/class-loader": "~2.3", 1758 | "symfony/css-selector": "~2.3", 1759 | "symfony/dom-crawler": "~2.3", 1760 | "symfony/twig-bundle": "~2.3" 1761 | }, 1762 | "suggest": { 1763 | "kriswallsmith/spork": "to be able to dump assets in parallel", 1764 | "symfony/twig-bundle": "to use the Twig integration" 1765 | }, 1766 | "type": "symfony-bundle", 1767 | "extra": { 1768 | "branch-alias": { 1769 | "dev-master": "2.5-dev" 1770 | } 1771 | }, 1772 | "autoload": { 1773 | "psr-4": { 1774 | "Symfony\\Bundle\\AsseticBundle\\": "" 1775 | } 1776 | }, 1777 | "notification-url": "https://packagist.org/downloads/", 1778 | "license": [ 1779 | "MIT" 1780 | ], 1781 | "authors": [ 1782 | { 1783 | "name": "Kris Wallsmith", 1784 | "email": "kris.wallsmith@gmail.com", 1785 | "homepage": "http://kriswallsmith.net/" 1786 | } 1787 | ], 1788 | "description": "Integrates Assetic into Symfony2", 1789 | "homepage": "https://github.com/symfony/AsseticBundle", 1790 | "keywords": [ 1791 | "assets", 1792 | "compression", 1793 | "minification" 1794 | ], 1795 | "time": "2015-01-27 12:45:16" 1796 | }, 1797 | { 1798 | "name": "symfony/monolog-bundle", 1799 | "version": "v2.7.1", 1800 | "source": { 1801 | "type": "git", 1802 | "url": "https://github.com/symfony/MonologBundle.git", 1803 | "reference": "9320b6863404c70ebe111e9040dab96f251de7ac" 1804 | }, 1805 | "dist": { 1806 | "type": "zip", 1807 | "url": "https://api.github.com/repos/symfony/MonologBundle/zipball/9320b6863404c70ebe111e9040dab96f251de7ac", 1808 | "reference": "9320b6863404c70ebe111e9040dab96f251de7ac", 1809 | "shasum": "" 1810 | }, 1811 | "require": { 1812 | "monolog/monolog": "~1.8", 1813 | "php": ">=5.3.2", 1814 | "symfony/config": "~2.3", 1815 | "symfony/dependency-injection": "~2.3", 1816 | "symfony/http-kernel": "~2.3", 1817 | "symfony/monolog-bridge": "~2.3" 1818 | }, 1819 | "require-dev": { 1820 | "symfony/console": "~2.3", 1821 | "symfony/yaml": "~2.3" 1822 | }, 1823 | "type": "symfony-bundle", 1824 | "extra": { 1825 | "branch-alias": { 1826 | "dev-master": "2.7.x-dev" 1827 | } 1828 | }, 1829 | "autoload": { 1830 | "psr-4": { 1831 | "Symfony\\Bundle\\MonologBundle\\": "" 1832 | } 1833 | }, 1834 | "notification-url": "https://packagist.org/downloads/", 1835 | "license": [ 1836 | "MIT" 1837 | ], 1838 | "authors": [ 1839 | { 1840 | "name": "Symfony Community", 1841 | "homepage": "http://symfony.com/contributors" 1842 | }, 1843 | { 1844 | "name": "Fabien Potencier", 1845 | "email": "fabien@symfony.com" 1846 | } 1847 | ], 1848 | "description": "Symfony MonologBundle", 1849 | "homepage": "http://symfony.com", 1850 | "keywords": [ 1851 | "log", 1852 | "logging" 1853 | ], 1854 | "time": "2015-01-04 20:21:17" 1855 | }, 1856 | { 1857 | "name": "symfony/swiftmailer-bundle", 1858 | "version": "v2.3.8", 1859 | "source": { 1860 | "type": "git", 1861 | "url": "https://github.com/symfony/SwiftmailerBundle.git", 1862 | "reference": "970b13d01871207e81d17b17ddda025e7e21e797" 1863 | }, 1864 | "dist": { 1865 | "type": "zip", 1866 | "url": "https://api.github.com/repos/symfony/SwiftmailerBundle/zipball/970b13d01871207e81d17b17ddda025e7e21e797", 1867 | "reference": "970b13d01871207e81d17b17ddda025e7e21e797", 1868 | "shasum": "" 1869 | }, 1870 | "require": { 1871 | "php": ">=5.3.2", 1872 | "swiftmailer/swiftmailer": ">=4.2.0,~5.0", 1873 | "symfony/swiftmailer-bridge": "~2.1" 1874 | }, 1875 | "require-dev": { 1876 | "symfony/config": "~2.1", 1877 | "symfony/dependency-injection": "~2.1", 1878 | "symfony/http-kernel": "~2.1", 1879 | "symfony/yaml": "~2.1" 1880 | }, 1881 | "suggest": { 1882 | "psr/log": "Allows logging" 1883 | }, 1884 | "type": "symfony-bundle", 1885 | "extra": { 1886 | "branch-alias": { 1887 | "dev-master": "2.3-dev" 1888 | } 1889 | }, 1890 | "autoload": { 1891 | "psr-4": { 1892 | "Symfony\\Bundle\\SwiftmailerBundle\\": "" 1893 | } 1894 | }, 1895 | "notification-url": "https://packagist.org/downloads/", 1896 | "license": [ 1897 | "MIT" 1898 | ], 1899 | "authors": [ 1900 | { 1901 | "name": "Symfony Community", 1902 | "homepage": "http://symfony.com/contributors" 1903 | }, 1904 | { 1905 | "name": "Fabien Potencier", 1906 | "email": "fabien@symfony.com" 1907 | } 1908 | ], 1909 | "description": "Symfony SwiftmailerBundle", 1910 | "homepage": "http://symfony.com", 1911 | "time": "2014-12-01 17:44:50" 1912 | }, 1913 | { 1914 | "name": "symfony/symfony", 1915 | "version": "v2.6.7", 1916 | "source": { 1917 | "type": "git", 1918 | "url": "https://github.com/symfony/symfony.git", 1919 | "reference": "0449d0e1178bc8e934520b20432d1705c3b25e7e" 1920 | }, 1921 | "dist": { 1922 | "type": "zip", 1923 | "url": "https://api.github.com/repos/symfony/symfony/zipball/0449d0e1178bc8e934520b20432d1705c3b25e7e", 1924 | "reference": "0449d0e1178bc8e934520b20432d1705c3b25e7e", 1925 | "shasum": "" 1926 | }, 1927 | "require": { 1928 | "doctrine/common": "~2.3", 1929 | "php": ">=5.3.3", 1930 | "psr/log": "~1.0", 1931 | "twig/twig": "~1.12,>=1.12.3" 1932 | }, 1933 | "replace": { 1934 | "symfony/browser-kit": "self.version", 1935 | "symfony/class-loader": "self.version", 1936 | "symfony/config": "self.version", 1937 | "symfony/console": "self.version", 1938 | "symfony/css-selector": "self.version", 1939 | "symfony/debug": "self.version", 1940 | "symfony/debug-bundle": "self.version", 1941 | "symfony/dependency-injection": "self.version", 1942 | "symfony/doctrine-bridge": "self.version", 1943 | "symfony/dom-crawler": "self.version", 1944 | "symfony/event-dispatcher": "self.version", 1945 | "symfony/expression-language": "self.version", 1946 | "symfony/filesystem": "self.version", 1947 | "symfony/finder": "self.version", 1948 | "symfony/form": "self.version", 1949 | "symfony/framework-bundle": "self.version", 1950 | "symfony/http-foundation": "self.version", 1951 | "symfony/http-kernel": "self.version", 1952 | "symfony/intl": "self.version", 1953 | "symfony/locale": "self.version", 1954 | "symfony/monolog-bridge": "self.version", 1955 | "symfony/options-resolver": "self.version", 1956 | "symfony/process": "self.version", 1957 | "symfony/propel1-bridge": "self.version", 1958 | "symfony/property-access": "self.version", 1959 | "symfony/proxy-manager-bridge": "self.version", 1960 | "symfony/routing": "self.version", 1961 | "symfony/security": "self.version", 1962 | "symfony/security-acl": "self.version", 1963 | "symfony/security-bundle": "self.version", 1964 | "symfony/security-core": "self.version", 1965 | "symfony/security-csrf": "self.version", 1966 | "symfony/security-http": "self.version", 1967 | "symfony/serializer": "self.version", 1968 | "symfony/stopwatch": "self.version", 1969 | "symfony/swiftmailer-bridge": "self.version", 1970 | "symfony/templating": "self.version", 1971 | "symfony/translation": "self.version", 1972 | "symfony/twig-bridge": "self.version", 1973 | "symfony/twig-bundle": "self.version", 1974 | "symfony/validator": "self.version", 1975 | "symfony/var-dumper": "self.version", 1976 | "symfony/web-profiler-bundle": "self.version", 1977 | "symfony/yaml": "self.version" 1978 | }, 1979 | "require-dev": { 1980 | "doctrine/data-fixtures": "1.0.*", 1981 | "doctrine/dbal": "~2.2", 1982 | "doctrine/doctrine-bundle": "~1.2", 1983 | "doctrine/orm": "~2.2,>=2.2.3", 1984 | "egulias/email-validator": "~1.2", 1985 | "ircmaxell/password-compat": "~1.0", 1986 | "monolog/monolog": "~1.11", 1987 | "ocramius/proxy-manager": "~0.4|~1.0", 1988 | "propel/propel1": "~1.6", 1989 | "symfony/phpunit-bridge": "~2.7" 1990 | }, 1991 | "type": "library", 1992 | "extra": { 1993 | "branch-alias": { 1994 | "dev-master": "2.6-dev" 1995 | } 1996 | }, 1997 | "autoload": { 1998 | "psr-0": { 1999 | "Symfony\\": "src/" 2000 | }, 2001 | "classmap": [ 2002 | "src/Symfony/Component/HttpFoundation/Resources/stubs", 2003 | "src/Symfony/Component/Intl/Resources/stubs" 2004 | ], 2005 | "files": [ 2006 | "src/Symfony/Component/Intl/Resources/stubs/functions.php" 2007 | ] 2008 | }, 2009 | "notification-url": "https://packagist.org/downloads/", 2010 | "license": [ 2011 | "MIT" 2012 | ], 2013 | "authors": [ 2014 | { 2015 | "name": "Symfony Community", 2016 | "homepage": "http://symfony.com/contributors" 2017 | }, 2018 | { 2019 | "name": "Fabien Potencier", 2020 | "email": "fabien@symfony.com" 2021 | } 2022 | ], 2023 | "description": "The Symfony PHP framework", 2024 | "homepage": "http://symfony.com", 2025 | "keywords": [ 2026 | "framework" 2027 | ], 2028 | "time": "2015-05-11 01:58:49" 2029 | }, 2030 | { 2031 | "name": "twig/extensions", 2032 | "version": "v1.2.0", 2033 | "source": { 2034 | "type": "git", 2035 | "url": "https://github.com/twigphp/Twig-extensions.git", 2036 | "reference": "8cf4b9fe04077bd54fc73f4fde83347040c3b8cd" 2037 | }, 2038 | "dist": { 2039 | "type": "zip", 2040 | "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/8cf4b9fe04077bd54fc73f4fde83347040c3b8cd", 2041 | "reference": "8cf4b9fe04077bd54fc73f4fde83347040c3b8cd", 2042 | "shasum": "" 2043 | }, 2044 | "require": { 2045 | "twig/twig": "~1.12" 2046 | }, 2047 | "require-dev": { 2048 | "symfony/translation": "~2.3" 2049 | }, 2050 | "suggest": { 2051 | "symfony/translation": "Allow the time_diff output to be translated" 2052 | }, 2053 | "type": "library", 2054 | "extra": { 2055 | "branch-alias": { 2056 | "dev-master": "1.2.x-dev" 2057 | } 2058 | }, 2059 | "autoload": { 2060 | "psr-0": { 2061 | "Twig_Extensions_": "lib/" 2062 | } 2063 | }, 2064 | "notification-url": "https://packagist.org/downloads/", 2065 | "license": [ 2066 | "MIT" 2067 | ], 2068 | "authors": [ 2069 | { 2070 | "name": "Fabien Potencier", 2071 | "email": "fabien@symfony.com" 2072 | } 2073 | ], 2074 | "description": "Common additional features for Twig that do not directly belong in core", 2075 | "homepage": "http://twig.sensiolabs.org/doc/extensions/index.html", 2076 | "keywords": [ 2077 | "i18n", 2078 | "text" 2079 | ], 2080 | "time": "2014-10-30 14:30:03" 2081 | }, 2082 | { 2083 | "name": "twig/twig", 2084 | "version": "v1.18.1", 2085 | "source": { 2086 | "type": "git", 2087 | "url": "https://github.com/twigphp/Twig.git", 2088 | "reference": "9f70492f44398e276d1b81c1b43adfe6751c7b7f" 2089 | }, 2090 | "dist": { 2091 | "type": "zip", 2092 | "url": "https://api.github.com/repos/twigphp/Twig/zipball/9f70492f44398e276d1b81c1b43adfe6751c7b7f", 2093 | "reference": "9f70492f44398e276d1b81c1b43adfe6751c7b7f", 2094 | "shasum": "" 2095 | }, 2096 | "require": { 2097 | "php": ">=5.2.7" 2098 | }, 2099 | "type": "library", 2100 | "extra": { 2101 | "branch-alias": { 2102 | "dev-master": "1.18-dev" 2103 | } 2104 | }, 2105 | "autoload": { 2106 | "psr-0": { 2107 | "Twig_": "lib/" 2108 | } 2109 | }, 2110 | "notification-url": "https://packagist.org/downloads/", 2111 | "license": [ 2112 | "BSD-3-Clause" 2113 | ], 2114 | "authors": [ 2115 | { 2116 | "name": "Fabien Potencier", 2117 | "email": "fabien@symfony.com", 2118 | "homepage": "http://fabien.potencier.org", 2119 | "role": "Lead Developer" 2120 | }, 2121 | { 2122 | "name": "Armin Ronacher", 2123 | "email": "armin.ronacher@active-4.com", 2124 | "role": "Project Founder" 2125 | }, 2126 | { 2127 | "name": "Twig Team", 2128 | "homepage": "http://twig.sensiolabs.org/contributors", 2129 | "role": "Contributors" 2130 | } 2131 | ], 2132 | "description": "Twig, the flexible, fast, and secure template language for PHP", 2133 | "homepage": "http://twig.sensiolabs.org", 2134 | "keywords": [ 2135 | "templating" 2136 | ], 2137 | "time": "2015-04-19 08:30:27" 2138 | }, 2139 | { 2140 | "name": "willdurand/jsonp-callback-validator", 2141 | "version": "v1.1.0", 2142 | "source": { 2143 | "type": "git", 2144 | "url": "https://github.com/willdurand/JsonpCallbackValidator.git", 2145 | "reference": "1a7d388bb521959e612ef50c5c7b1691b097e909" 2146 | }, 2147 | "dist": { 2148 | "type": "zip", 2149 | "url": "https://api.github.com/repos/willdurand/JsonpCallbackValidator/zipball/1a7d388bb521959e612ef50c5c7b1691b097e909", 2150 | "reference": "1a7d388bb521959e612ef50c5c7b1691b097e909", 2151 | "shasum": "" 2152 | }, 2153 | "require": { 2154 | "php": ">=5.3.0" 2155 | }, 2156 | "require-dev": { 2157 | "phpunit/phpunit": "~3.7" 2158 | }, 2159 | "type": "library", 2160 | "autoload": { 2161 | "psr-0": { 2162 | "JsonpCallbackValidator": "src/" 2163 | } 2164 | }, 2165 | "notification-url": "https://packagist.org/downloads/", 2166 | "license": [ 2167 | "MIT" 2168 | ], 2169 | "authors": [ 2170 | { 2171 | "name": "William Durand", 2172 | "email": "william.durand1@gmail.com", 2173 | "homepage": "http://www.willdurand.fr" 2174 | } 2175 | ], 2176 | "description": "JSONP callback validator.", 2177 | "time": "2014-01-20 22:35:06" 2178 | }, 2179 | { 2180 | "name": "willdurand/negotiation", 2181 | "version": "1.3.4", 2182 | "source": { 2183 | "type": "git", 2184 | "url": "https://github.com/willdurand/Negotiation.git", 2185 | "reference": "d7fa4ce4a0436915b9ba9f7cb5ff37719f0a834c" 2186 | }, 2187 | "dist": { 2188 | "type": "zip", 2189 | "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/d7fa4ce4a0436915b9ba9f7cb5ff37719f0a834c", 2190 | "reference": "d7fa4ce4a0436915b9ba9f7cb5ff37719f0a834c", 2191 | "shasum": "" 2192 | }, 2193 | "require": { 2194 | "php": ">=5.3.0" 2195 | }, 2196 | "type": "library", 2197 | "extra": { 2198 | "branch-alias": { 2199 | "dev-master": "1.3-dev" 2200 | } 2201 | }, 2202 | "autoload": { 2203 | "psr-0": { 2204 | "Negotiation": "src/" 2205 | } 2206 | }, 2207 | "notification-url": "https://packagist.org/downloads/", 2208 | "license": [ 2209 | "MIT" 2210 | ], 2211 | "authors": [ 2212 | { 2213 | "name": "William Durand", 2214 | "email": "william.durand1@gmail.com" 2215 | } 2216 | ], 2217 | "description": "Content Negotiation tools for PHP provided as a standalone library.", 2218 | "homepage": "http://williamdurand.fr/Negotiation/", 2219 | "keywords": [ 2220 | "accept", 2221 | "content", 2222 | "format", 2223 | "header", 2224 | "negotiation" 2225 | ], 2226 | "time": "2014-10-02 07:26:00" 2227 | } 2228 | ], 2229 | "packages-dev": [ 2230 | { 2231 | "name": "sensio/generator-bundle", 2232 | "version": "v2.5.3", 2233 | "target-dir": "Sensio/Bundle/GeneratorBundle", 2234 | "source": { 2235 | "type": "git", 2236 | "url": "https://github.com/sensiolabs/SensioGeneratorBundle.git", 2237 | "reference": "e50108c2133ee5c9c484555faed50c17a61221d3" 2238 | }, 2239 | "dist": { 2240 | "type": "zip", 2241 | "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/e50108c2133ee5c9c484555faed50c17a61221d3", 2242 | "reference": "e50108c2133ee5c9c484555faed50c17a61221d3", 2243 | "shasum": "" 2244 | }, 2245 | "require": { 2246 | "symfony/console": "~2.5", 2247 | "symfony/framework-bundle": "~2.2" 2248 | }, 2249 | "require-dev": { 2250 | "doctrine/orm": "~2.2,>=2.2.3", 2251 | "symfony/doctrine-bridge": "~2.2", 2252 | "twig/twig": "~1.11" 2253 | }, 2254 | "type": "symfony-bundle", 2255 | "extra": { 2256 | "branch-alias": { 2257 | "dev-master": "2.5.x-dev" 2258 | } 2259 | }, 2260 | "autoload": { 2261 | "psr-0": { 2262 | "Sensio\\Bundle\\GeneratorBundle": "" 2263 | } 2264 | }, 2265 | "notification-url": "https://packagist.org/downloads/", 2266 | "license": [ 2267 | "MIT" 2268 | ], 2269 | "authors": [ 2270 | { 2271 | "name": "Fabien Potencier", 2272 | "email": "fabien@symfony.com" 2273 | } 2274 | ], 2275 | "description": "This bundle generates code for you", 2276 | "time": "2015-03-17 06:36:52" 2277 | } 2278 | ], 2279 | "aliases": [], 2280 | "minimum-stability": "stable", 2281 | "stability-flags": { 2282 | "doctrine/migrations": 20 2283 | }, 2284 | "prefer-stable": false, 2285 | "prefer-lowest": false, 2286 | "platform": { 2287 | "php": ">=5.3.3" 2288 | }, 2289 | "platform-dev": [] 2290 | } 2291 | -------------------------------------------------------------------------------- /MyApplication/src/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Order deny,allow 6 | Deny from all 7 | 8 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/AcmeDemoBundle.php: -------------------------------------------------------------------------------- 1 | getContainer(). 15 | * 16 | * @author Tobias Schultze 17 | */ 18 | class HelloWorldCommand extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | protected function configure() 24 | { 25 | $this 26 | ->setName('acme:hello') 27 | ->setDescription('Hello World example command') 28 | ->addArgument('who', InputArgument::OPTIONAL, 'Who to greet.', 'World') 29 | ->setHelp(<<%command.name% command greets somebody or everybody: 31 | 32 | php %command.full_name% 33 | 34 | The optional argument specifies who to greet: 35 | 36 | php %command.full_name% Fabien 37 | EOF 38 | ); 39 | } 40 | 41 | /** 42 | * {@inheritdoc} 43 | */ 44 | protected function execute(InputInterface $input, OutputInterface $output) 45 | { 46 | $output->writeln(sprintf('Hello %s!', $input->getArgument('who'))); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Controller/DemoController.php: -------------------------------------------------------------------------------- 1 | $name); 32 | } 33 | 34 | /** 35 | * @Route("/contact", name="_demo_contact") 36 | * @Template() 37 | */ 38 | public function contactAction(Request $request) 39 | { 40 | $form = $this->createForm(new ContactType()); 41 | $form->handleRequest($request); 42 | 43 | if ($form->isValid()) { 44 | $mailer = $this->get('mailer'); 45 | 46 | // .. setup a message and send it 47 | // http://symfony.com/doc/current/cookbook/email.html 48 | 49 | $request->getSession()->getFlashBag()->set('notice', 'Message sent!'); 50 | 51 | return new RedirectResponse($this->generateUrl('_demo')); 52 | } 53 | 54 | return array('form' => $form->createView()); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Controller/SecuredController.php: -------------------------------------------------------------------------------- 1 | attributes->has(SecurityContext::AUTHENTICATION_ERROR)) { 24 | $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR); 25 | } else { 26 | $error = $request->getSession()->get(SecurityContext::AUTHENTICATION_ERROR); 27 | } 28 | 29 | return array( 30 | 'last_username' => $request->getSession()->get(SecurityContext::LAST_USERNAME), 31 | 'error' => $error, 32 | ); 33 | } 34 | 35 | /** 36 | * @Route("/login_check", name="_demo_security_check") 37 | */ 38 | public function securityCheckAction() 39 | { 40 | // The security layer will intercept this request 41 | } 42 | 43 | /** 44 | * @Route("/logout", name="_demo_logout") 45 | */ 46 | public function logoutAction() 47 | { 48 | // The security layer will intercept this request 49 | } 50 | 51 | /** 52 | * @Route("/hello", defaults={"name"="World"}), 53 | * @Route("/hello/{name}", name="_demo_secured_hello") 54 | * @Template() 55 | */ 56 | public function helloAction($name) 57 | { 58 | return array('name' => $name); 59 | } 60 | 61 | /** 62 | * @Route("/hello/admin/{name}", name="_demo_secured_hello_admin") 63 | * @Security("is_granted('ROLE_ADMIN')") 64 | * @Template() 65 | */ 66 | public function helloadminAction($name) 67 | { 68 | return array('name' => $name); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Controller/WelcomeController.php: -------------------------------------------------------------------------------- 1 | render('AcmeDemoBundle:Welcome:index.html.twig'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/DependencyInjection/AcmeDemoExtension.php: -------------------------------------------------------------------------------- 1 | load('services.xml'); 16 | } 17 | 18 | public function getAlias() 19 | { 20 | return 'acme_demo'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/EventListener/ControllerListener.php: -------------------------------------------------------------------------------- 1 | extension = $extension; 16 | } 17 | 18 | public function onKernelController(FilterControllerEvent $event) 19 | { 20 | if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) { 21 | $this->extension->setController($event->getController()); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Form/ContactType.php: -------------------------------------------------------------------------------- 1 | add('email', 'email'); 13 | $builder->add('message', 'textarea'); 14 | } 15 | 16 | public function getName() 17 | { 18 | return 'contact'; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/config/routing.yml: -------------------------------------------------------------------------------- 1 | _welcome: 2 | path: / 3 | defaults: { _controller: AcmeDemoBundle:Welcome:index } 4 | 5 | _demo_secured: 6 | resource: "@AcmeDemoBundle/Controller/SecuredController.php" 7 | type: annotation 8 | 9 | _demo: 10 | resource: "@AcmeDemoBundle/Controller/DemoController.php" 11 | type: annotation 12 | prefix: /demo 13 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/config/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/public/css/demo.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: 14px; 3 | font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; 4 | } 5 | h1.title { 6 | font-size: 45px; 7 | padding-bottom: 30px; 8 | } 9 | .sf-reset h2 { 10 | font-weight: bold; 11 | color: #FFFFFF; 12 | /* Font is duplicated of body (sans-serif) */ 13 | font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; 14 | 15 | margin-bottom: 10px; 16 | background-color: #aacd4e; 17 | padding: 2px 4px; 18 | display: inline-block; 19 | text-transform: uppercase; 20 | 21 | } 22 | p { 23 | line-height: 20px; 24 | padding-bottom: 20px; 25 | } 26 | ul#demo-list a { 27 | background: url(../images/blue-arrow.png) no-repeat right 6px; 28 | padding-right: 10px; 29 | margin-right: 30px; 30 | } 31 | #symfony-header { 32 | position: relative; 33 | padding: 30px 30px 20px 30px; 34 | } 35 | .sf-reset .symfony-blocks-welcome { 36 | overflow: hidden; 37 | } 38 | .sf-reset .symfony-blocks-welcome > div { 39 | background-color: whitesmoke; 40 | float: left; 41 | width: 240px; 42 | margin-right: 14px; 43 | text-align: center; 44 | padding: 26px 20px; 45 | } 46 | .sf-reset .symfony-blocks-welcome > div.block-demo { 47 | margin-right: 0; 48 | } 49 | .sf-reset .symfony-blocks-welcome .illustration { 50 | padding-bottom: 20px; 51 | } 52 | .sf-reset .symfony-blocks-help { 53 | overflow: hidden; 54 | } 55 | .sf-reset .symfony-blocks-help { 56 | margin-top: 30px; 57 | padding: 18px; 58 | border: 1px solid #E6E6E6; 59 | } 60 | .sf-reset .symfony-blocks-help > div { 61 | width: 254px; 62 | float: left; 63 | } 64 | .flash-message { 65 | padding: 10px; 66 | margin: 5px; 67 | margin-top: 15px; 68 | background-color: #ffe; 69 | } 70 | .sf-reset .error { 71 | color: red; 72 | } 73 | #login label, #contact_form label { 74 | display: block; 75 | float: left; 76 | width: 90px; 77 | } 78 | .sf-reset ul#menu { 79 | float: right; 80 | margin-bottom: 20px; 81 | padding-left: 0; 82 | } 83 | .sf-reset #menu li { 84 | padding-left: 0; 85 | margin-right: 10px; 86 | display: inline; 87 | } 88 | .sf-reset a, 89 | .sf-reset li a { 90 | color: #08C; 91 | text-decoration: none; 92 | } 93 | .sf-reset a:hover, 94 | .sf-reset li a:hover { 95 | color: #08C; 96 | text-decoration: underline; 97 | } 98 | .sf-reset .symfony-content pre { 99 | white-space: pre; 100 | font-family: monospace; 101 | } 102 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/public/images/blue-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allan-simon/symfony2-rest-api-example/1a9fd0d26f9db1d88b5c1ea01d707147c0a49694/MyApplication/src/Acme/DemoBundle/Resources/public/images/blue-arrow.png -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/public/images/field-background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allan-simon/symfony2-rest-api-example/1a9fd0d26f9db1d88b5c1ea01d707147c0a49694/MyApplication/src/Acme/DemoBundle/Resources/public/images/field-background.gif -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/public/images/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allan-simon/symfony2-rest-api-example/1a9fd0d26f9db1d88b5c1ea01d707147c0a49694/MyApplication/src/Acme/DemoBundle/Resources/public/images/logo.gif -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/public/images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allan-simon/symfony2-rest-api-example/1a9fd0d26f9db1d88b5c1ea01d707147c0a49694/MyApplication/src/Acme/DemoBundle/Resources/public/images/search.png -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/public/images/welcome-configure.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allan-simon/symfony2-rest-api-example/1a9fd0d26f9db1d88b5c1ea01d707147c0a49694/MyApplication/src/Acme/DemoBundle/Resources/public/images/welcome-configure.gif -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/public/images/welcome-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allan-simon/symfony2-rest-api-example/1a9fd0d26f9db1d88b5c1ea01d707147c0a49694/MyApplication/src/Acme/DemoBundle/Resources/public/images/welcome-demo.gif -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/public/images/welcome-quick-tour.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allan-simon/symfony2-rest-api-example/1a9fd0d26f9db1d88b5c1ea01d707147c0a49694/MyApplication/src/Acme/DemoBundle/Resources/public/images/welcome-quick-tour.gif -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/views/Demo/contact.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "AcmeDemoBundle::layout.html.twig" %} 2 | 3 | {% block title "Symfony - Contact form" %} 4 | 5 | {% block content %} 6 |
7 | {{ form_errors(form) }} 8 | 9 | {{ form_row(form.email) }} 10 | {{ form_row(form.message) }} 11 | 12 | {{ form_rest(form) }} 13 | 14 |
15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "AcmeDemoBundle::layout.html.twig" %} 2 | 3 | {% block title "Hello " ~ name %} 4 | 5 | {% block content %} 6 |

Hello {{ name }}!

7 | {% endblock %} 8 | 9 | {% set code = code(_self) %} 10 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/views/Demo/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "AcmeDemoBundle::layout.html.twig" %} 2 | 3 | {% block title "Symfony - Demos" %} 4 | 5 | {% block content_header '' %} 6 | 7 | {% block content %} 8 |

Available demos

9 | 14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/views/Secured/hello.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "AcmeDemoBundle:Secured:layout.html.twig" %} 2 | 3 | {% block title "Hello " ~ name %} 4 | 5 | {% block content %} 6 |

Hello {{ name }}!

7 | 8 | Hello resource secured for admin only. 9 | {% endblock %} 10 | 11 | {% set code = code(_self) %} 12 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/views/Secured/helloadmin.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "AcmeDemoBundle:Secured:layout.html.twig" %} 2 | 3 | {% block title "Hello " ~ name %} 4 | 5 | {% block content %} 6 |

Hello {{ name }} secured for Admins only!

7 | {% endblock %} 8 | 9 | {% set code = code(_self) %} 10 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/views/Secured/layout.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "AcmeDemoBundle::layout.html.twig" %} 2 | 3 | {% block content_header_more %} 4 | {{ parent() }} 5 |
  • logged in as {{ app.user ? app.user.username : 'Anonymous' }} - Logout
  • 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/views/Secured/login.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'AcmeDemoBundle::layout.html.twig' %} 2 | 3 | {% block content %} 4 |

    Login

    5 | 6 |

    7 | Choose between two default users: user/userpass (ROLE_USER) or admin/adminpass (ROLE_ADMIN) 8 |

    9 | 10 | {% if error %} 11 |
    {{ error.message }}
    12 | {% endif %} 13 | 14 |
    15 |
    16 | 17 | 18 |
    19 | 20 |
    21 | 22 | 23 |
    24 | 25 | 32 |
    33 | {% endblock %} 34 | 35 | {% set code = code(_self) %} 36 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'AcmeDemoBundle::layout.html.twig' %} 2 | 3 | {% block title %}Symfony - Welcome{% endblock %} 4 | 5 | {% block content_header '' %} 6 | 7 | {% block content %} 8 | {% set version = constant('Symfony\\Component\\HttpKernel\\Kernel::MAJOR_VERSION') ~ '.' ~ constant('Symfony\\Component\\HttpKernel\\Kernel::MINOR_VERSION')%} 9 | 10 |

    Welcome!

    11 | 12 |

    Congratulations! You have successfully installed a new Symfony application.

    13 | 14 |
    15 | 27 | {% if app.environment == 'dev' %} 28 | 40 | {% endif %} 41 | 53 |
    54 | 55 |
    56 |
    57 | 65 |
    66 |
    67 | 72 |
    73 |
    74 | 81 |
    82 |
    83 | {% endblock %} 84 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Resources/views/layout.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "TwigBundle::layout.html.twig" %} 2 | 3 | {% block head %} 4 | 5 | 6 | {% endblock %} 7 | 8 | {% block title 'Demo Bundle' %} 9 | 10 | {% block body %} 11 | {% for flashMessage in app.session.flashbag.get('notice') %} 12 |
    13 | Notice: {{ flashMessage }} 14 |
    15 | {% endfor %} 16 | 17 | {% block content_header %} 18 | 23 | 24 |
    25 | {% endblock %} 26 | 27 |
    28 | {% block content %}{% endblock %} 29 |
    30 | 31 | {% if code is defined %} 32 |

    Code behind this page

    33 |
    34 |
    {{ code|raw }}
    35 |
    36 | {% endif %} 37 | {% endblock %} 38 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/demo/hello/Fabien'); 14 | 15 | $this->assertGreaterThan(0, $crawler->filter('html:contains("Hello Fabien")')->count()); 16 | } 17 | 18 | public function testSecureSection() 19 | { 20 | $client = static::createClient(); 21 | 22 | // goes to the secure page 23 | $crawler = $client->request('GET', '/demo/secured/hello/World'); 24 | 25 | // redirects to the login page 26 | $crawler = $client->followRedirect(); 27 | 28 | // submits the login form 29 | $form = $crawler->selectButton('Login')->form(array('_username' => 'admin', '_password' => 'adminpass')); 30 | $client->submit($form); 31 | 32 | // redirect to the original page (but now authenticated) 33 | $crawler = $client->followRedirect(); 34 | 35 | // check that the page is the right one 36 | $this->assertCount(1, $crawler->filter('h1.title:contains("Hello World!")')); 37 | 38 | // click on the secure link 39 | $link = $crawler->selectLink('Hello resource secured')->link(); 40 | $crawler = $client->click($link); 41 | 42 | // check that the page is the right one 43 | $this->assertCount(1, $crawler->filter('h1.title:contains("secured for Admins only!")')); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /MyApplication/src/Acme/DemoBundle/Twig/Extension/DemoExtension.php: -------------------------------------------------------------------------------- 1 | loader = $loader; 15 | } 16 | 17 | public function setController($controller) 18 | { 19 | $this->controller = $controller; 20 | } 21 | 22 | /** 23 | * {@inheritdoc} 24 | */ 25 | public function getFunctions() 26 | { 27 | return array( 28 | new \Twig_SimpleFunction('code', array($this, 'getCode'), array('is_safe' => array('html'))), 29 | ); 30 | } 31 | 32 | public function getCode($template) 33 | { 34 | // highlight_string highlights php code only if 'getControllerCode(), true); 36 | $controller = str_replace('<?php    ', '    ', $controller); 37 | 38 | $template = htmlspecialchars($this->getTemplateCode($template), ENT_QUOTES, 'UTF-8'); 39 | 40 | // remove the code block 41 | $template = str_replace('{% set code = code(_self) %}', '', $template); 42 | 43 | return <<Controller Code

    45 |
    $controller
    46 | 47 |

    Template Code

    48 |
    $template
    49 | EOF; 50 | } 51 | 52 | protected function getControllerCode() 53 | { 54 | $class = get_class($this->controller[0]); 55 | if (class_exists('CG\Core\ClassUtils')) { 56 | $class = ClassUtils::getUserClass($class); 57 | } 58 | 59 | $r = new \ReflectionClass($class); 60 | $m = $r->getMethod($this->controller[1]); 61 | 62 | $code = file($r->getFilename()); 63 | 64 | return ' '.$m->getDocComment()."\n".implode('', array_slice($code, $m->getStartline() - 1, $m->getEndLine() - $m->getStartline() + 1)); 65 | } 66 | 67 | protected function getTemplateCode($template) 68 | { 69 | return $this->loader->getSource($template->getTemplateName()); 70 | } 71 | 72 | /** 73 | * Returns the name of the extension. 74 | * 75 | * @return string The extension name 76 | */ 77 | public function getName() 78 | { 79 | return 'demo'; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /MyApplication/src/AppBundle/AppBundle.php: -------------------------------------------------------------------------------- 1 | the action is restricted to GET HTTP method 20 | * Article => (without s) generate /articles/SOMETHING 21 | * Action => standard things for symfony for a controller method which 22 | * generate an output 23 | * 24 | * it generates so the route GET .../articles/{id} 25 | * 26 | * @return Article 27 | */ 28 | public function getArticleAction(Article $article) 29 | { 30 | return $article; 31 | } 32 | 33 | /** 34 | * retrieve all articles 35 | * TODO: add pagination 36 | * 37 | * @return Article[] 38 | */ 39 | public function getArticlesAction() 40 | { 41 | $articles = $this 42 | ->getDoctrine() 43 | ->getRepository('AppBundle:Article') 44 | ->findAll(); 45 | 46 | return $articles; 47 | } 48 | 49 | /** 50 | * 51 | */ 52 | public function postArticlesAction(Request $request) 53 | { 54 | //TODO: there's a simpler method using FOSRestBundle body converter 55 | 56 | // that's the reason why we need to be able to create 57 | // an article without body or title, to use it as 58 | // a placeholder for the form 59 | $article = new Article(); 60 | $errors = $this->treatAndValidateRequest($article, $request); 61 | if (count($errors) > 0) { 62 | return new View( 63 | $errors, 64 | Response::HTTP_UNPROCESSABLE_ENTITY 65 | ); 66 | } 67 | 68 | $this->persistAndFlush($article); 69 | // created => 201, we need View here because we're not 70 | // returning the default 200 71 | return new View($article, Response::HTTP_CREATED); 72 | } 73 | 74 | 75 | /** 76 | * 77 | */ 78 | public function putArticleAction(Article $article, Request $request) 79 | { 80 | 81 | // yes we replace totally the old article by a new one 82 | // except the id, because that's how PUT works 83 | // if you just want to "merge" you want to use PATCH, not PUT 84 | $id = $article->getId(); 85 | $article = new Article(); 86 | $article->setId($id); 87 | 88 | $errors = $this->treatAndValidateRequest($article, $request); 89 | if (count($errors) > 0) { 90 | return new View( 91 | $errors, 92 | Response::HTTP_UNPROCESSABLE_ENTITY 93 | ); 94 | } 95 | 96 | $this->persistAndFlush($article); 97 | 98 | return ""; 99 | } 100 | 101 | /** 102 | * fill $article with the json send in request and validates it 103 | * 104 | * returns an array of errors (empty if everything is ok) 105 | * 106 | * @return array 107 | */ 108 | private function treatAndValidateRequest(Article $article, Request $request) 109 | { 110 | // createForm is provided by the parent class 111 | $form = $this->createForm( 112 | new ArticleType(), 113 | $article, 114 | array( 115 | 'method' => $request->getMethod() 116 | ) 117 | ); 118 | // this method is the one that will use the value in the POST 119 | // to update $article 120 | $form->handleRequest($request); 121 | 122 | // we use it like that instead of the standard $form->isValid() 123 | // because the json generated 124 | // is much readable than the one by serializing $form->getErrors() 125 | $errors = $this->get('validator')->validate($article); 126 | return $errors; 127 | } 128 | 129 | private function persistAndFlush(Article $article) 130 | { 131 | $manager = $this->getDoctrine()->getManager(); 132 | $manager->persist($article); 133 | $manager->flush(); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /MyApplication/src/AppBundle/Controller/DefaultController.php: -------------------------------------------------------------------------------- 1 | render('default/index.html.twig'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MyApplication/src/AppBundle/Entity/Article.php: -------------------------------------------------------------------------------- 1 | title = $title; 46 | $this->body = $body; 47 | } 48 | 49 | /** 50 | * @return string 51 | */ 52 | public function getTitle() 53 | { 54 | return $this->title; 55 | } 56 | 57 | /** 58 | * @param string $title 59 | * 60 | * @return Self 61 | */ 62 | public function setTitle($title) 63 | { 64 | $this->title = $title; 65 | 66 | return $this; 67 | } 68 | 69 | /** 70 | * @return string 71 | */ 72 | public function getBody() 73 | { 74 | return $this->body; 75 | } 76 | 77 | /** 78 | * @param string $body 79 | * 80 | * @return Self 81 | */ 82 | public function setBody($body) 83 | { 84 | $this->body = $body; 85 | 86 | return $this; 87 | } 88 | 89 | /** 90 | * TODO: we should use a factory-like method instead of letting in the wild 91 | * a method that can change the id 92 | */ 93 | public function setId($id) 94 | { 95 | $this->id = $id; 96 | return $this; 97 | } 98 | 99 | public function getId() 100 | { 101 | return $this->id; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /MyApplication/src/AppBundle/Form/ArticleType.php: -------------------------------------------------------------------------------- 1 | add('title') 19 | ->add('body') 20 | ; 21 | } 22 | 23 | /** 24 | * @param OptionsResolverInterface $resolver 25 | */ 26 | public function setDefaultOptions(OptionsResolverInterface $resolver) 27 | { 28 | $resolver->setDefaults( 29 | [ 30 | 'csrf_protection' => false, 31 | 'data_class' => 'AppBundle\Entity\Article', 32 | ] 33 | ); 34 | } 35 | 36 | /** 37 | * @return string 38 | */ 39 | public function getName() 40 | { 41 | // this is important in order to be able 42 | // to provide the entity directly in the json 43 | return ''; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /MyApplication/src/AppBundle/Resources/config/api-routing.yml: -------------------------------------------------------------------------------- 1 | blog_api_articles: 2 | type: rest 3 | resource: "@AppBundle/Controller/ArticlesController.php" 4 | name_prefix: api_articles_ 5 | -------------------------------------------------------------------------------- /MyApplication/src/AppBundle/Tests/Controller/DefaultControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/app/example'); 14 | 15 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); 16 | $this->assertTrue($crawler->filter('html:contains("Homepage")')->count() > 0); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MyApplication/web/.htaccess: -------------------------------------------------------------------------------- 1 | # Use the front controller as index file. It serves as a fallback solution when 2 | # every other rewrite/redirect fails (e.g. in an aliased environment without 3 | # mod_rewrite). Additionally, this reduces the matching process for the 4 | # start page (path "/") because otherwise Apache will apply the rewriting rules 5 | # to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl). 6 | DirectoryIndex app.php 7 | 8 | # Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve 9 | # to the front controller "/app.php" but be rewritten to "/app.php/app". 10 | 11 | Options -MultiViews 12 | 13 | 14 | 15 | RewriteEngine On 16 | 17 | # Determine the RewriteBase automatically and set it as environment variable. 18 | # If you are using Apache aliases to do mass virtual hosting or installed the 19 | # project in a subdirectory, the base path will be prepended to allow proper 20 | # resolution of the app.php file and to redirect to the correct URI. It will 21 | # work in environments without path prefix as well, providing a safe, one-size 22 | # fits all solution. But as you do not need it in this case, you can comment 23 | # the following 2 lines to eliminate the overhead. 24 | RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 25 | RewriteRule ^(.*) - [E=BASE:%1] 26 | 27 | # Sets the HTTP_AUTHORIZATION header removed by apache 28 | RewriteCond %{HTTP:Authorization} . 29 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 30 | 31 | # Redirect to URI without front controller to prevent duplicate content 32 | # (with and without `/app.php`). Only do this redirect on the initial 33 | # rewrite by Apache and not on subsequent cycles. Otherwise we would get an 34 | # endless redirect loop (request -> rewrite to front controller -> 35 | # redirect -> request -> ...). 36 | # So in case you get a "too many redirects" error or you always get redirected 37 | # to the start page because your Apache does not expose the REDIRECT_STATUS 38 | # environment variable, you have 2 choices: 39 | # - disable this feature by commenting the following 2 lines or 40 | # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the 41 | # following RewriteCond (best solution) 42 | RewriteCond %{ENV:REDIRECT_STATUS} ^$ 43 | RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] 44 | 45 | # If the requested filename exists, simply serve it. 46 | # We only want to let Apache serve files and not directories. 47 | RewriteCond %{REQUEST_FILENAME} -f 48 | RewriteRule .? - [L] 49 | 50 | # Rewrite all other queries to the front controller. 51 | RewriteRule .? %{ENV:BASE}/app.php [L] 52 | 53 | 54 | 55 | 56 | # When mod_rewrite is not available, we instruct a temporary redirect of 57 | # the start page to the front controller explicitly so that the website 58 | # and the generated links can still be used. 59 | RedirectMatch 302 ^/$ /app.php/ 60 | # RedirectTemp cannot be used instead 61 | 62 | 63 | -------------------------------------------------------------------------------- /MyApplication/web/app.php: -------------------------------------------------------------------------------- 1 | unregister(); 15 | $apcLoader->register(true); 16 | */ 17 | 18 | require_once __DIR__.'/../app/AppKernel.php'; 19 | //require_once __DIR__.'/../app/AppCache.php'; 20 | 21 | $kernel = new AppKernel('prod', false); 22 | $kernel->loadClassCache(); 23 | //$kernel = new AppCache($kernel); 24 | 25 | // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter 26 | //Request::enableHttpMethodParameterOverride(); 27 | $request = Request::createFromGlobals(); 28 | $response = $kernel->handle($request); 29 | $response->send(); 30 | $kernel->terminate($request, $response); 31 | -------------------------------------------------------------------------------- /MyApplication/web/app_dev.php: -------------------------------------------------------------------------------- 1 | loadClassCache(); 27 | $request = Request::createFromGlobals(); 28 | $response = $kernel->handle($request); 29 | $response->send(); 30 | $kernel->terminate($request, $response); 31 | -------------------------------------------------------------------------------- /MyApplication/web/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allan-simon/symfony2-rest-api-example/1a9fd0d26f9db1d88b5c1ea01d707147c0a49694/MyApplication/web/apple-touch-icon.png -------------------------------------------------------------------------------- /MyApplication/web/config.php: -------------------------------------------------------------------------------- 1 | getFailedRequirements(); 20 | $minorProblems = $symfonyRequirements->getFailedRecommendations(); 21 | 22 | ?> 23 | 24 | 25 | 26 | 27 | 28 | Symfony Configuration 29 | 30 | 31 | 32 | 33 | 34 |
    35 |
    36 | 39 | 40 | 60 |
    61 | 62 |
    63 |
    64 |
    65 |

    Welcome!

    66 |

    Welcome to your new Symfony project.

    67 |

    68 | This script will guide you through the basic configuration of your project. 69 | You can also do the same by editing the ‘app/config/parameters.yml’ file directly. 70 |

    71 | 72 | 73 |

    Major problems

    74 |

    Major problems have been detected and must be fixed before continuing:

    75 |
      76 | 77 |
    1. getHelpHtml() ?>
    2. 78 | 79 |
    80 | 81 | 82 | 83 |

    Recommendations

    84 |

    85 | Additionally, toTo enhance your Symfony experience, 86 | it’s recommended that you fix the following: 87 |

    88 |
      89 | 90 |
    1. getHelpHtml() ?>
    2. 91 | 92 |
    93 | 94 | 95 | hasPhpIniConfigIssue()): ?> 96 |

    * 97 | getPhpIniConfigPath()): ?> 98 | Changes to the php.ini file must be done in "getPhpIniConfigPath() ?>". 99 | 100 | To change settings, create a "php.ini". 101 | 102 |

    103 | 104 | 105 | 106 |

    Your configuration looks good to run Symfony.

    107 | 108 | 109 | 118 |
    119 |
    120 |
    121 |
    Symfony Standard Edition
    122 |
    123 | 124 | 125 | -------------------------------------------------------------------------------- /MyApplication/web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allan-simon/symfony2-rest-api-example/1a9fd0d26f9db1d88b5c1ea01d707147c0a49694/MyApplication/web/favicon.ico -------------------------------------------------------------------------------- /MyApplication/web/robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 3 | 4 | User-agent: * 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Symfony2 rest API example 2 | 3 | This project is meant to be an application of the tutorial created here: 4 | [http://allan-simon.github.io/blog/posts/create-a-rest-api-with-symfony2/](http://allan-simon.github.io/blog/posts/create-a-rest-api-with-symfony2/) 5 | 6 | the reader is adviced to read through the history of commits as well 7 | as the code itself as it is heavily commented in order to serve as a 8 | base of example for people wanting to create a REST Api with symfony2 9 | 10 | The application code is located in `MyApplication/` folder 11 | 12 | `provisioning` contains the ansible playbook and roles to provision a machine to run the project 13 | 14 | ## Concerning the database 15 | 16 | to make sure the database is up to date, run the command 17 | 18 | ``` 19 | php app/console doctrine:migrations:migrate 20 | ``` 21 | 22 | in the folder `/vagrant/MyApplication/` of the vagrant machine 23 | 24 | also make sure your `app/config/parameters.yml` has the driver set to `pdo_pgsql` 25 | and the username password to `vagrant` 26 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | ## Define some app-specific stuff to be used later during provisioning: ## 5 | app_vars = { 6 | APPNAME: 'MyApplication', 7 | DBNAME: 'symfony', 8 | DBUSER: 'vagrant', 9 | DBPASSWORD: 'vagrant' 10 | } 11 | # ansible_verbosity = 'vvvv' 12 | ########################################################################## 13 | 14 | #Fix for people with strange locale settings 15 | ENV.keys.each {|k| k.start_with?('LC_') && ENV.delete(k)} 16 | 17 | def host_box_is_unixy? 18 | (RUBY_PLATFORM !~ /cygwin|mswin|mingw|bccwin|wince|emx/) 19 | end 20 | 21 | Vagrant.configure(2) do |config| 22 | config.vm.box = "ubuntu/trusty64" 23 | 24 | verbosity_arg = if defined? ansible_verbosity then ansible_verbosity else '' end 25 | if host_box_is_unixy? 26 | config.vm.synced_folder "./", "/vagrant", type: "nfs" 27 | config.vm.provision :ansible do |ansible| 28 | ansible.playbook = 'provisioning/site.yml' 29 | ansible.extra_vars = app_vars 30 | ansible.verbose = verbosity_arg 31 | end 32 | else 33 | config.vm.synced_folder "./", "/vagrant", type: "smb", mount_options: ['ip=192.168.50.1'] #host side of :private_network 34 | extra_vars_arg = '{' + app_vars.map{|k,v| '"' + k.to_s + '":"' + v.to_s + '"'}.join(',') + '}' 35 | 36 | config.vm.provision :shell, :inline => <<-END 37 | set -e 38 | if ! which ansible-playbook ; then 39 | echo "Windows host environment: the devbox will install Ansible and self-provision itself" >&2 40 | sudo apt-get update 41 | sudo apt-get -y install python-software-properties 42 | sudo add-apt-repository ppa:ansible/ansible 43 | sudo apt-get update 44 | sudo apt-get -y install ansible 45 | fi 46 | PYTHONUNBUFFERED=1 ansible-playbook --connection=local -i "[default] $(hostname)," \\ 47 | --extra-vars='#{ extra_vars_arg }' #{ verbosity_arg.empty? ? '' : '-'+ansible_verbosity } /vagrant/provisioning/site.yml 48 | END 49 | end 50 | 51 | config.vm.network "forwarded_port", guest: 8000, host: 8000 52 | config.vm.network "forwarded_port", guest: 80, host: 8181 53 | config.vm.network "private_network", ip: "192.168.50.4" 54 | 55 | config.vm.provider "virtualbox" do |v| 56 | v.memory = 2048 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /provisioning/roles/apache/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart Apache 3 | service: name=apache2 state=restarted 4 | 5 | -------------------------------------------------------------------------------- /provisioning/roles/apache/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: APT install package 3 | apt: name=apache2 4 | 5 | - name: enable FastCGI module 6 | apache2_module: name=proxy_fcgi 7 | 8 | - name: enable Rewrite module 9 | apache2_module: name=rewrite 10 | -------------------------------------------------------------------------------- /provisioning/roles/hhvm/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart HHVM 3 | service: name=hhvm state=restarted 4 | -------------------------------------------------------------------------------- /provisioning/roles/hhvm/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: (purge PHP5-) 3 | apt: name=libapache2-mod-php5,php5-cli state=absent 4 | 5 | - name: software-properties common components 6 | apt: name=software-properties-common 7 | 8 | - name: APT add signing key 9 | apt_key: url=http://dl.hhvm.com/conf/hhvm.gpg.key 10 | 11 | - name: APT add repository 12 | apt_repository: repo="deb http://dl.hhvm.com/ubuntu trusty main" 13 | 14 | - name: APT install package 15 | apt: name=hhvm 16 | 17 | - include: pdo_psql.yml 18 | -------------------------------------------------------------------------------- /provisioning/roles/hhvm/tasks/pdo_psql.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /provisioning/roles/php/files/php-extra.ini: -------------------------------------------------------------------------------- 1 | ; priority=90 2 | date.timezone = Asia/Phnom_Penh 3 | 4 | [xdebug] 5 | xdebug.default_enable = 1 6 | xdebug.idekey = "sublime.xdebug" 7 | xdebug.max_nesting_level=250 8 | xdebug.remote_enable = 1 9 | xdebug.remote_autostart = 0 10 | xdebug.remote_handler=dbgp 11 | xdebug.remote_log="/tmp/xdebug.log" 12 | xdebug.remote_host=10.0.2.2 13 | -------------------------------------------------------------------------------- /provisioning/roles/php/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart PHP5-FPM 3 | service: name=php5-fpm state=restarted 4 | -------------------------------------------------------------------------------- /provisioning/roles/php/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: (purge HHVM) 3 | apt: name=hhvm state=absent 4 | 5 | - name: PHP 5.x and extensions 6 | apt: name={{ item }} 7 | with_items: 8 | - php5-cli 9 | - php5-curl 10 | - php5-fpm 11 | - php5-pgsql 12 | - php5-xdebug 13 | - php5-intl 14 | notify: 15 | restart Apache 16 | 17 | - name: copy php.ini customizations 18 | copy: src=php-extra.ini dest=/etc/php5/mods-available/extra.ini 19 | notify: 20 | - restart PHP5-FPM 21 | 22 | - name: enable php.ini customizations 23 | command: creates=/etc/php5/fpm/conf.d/90-extra.ini 24 | php5enmod extra 25 | -------------------------------------------------------------------------------- /provisioning/roles/postgresql/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: PostgreSQL server and client 3 | apt: name=postgresql-9.3,libpq-dev,python-psycopg2 4 | 5 | - name: PostgreSQL database user 6 | sudo_user: postgres 7 | postgresql_user: name={{ DBUSER }} password={{ DBPASSWORD }} 8 | 9 | - name: PostgreSQL database init 10 | sudo_user: postgres 11 | postgresql_db: name={{ DBNAME }} owner={{ DBUSER }} 12 | 13 | # - name: PostgreSQL database grants 14 | # sudo_user: postgres 15 | # postgresql_privs: db=symfony role=vagrant objs=ALL_IN_SCHEMA priv=ALL 16 | -------------------------------------------------------------------------------- /provisioning/roles/symfony/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: setup PHP Composer 3 | shell: creates=composer.phar chdir={{ APPCOMMONDIR }} 4 | curl -sS https://getcomposer.org/installer | php 5 | sudo_user: vagrant 6 | 7 | - name: setup framework installer 8 | shell: creates=symfony.phar chdir={{ APPCOMMONDIR }} 9 | curl -LsS http://symfony.com/installer > symfony.phar 10 | sudo_user: vagrant 11 | 12 | - name: make framework installer executable 13 | file: path={{ APPCOMMONDIR }}/symfony.phar mode='ugo+x' 14 | 15 | - name: symlink PHAR files 16 | file: src={{ APPCOMMONDIR }}/{{item}}.phar dest=/usr/local/bin/{{item}} state=link 17 | with_items: 18 | - composer 19 | - symfony 20 | -------------------------------------------------------------------------------- /provisioning/roles/vagrantbox/files/php.ini: -------------------------------------------------------------------------------- 1 | ; php options 2 | session.save_handler = files 3 | session.save_path = /var/lib/php5 4 | session.gc_maxlifetime = 1440 5 | 6 | ; hhvm specific 7 | hhvm.log.level = Warning 8 | hhvm.log.always_log_unhandled_exceptions = true 9 | hhvm.log.runtime_error_reporting_level = 8191 10 | hhvm.mysql.typed_results = false 11 | hhvm.libxml.ext_entity_whitelist = file,http 12 | 13 | date.timezone = Asia/Phnom_Penh 14 | 15 | [xdebug] 16 | xdebug.default_enable = 1 17 | xdebug.idekey = "sublime.xdebug" 18 | xdebug.max_nesting_level=250 19 | xdebug.remote_enable = 1 20 | xdebug.remote_autostart = 0 21 | xdebug.remote_handler=dbgp 22 | xdebug.remote_log="/tmp/xdebug.log" 23 | xdebug.remote_host=10.0.2.2 24 | -------------------------------------------------------------------------------- /provisioning/roles/vagrantbox/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart SSH 3 | service: name=ssh state=restarted 4 | 5 | - name: enable swapping 6 | command: swapon -a 7 | -------------------------------------------------------------------------------- /provisioning/roles/vagrantbox/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: disable SSHd reverse DNS lookup 3 | lineinfile: dest=/etc/ssh/sshd_config 4 | regexp='^\s*#*\s*UseDNS' 5 | line='UseDNS no' 6 | insertafter=EOF 7 | notify: 8 | restart SSH 9 | 10 | - name: probe for HHVM init 11 | stat: path=/etc/init.d/hhvm 12 | register: hhvm 13 | 14 | - include: vagrantify_apache.yml 15 | 16 | - include: vagrantify_hhvm.yml 17 | when: hhvm.stat.exists 18 | 19 | - include: vagrantify_php5-fpm.yml 20 | when: not hhvm.stat.exists 21 | 22 | - include: vm_swapfile.yml 23 | -------------------------------------------------------------------------------- /provisioning/roles/vagrantbox/tasks/vagrantify_apache.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: apache | disable default site 3 | command: removes=/etc/apache2/sites-enabled/000-default.conf 4 | a2dissite 000-default 5 | notify: 6 | restart Apache 7 | 8 | - name: apache | run process under the 'vagrant' user account 9 | lineinfile: dest=/etc/apache2/envvars 10 | regexp='export {{ item }}' 11 | line='export {{ item }}=vagrant' 12 | with_items: 13 | - APACHE_RUN_USER 14 | - APACHE_RUN_GROUP 15 | notify: 16 | restart Apache 17 | -------------------------------------------------------------------------------- /provisioning/roles/vagrantbox/tasks/vagrantify_hhvm.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: hhvm | php.ini customization 3 | copy: src=php.ini dest=/etc/hhvm/php.ini 4 | notify: 5 | restart HHVM 6 | 7 | - name: hhvm | run process under the 'vagrant' user account 8 | lineinfile: dest=/etc/init.d/hhvm 9 | regexp='^{{ item }}=' 10 | line='{{ item }}="vagrant"' 11 | with_items: 12 | - RUN_AS_USER 13 | - RUN_AS_GROUP 14 | notify: 15 | restart HHVM 16 | -------------------------------------------------------------------------------- /provisioning/roles/vagrantbox/tasks/vagrantify_php5-fpm.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: php5-fpm | start application after the /vagrant share has become available 3 | lineinfile: dest=/etc/init/php5-fpm.conf 4 | regexp='^start on' 5 | line='start on vagrant-mounted' 6 | 7 | - name: php5-fpm | don't hide error logs while in development 8 | replace: dest=/etc/php5/fpm/php.ini 9 | regexp='^(display(_startup)?_errors).*' 10 | replace='\1 = On' 11 | notify: restart PHP5-FPM 12 | -------------------------------------------------------------------------------- /provisioning/roles/vagrantbox/tasks/vm_swapfile.yml: -------------------------------------------------------------------------------- 1 | - name: create system swapfile 2 | shell: creates=/.swapfile 3 | umask u=rw,go= 4 | && dd if=/dev/zero of=/.swapfile bs=1M count=512 5 | && mkswap /.swapfile 6 | 7 | - name: add swapfile to fstab 8 | lineinfile: dest=/etc/fstab 9 | regexp="/.swapfile" 10 | line="/.swapfile none swap sw 0 0" 11 | state=present 12 | notify: 13 | enable swapping 14 | 15 | - name: set swapiness to minimum 16 | sysctl: 17 | name: vm.swappiness 18 | value: "1" 19 | -------------------------------------------------------------------------------- /provisioning/roles/webapp/files/Symfony.gitignore: -------------------------------------------------------------------------------- 1 | # Cache and logs (Symfony2) 2 | /app/cache/* 3 | /app/logs/* 4 | !app/cache/.gitkeep 5 | !app/logs/.gitkeep 6 | 7 | # Cache and logs (Symfony3) 8 | /var/cache/* 9 | /var/logs/* 10 | !var/cache/.gitkeep 11 | !var/logs/.gitkeep 12 | 13 | # Parameters 14 | /app/config/parameters.yml 15 | /app/config/parameters.ini 16 | 17 | # Managed by Composer 18 | /app/bootstrap.php.cache 19 | /var/bootstrap.php.cache 20 | /bin/* 21 | !bin/console 22 | !bin/symfony_requirements 23 | /vendor/ 24 | 25 | # Assets and user uploads 26 | /web/bundles/ 27 | /web/uploads/ 28 | 29 | # PHPUnit 30 | /app/phpunit.xml 31 | /phpunit.xml 32 | 33 | # Build data 34 | /build/ 35 | 36 | # Composer PHAR 37 | /composer.phar 38 | -------------------------------------------------------------------------------- /provisioning/roles/webapp/tasks/init_app_via_composer.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: initialize application via composer.phar 3 | sudo_user: vagrant 4 | command: creates={{ APPDIR }}/ 5 | /vagrant/composer.phar create-project --no-interaction --quiet symfony/framework-standard-edition {{ APPDIR }} 6 | -------------------------------------------------------------------------------- /provisioning/roles/webapp/tasks/init_app_via_installer.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: initialize application via symfony.phar 3 | sudo_user: vagrant 4 | shell: creates={{ APPDIR }}/ chdir=/tmp 5 | symfony new --no-interaction --quiet {{ APPNAME }}-install 6 | && mv {{ APPNAME }}-install {{ APPDIR }} 7 | 8 | -------------------------------------------------------------------------------- /provisioning/roles/webapp/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: initialize application 3 | sudo_user: vagrant 4 | # include: init_app_via_composer.yml 5 | include: init_app_via_installer.yml 6 | 7 | - name: default gitignore 8 | copy: src=Symfony.gitignore dest={{ APPDIR }}/.gitignore force=no 9 | 10 | - name: add container - Apache VirtualHost 11 | template: src=apache2.vhost.j2 dest=/etc/apache2/sites-available/{{ APPNAME }}.conf 12 | notify: 13 | restart Apache 14 | 15 | - name: add FastCGI worker pool 16 | template: src=php-fpm-pool.conf.j2 dest=/etc/php5/fpm/pool.d/{{ APPNAME }}.conf 17 | notify: 18 | restart PHP5-FPM 19 | 20 | - name: enable container - Apache VirtualHost 21 | command: creates=/etc/apache2/sites-enabled/{{ APPNAME }}.conf 22 | a2ensite {{ APPNAME }} 23 | notify: 24 | restart Apache 25 | -------------------------------------------------------------------------------- /provisioning/roles/webapp/templates/apache2.vhost.j2: -------------------------------------------------------------------------------- 1 | 2 | ServerName Symfony 3 | ServerAlias Symfony 4 | 5 | ErrorLog /var/log/apache2/project_error.log 6 | CustomLog /var/log/apache2/project_access.log combined 7 | 8 | # used for http basic auth and oauth2 bearer token 9 | SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1 10 | 11 | SetEnv SYMFONY__DATABASE__USER {{ DBUSER }} 12 | SetEnv SYMFONY__DATABASE__PASSWORD {{ DBPASSWORD }} 13 | 14 | DocumentRoot {{ APPWEBROOT }} 15 | 16 | AllowOverride None 17 | Require all granted 18 | 19 | ## Start directives copied from standard Sf .htaccess 20 | DirectoryIndex app.php 21 | 22 | RewriteEngine On 23 | 24 | RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 25 | RewriteRule ^(.*) - [E=BASE:%1] 26 | 27 | RewriteCond %{ENV:REDIRECT_STATUS} ^$ 28 | RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] 29 | 30 | RewriteCond %{REQUEST_FILENAME} -f 31 | RewriteCond %{REQUEST_URI} .*\.php 32 | # Need to add the phpfpm call here so that php files (including app_dev.php) are passed to FPM 33 | RewriteRule ^(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/%{REQUEST_FILENAME} [P,END] 34 | 35 | RewriteCond %{REQUEST_FILENAME} -f 36 | RewriteRule .? - [L] 37 | 38 | RewriteRule .? %{ENV:BASE}/app.php [L] 39 | 40 | # The main phpfpm call is added at the end to pass php requests through to FPM 41 | RewriteRule ^(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/%{REQUEST_FILENAME} [P,END] 42 | 43 | ## End directives copied from standard Sf .htaccess 44 | 45 | 46 | -------------------------------------------------------------------------------- /provisioning/roles/webapp/templates/php-fpm-pool.conf.j2: -------------------------------------------------------------------------------- 1 | [{{ APPNAME }}] 2 | 3 | user = {{ APPUSER }} 4 | group = {{ APPUSER }} 5 | 6 | listen = 127.0.0.1:9000 7 | listen.owner = {{ APPUSER }} 8 | listen.group = {{ APPUSER }} 9 | 10 | pm = dynamic 11 | pm.max_children = 5 12 | pm.start_servers = 2 13 | pm.min_spare_servers = 1 14 | pm.max_spare_servers = 3 15 | 16 | chdir = {{ APPDIR }} 17 | -------------------------------------------------------------------------------- /provisioning/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | sudo: yes 4 | vars: 5 | APPDIR: "/vagrant/{{ APPNAME }}" 6 | when: APPNAME is defined 7 | APPWEBROOT: "{{ APPDIR }}/web" 8 | when: APPNAME is defined 9 | APPCOMMONDIR: "/vagrant" 10 | APPUSER: "vagrant" 11 | 12 | pre_tasks: 13 | - name: check last APT update time 14 | apt: update_cache=yes cache_valid_time=86400 15 | 16 | roles: 17 | - apache 18 | - postgresql 19 | # - hhvm 20 | - php 21 | - symfony 22 | - { role: webapp, when: APPNAME is defined } 23 | - vagrantbox 24 | --------------------------------------------------------------------------------