Post on 17-Jun-2015
description
transcript
PHP-FIG: PAST, PRESENT AND FUTURE
@PHILSTURGEON #PHPJOBURG14
HUMBLE BEGINNINGSBACK IN ANCIENT 2009
http://healthland.time.com/2012/04/27/humility-a-quiet-underappreciated-strength/
PSR-0AUTOLOADING STUFF
Not many people cared…
… including me
PSR-0AUTOLOADING STUFF
vendor/PEAR/Mail/SMTP.php
vendor/Symfony/Core/Request.php
vendor/Zend/Mail/Message.php
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
NOT SO HUMBLE BITSGRUMBLE GRUMBLE
wiki.php.net/rfc/splclassloader
fig.php.net
26 for, 21 against = nope
PSR-1 & 2A.K.A TABS V SPACES
MY INVOLVEMENTBRITISH INVASION
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');
PSR-3LOGGING SOUNDS EASY, BUT…
StreamHandlerRotatingFileHandl
erSyslogHandler
ErrorLogHandlerNativeMailerHandl
erSwiftMailerHandlerPushoverHandlerHipChatHandler
FlowdockHandlerSocketHandler
AmqpHandlerGelfHandlerCubeHandlerRavenHandler
ZendMonitorHandler
NewRelicHandlerLogglyHandlerRollbarHandler
SyslogUdpHandlerLogEntriesHandler
FirePHPHandlerChromePHPHandler
BrowserConsoleHandler
RedisHandlerMongoDBHandlerCouchDBHandler
DoctrineCouchDBHandler
ElasticSearchHandlerDynamoDbHandler
STYLE OR LOGGING?SO WHICH IS IT:
SOUNDS LIKE PEPPYTHON DID IT!
legacy.python.org/dev/peps/
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!
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.
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
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
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();
PSR-5DOCBLOCKS ARE FUN
WORKFLOW BYLAWGETTING THINGS ON TRACK
PSR-6
blog.tedivm.com/stash
CACHE ALL THE THINGS!
GETTING THINGS ON TRACK
PSR-7HTTP ADAPTERS ARE NOT FUN
BuzzHttpAdapterCurlHttpAdapterGuzzleHttpAdapt
erSocketHttpAdapt
erZendHttpAdapter
geocoder-php.org
PSR-8
http://en.wikipedia.org/wiki/Free_Hugs_Campaign
pyrocms.com