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

PHP Moderno

PHP Moderno

Jonata Weber

October 23, 2017
Tweet

More Decks by Jonata Weber

Other Decks in Programming

Transcript

  1. PHP
    Moderno
    = 'Jonata Weber' ?>

    View Slide

  2. @JonataWeber

    View Slide

  3. Versões Suportadas

    View Slide

  4. PSRs
    PHP Standards Recommendations
    1 - Basic Coding Standard
    2 - Coding Style Guide
    3 - Logger Interface
    4 - Autoloading Standard
    6 - Caching Interface
    7 - HTTP Message Interface
    11 - Container Interface
    13 - Hypermedia Links
    16 - Simple Cache

    View Slide

  5. composer.json
    {
    "require": {
    "monolog/monolog": "1.0.*"
    }
    }
    php composer.phar install
    http://www.packagist.org

    View Slide

  6. View Slide

  7. Monolog
    github.com/Seldaek/monolog
    IFTTT, SendGrid, Slack, NewRelic,
    Redis, Mongo, etc...

    View Slide

  8. www.phptherightway.com

    View Slide

  9. Model-View-Controller

    View Slide

  10. foo.php

    View Slide

  11. models/FooModel.php
    views/foo-list.php

    View Slide

  12. Anonymous
    Functions
    http://php.net/manual/pt_BR/function
    s.anonymous.php

    View Slide

  13. Anonymous
    Class
    https://secure.php.net/manual/pt_BR
    /language.oop5.anonymous.php

    View Slide

  14. Traits
    http://php.net/manual/pt_BR/languag
    e.oop5.traits.php

    View Slide

  15. Namespaces
    http://php.net/manual/pt_BR/languag
    e.namespaces.php

    View Slide

  16. Generators
    https://secure.php.net/manual/pt_BR
    /language.generators.php

    View Slide

  17. SPL
    Standard PHP Library
    ● Estrutura de Dados
    ● Iteradores
    ● Interfaces
    ● Exceções
    ● Manipulação de Arquivos
    ● Classes e Interfaces Genéricas

    View Slide

  18. Buit in server
    PHP >= 5.4 (2012)
    $ php -S localhost:8000

    View Slide

  19. PHP 7
    https://secure.php.net/manual/pt_BR/migration7
    0.new-features.php
    ● Scalar Type Hints
    ● Return Type Declarations
    ● Spaceship Operator (<=>)
    ● Null Coalesce Operator (??)
    ● Arrays Constantes
    ● Performance

    View Slide

  20. Types

    View Slide

  21. Microframeworks
    ● Silex - silex.sensiolabs.org
    ● Slim - slimframework.com
    ● Lumen - lumen.laravel.com
    ● Zend Expressive

    View Slide

  22. Servers ● PaaS - Plataform as a Service
    ● Virtual ou Dedicated Servers
    ● nginx e PHP-FPM
    ● Docker e Vagrant

    View Slide

  23. Deployment ● Rocketeer
    ● Phing
    ● Deployer

    View Slide

  24. Livecoding

    View Slide

  25. Perguntas?
    @JonataWeber
    bit.ly/ws-cursos

    View Slide

  26. Referências
    ● phptherightway.com
    ● Livro PHP Moderno - O'Reilly
    ● https://www.youtube.com/watch?v=ZQVztAwoHUA

    View Slide