Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The State of Symfony in the Cloud

The State of Symfony in the Cloud

Fabien Potencier

December 01, 2016
Tweet

More Decks by Fabien Potencier

Other Decks in Technology

Transcript

  1. "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
  2. 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.
  3. 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...
  4. class AppKernel extends Kernel { // ... public function getCacheDir()

    { return dirname(__DIR__).'/var/cache/'.$this->getEnvironment(); } public function getLogDir() { return dirname(__DIR__).'/var/logs'; } }
  5. 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.
  6. 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.
  7. 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!
  8. 3.2

  9. 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: "*"