+ All Categories
Home > Technology > PHP-FIG: Past, Present and Future

PHP-FIG: Past, Present and Future

Date post: 17-Jun-2015
Category:
Upload: phil-sturgeon
View: 1,681 times
Download: 1 times
Share this document with a friend
Description:
In 2009 the PHP-FIG created PSR-0: an autoloading standard that helped to change the landscape of PHP forever, thanks in no small part to its integration with Composer. Well, PSR-0 was built in a land before PHP had namespaces, when Horde and PEAR were prevalent and Composer was but a twinkle in the eye of two developers. In December 2013 PSR-4 was released as a newer, shinier version of that standard. The FIG has more standards happening, some of which may be out just in time for this talk.
Popular Tags:
29
PHP-FIG: PAST, PRESENT AND FUTURE @PHILSTURGEON #PHPJOBURG14
Transcript
Page 1: PHP-FIG: Past, Present and Future

PHP-FIG: PAST, PRESENT AND FUTURE

@PHILSTURGEON #PHPJOBURG14

Page 2: PHP-FIG: Past, Present and Future
Page 3: PHP-FIG: Past, Present and Future
Page 4: PHP-FIG: Past, Present and Future
Page 5: PHP-FIG: Past, Present and Future
Page 6: PHP-FIG: Past, Present and Future
Page 7: PHP-FIG: Past, Present and Future

HUMBLE BEGINNINGSBACK IN ANCIENT 2009

http://healthland.time.com/2012/04/27/humility-a-quiet-underappreciated-strength/

Page 8: PHP-FIG: Past, Present and Future

PSR-0AUTOLOADING STUFF

Not many people cared…

… including me

Page 9: PHP-FIG: Past, Present and Future

PSR-0AUTOLOADING STUFF

vendor/PEAR/Mail/SMTP.php

vendor/Symfony/Core/Request.php

vendor/Zend/Mail/Message.php

Page 10: PHP-FIG: Past, Present and Future

PSR-0AUTOLOADING STUFF

<?php namespace Test\Package\Foo\Bar;

class Baz {}

$instance = new Package\Foo\Bar\Baz();

$instance = new Package\Foo_Bar_Baz();

github.com/philsturgeon/psr0-naming-oddity

Page 11: PHP-FIG: Past, Present and Future

NOT SO HUMBLE BITSGRUMBLE GRUMBLE

wiki.php.net/rfc/splclassloader

fig.php.net

26 for, 21 against = nope

Page 12: PHP-FIG: Past, Present and Future

PSR-1 & 2A.K.A TABS V SPACES

Page 13: PHP-FIG: Past, Present and Future

MY INVOLVEMENTBRITISH INVASION

Page 14: PHP-FIG: Past, Present and Future

PSR-3LOGGING SOUNDS EASY, BUT…

github.com/Seldaek/monolog

$log = new Logger('name');$log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));

// add records to the log$log->addWarning('Foo');$log->addError('Bar');

Page 15: PHP-FIG: Past, Present and Future
Page 16: PHP-FIG: Past, Present and Future

PSR-3LOGGING SOUNDS EASY, BUT…

StreamHandlerRotatingFileHandl

erSyslogHandler

ErrorLogHandlerNativeMailerHandl

erSwiftMailerHandlerPushoverHandlerHipChatHandler

FlowdockHandlerSocketHandler

AmqpHandlerGelfHandlerCubeHandlerRavenHandler

ZendMonitorHandler

NewRelicHandlerLogglyHandlerRollbarHandler

SyslogUdpHandlerLogEntriesHandler

FirePHPHandlerChromePHPHandler

BrowserConsoleHandler

RedisHandlerMongoDBHandlerCouchDBHandler

DoctrineCouchDBHandler

ElasticSearchHandlerDynamoDbHandler

Page 17: PHP-FIG: Past, Present and Future

STYLE OR LOGGING?SO WHICH IS IT:

Page 18: PHP-FIG: Past, Present and Future

SOUNDS LIKE PEPPYTHON DID IT!

legacy.python.org/dev/peps/

Page 19: PHP-FIG: Past, Present and Future

P 4 Deprecation of Standard Modules

P 7 Style Guide for C Code

P 8 Style Guide for Python Code

P 12 Sample reStructured Text PEP Template

SF 234 Iterators

SF 378 Format Specifier for Thousands Separator

SOUNDS LIKE PEPPYTHON DID IT!

Page 20: PHP-FIG: Past, Present and Future

ZEN OF PYTHONLITERALLY ANYTHING

http://legacy.python.org/dev/peps/pep-0020/

Beautiful is better than Explicit is better than implicit.Simple is better than complex.

Complex is better than complicated.

Flat is better than nested.Sparse is better than dense.

Readability counts.

Page 21: PHP-FIG: Past, Present and Future

PSR-4NEW AND SHINY? OR SATAN!!!

vendor/pear/mail/src/PEAR/Mail/SMTP.php

vendor/symfony/framework/src/Symfony/Core/Request.php

vendor/zend/mail/src/Zend/Mail/Message.php

Page 22: PHP-FIG: Past, Present and Future

PSR-4NEW AND SHINY? OR SATAN!!!

vendor/pear/mail/src/SMTP.php

vendor/symfony/framework/src/Core/Request.php

vendor/zend/mail/src/Message.php

Page 23: PHP-FIG: Past, Present and Future

PSR-0vendor/hpatoio/bitly-api/src/Bitly/Api/

BitlyClient.phpnew Bitly\Api\BitlyClient();

PSR-4vendor/hpatoio/bitly-api/src/

BitlyClient.phpnew Bitly\Api\BitlyClient();

PSR-4 (Better)vendor/hpatoio/bitly/src/

Client.phpnew Hpatoio\Bitly\Client();

Page 24: PHP-FIG: Past, Present and Future

PSR-5DOCBLOCKS ARE FUN

Page 25: PHP-FIG: Past, Present and Future

WORKFLOW BYLAWGETTING THINGS ON TRACK

Page 26: PHP-FIG: Past, Present and Future

PSR-6

blog.tedivm.com/stash

CACHE ALL THE THINGS!

GETTING THINGS ON TRACK

Page 27: PHP-FIG: Past, Present and Future

PSR-7HTTP ADAPTERS ARE NOT FUN

BuzzHttpAdapterCurlHttpAdapterGuzzleHttpAdapt

erSocketHttpAdapt

erZendHttpAdapter

geocoder-php.org

Page 28: PHP-FIG: Past, Present and Future

PSR-8

http://en.wikipedia.org/wiki/Free_Hugs_Campaign

Page 29: PHP-FIG: Past, Present and Future

pyrocms.com


Recommended