Skip to content
  • About
    • What is Symfony?
    • Community
    • News
    • Contributing
    • Support
  • Documentation
    • Symfony Docs
    • Symfony Book
    • Screencasts
    • Symfony Bundles
    • Symfony Cloud
    • Training
  • Services
    • Platform.sh for Symfony Best platform to deploy Symfony apps
    • SymfonyInsight Automatic quality checks for your apps
    • Symfony Certification Prove your knowledge and boost your career
    • SensioLabs Professional services to help you with Symfony
    • Blackfire Profile and monitor performance of your apps
  • Other
  • Blog
  • Download
sponsored by
  1. Home
  2. Documentation
  3. Symfony: The Fast Track
  4. Italian
  5. Adottare una metodologia

Adottare una metodologia

Insegnare significa ripetere la stessa cosa più volte. Non lo farò, lo prometto. Alla fine di ogni passo dovresti fare un balletto e salvare il lavoro fatto fino a quel momento: è come premere Ctrl+S ma per un sito web.

Implementare una strategia con Git

Alla fine di ogni passo non dimentichiamo di eseguire il commit con le modifiche:

1
2
$ git add .
$ git commit -m'Add some new feature'

Possiamo tranquillamente aggiungere "tutto", dato che Symfony gestisce un file .gitignore per noi. Inoltre ogni pacchetto può aggiungere ulteriori configurazioni. Diamo un'occhiata al contenuto attuale:

.gitignore
1
2
3
4
5
6
7
8
9
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

Le simpatiche stringhe sono dei segnaposto aggiunti da Symfony Flex, in modo che sappia cosa eliminare se decidessimo di rimuovere una dipendenza. Come già detto, tutto il lavoro noioso è fatto da Symfony, non da noi sviluppatori.

Potrebbe essere utile effettuare il push del nostro repository su un server da qualche parte. GitHub, GitLab o Bitbucket sono delle buone scelte.

Note

Eseguendo il deploy su Platform.sh, abbiamo già una copia del repository poiché Platform.sh usa Git dietro le quinte quando si lancia il comando cloud:deploy. Non dovremmo fare affidamento sul repository Git di Platform.sh: infatti il suo scopo è solo per i deploy, non è un backup.

Continuous deploy in produzione

Un'altra buona abitudine è quella di effettuare dei deploy frequentemente. Fare deploy alla fine di ogni passo è considerato una buona prassi:

1
$ symfony cloud:deploy
Previous page Da zero alla produzione
Next page Risoluzione dei problemi
This work, including the code samples, is licensed under a Creative Commons BY-NC-SA 4.0 license.
TOC
    Version

    Symfony 5.4 is backed by

    Online exam, become Symfony certified today

    Online exam, become Symfony certified today

    No stress: we've got you covered with our 116 automated quality checks of your code

    No stress: we've got you covered with our 116 automated quality checks of your code

    Version:
    Locale:
    ebook

    This book is backed by:

    see all backers

    Symfony footer

    Avatar of Raphaëll Roussel, a Symfony contributor

    Thanks Raphaëll Roussel for being a Symfony contributor

    1 commit • 4 lines changed

    View all contributors that help us make Symfony

    Become a Symfony contributor

    Be an active part of the community and contribute ideas, code and bug fixes. Both experts and newcomers are welcome.

    Learn how to contribute

    Symfony™ is a trademark of Symfony SAS. All rights reserved.

    • What is Symfony?

      • What is Symfony?
      • Symfony at a Glance
      • Symfony Components
      • Symfony Releases
      • Security Policy
      • Logo & Screenshots
      • Trademark & Licenses
      • symfony1 Legacy
    • Learn Symfony

      • Symfony Docs
      • Symfony Book
      • Reference
      • Bundles
      • Best Practices
      • Training
      • eLearning Platform
      • Certification
    • Screencasts

      • Learn Symfony
      • Learn PHP
      • Learn JavaScript
      • Learn Drupal
      • Learn RESTful APIs
    • Community

      • Symfony Community
      • SymfonyConnect
      • Events & Meetups
      • Projects using Symfony
      • Contributors
      • Symfony Jobs
      • Backers
      • Code of Conduct
      • Downloads Stats
      • Support
    • Blog

      • All Blog Posts
      • A Week of Symfony
      • Case Studies
      • Cloud
      • Community
      • Conferences
      • Diversity
      • Living on the edge
      • Releases
      • Security Advisories
      • Symfony Insight
      • Twig
      • SensioLabs Blog
    • Services

      • SensioLabs services
      • Train developers
      • Manage your project quality
      • Improve your project performance
      • Host Symfony projects

      Powered by

    Follow Symfony