The State of Symfony in the Cloud

The State of Symfony in the Cloud

9a22d09f92d50fa3d2a16766d0ba52f8?s=128

Fabien Potencier

December 01, 2016
Tweet

Transcript

  1. 2.
  2. 3.

    "The most common way to deploy a project to production

    is to transfer all its files by FTP (or SFTP). [...] the symfony lib/ and data/ directories are linked by svn:externals
  3. 4.

    Sending the root project directory by FTP is fine for

    the first transfer, but when you need to upload an update of your application, where only a few files have changed, FTP is not ideal.
  4. 5.

    The solution that is supported by symfony is rsync synchronization

    through an SSH layer. More and more commercial hosts support an SSH tunnel to secure file uploads on their servers...
  5. 14.

    class AppKernel extends Kernel { // ... public function getCacheDir()

    { return dirname(__DIR__).'/var/cache/'.$this->getEnvironment(); } public function getLogDir() { return dirname(__DIR__).'/var/logs'; } }
  6. 16.

    There is a big problem to build a site in

    a temporary directory, warm up the cache for production mode on the build server and then rsyncing it to the production server into another directory.
  7. 17.
  8. 18.
  9. 19.
  10. 20.
  11. 21.

    The biggest problem is the usage of dirname which is

    naive per the PHP documentation: "dirname() operates naively on the input string, and is not aware of the actual filesystem, or path components such as "..".")". ... Looking at this issue again, I think there is no easy fix. Using dirname() will indeed work but as noted by @jakzal, the cache dir can be outside of the root dir. In this case, using dirname() won't help.
  12. 22.
  13. 23.
  14. 24.
  15. 25.
  16. 26.
  17. 28.
  18. 29.

    ok so the whole sf2 cache can be warmup from

    now in 1 pass? If you tell me how to accomplish that... I'm very interested!
  19. 30.
  20. 31.

    3.2

  21. 32.
  22. 39.
  23. 43.
  24. 44.

    Infrastructure Configuration {
 "require": {
 "php": ">=5.5.9",
 "silex/silex": "~2.0",
 "silex/web-profiler":

    "~2.0",
 "symfony/asset": "~2.8|3.0.*", pgsqldb:
 type: postgresql:9.6
 disk: 2048
 configuration:
 extensions:
 uuid-ossp
 cache:
 type: redis:3.0 runtime:
 extensions:
 - apcu
 - pdo_pgsql
 - redis
 dependencies:
 python:
 sphinx: "1.3"
 ruby:
 sass: "*"