SlideShare a Scribd company logo
The state of
your own
hypertext processor
             Alessandro Nadalin

                27/03/2012
What we had
PEAR / PECL
What we have
What you should
    look at
XHPROF
 https://github.com/facebook/xhprof
Traits
http://php.net/manual/en/language.oop5.traits.php
trait XmlConversion {
    public function toXml() {
      $xml = new SimpleXMLElement('<object></object>');

        foreach($this->getXmlAttributes() as $attribute) {
          $xml->addChild(new ...)
        }

        return $xml->asXml();
    }

    abstract protected function getXmlAttributes();
}

class Person {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

class Log {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
trait XmlConversion {
    public function toXml() {
      $xml = new SimpleXMLElement('<object></object>');

        foreach($this->getXmlAttributes() as $attribute) {
          $xml->addChild(new ...)
        }

        return $xml->asXml();
    }

    abstract protected function getXmlAttributes();
}

class Person {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

class Log {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
trait XmlConversion {
    public function toXml() {
      $xml = new SimpleXMLElement('<object></object>');

        foreach($this->getXmlAttributes() as $attribute) {
          $xml->addChild(new ...)
        }

        return $xml->asXml();
    }

    abstract protected function getXmlAttributes();
}

class Person {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

class Log {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
trait XmlConversion {
    public function toXml() {
      $xml = new SimpleXMLElement('<object></object>');

        foreach($this->getXmlAttributes() as $attribute) {
          $xml->addChild(new ...)
        }

        return $xml->asXml();
    }

    abstract protected function getXmlAttributes();
}

class Person {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

class Log {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
trait XmlConversion {
    public function toXml() {
      $xml = new SimpleXMLElement('<object></object>');

        foreach($this->getXmlAttributes() as $attribute) {
          $xml->addChild(new ...)
        }

        return $xml->asXml();
    }

    abstract protected function getXmlAttributes();
}

class Person {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

class Log {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
trait XmlConversion {
    public function toXml() {
      $xml = new SimpleXMLElement('<object></object>');

        foreach($this->getXmlAttributes() as $attribute) {
          $xml->addChild(new ...)
        }

        return $xml->asXml();
    }

    abstract protected function getXmlAttributes();
}

class Person {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

class Log {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
trait XmlConversion {
    public function toXml() {
      $xml = new SimpleXMLElement('<object></object>');

        foreach($this->getXmlAttributes() as $attribute) {
          $xml->addChild(new ...)
        }

        return $xml->asXml();
    }

    abstract protected function getXmlAttributes();
}

class Person {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

class Log {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
trait XmlConversion {
    public function toXml() {
      $xml = new SimpleXMLElement('<object></object>');

        foreach($this->getXmlAttributes() as $attribute) {
          $xml->addChild(new ...)
        }

        return $xml->asXml();
    }

    abstract protected function getXmlAttributes();
}

class Person {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

class Log {
    use XmlConversion;

    protected function getXmlAttributes() {
      return ...
    }
}

$user = new Person();
$user->toXml();
$log = new Log();
$log->toXml();
SPDY
http://dev.chromium.org/spdy/spdy-whitepaper
PHP application server
        http://www.photon-project.com/
HInclude
 http://mnot.github.com/hinclude/
<hx:include src="/footer.html"></hx:include>
<hx:include src="/footer.html"></hx:include>
<hx:include src="/footer.html"></hx:include>
Composer
  http://packagist.org/
{
    "name": "robowhois/Robowhois",
    "type": "library",
    "description": "PHP SDK for Robowhois APIs.",
    "keywords": ["robowhois"],
    "license": "MIT",
    "authors": [
        {
            "name": "Alessandro Nadalin",
            "email": "alessandro.nadalin@gmail.com",
            "homepage": "http://www.odino.org"
        },
        {
            "name": "David Funaro",
            "email": "ing.davidino@gmail.com",
            "homepage": "http://davidfunaro.com"
        }
    ],
    "autoload": {
        "psr-0": {
            "Robowhois": "src/"
        }
    },
    "require": {
        "php": ">=5.3.2",
        "kriswallsmith/Buzz": "v0.5",
        "symfony/http-foundation": "v2.0.12"
    }
}
{
    "name": "robowhois/Robowhois",
    "type": "library",
    "description": "PHP SDK for Robowhois APIs.",
    "keywords": ["robowhois"],
    "license": "MIT",
    "authors": [
        {
            "name": "Alessandro Nadalin",
            "email": "alessandro.nadalin@gmail.com",
            "homepage": "http://www.odino.org"
        },
        {
            "name": "David Funaro",
            "email": "ing.davidino@gmail.com",
            "homepage": "http://davidfunaro.com"
        }
    ],
    "autoload": {
        "psr-0": {
            "Robowhois": "src/"
        }
    },
    "require": {
        "php": ">=5.3.2",
        "kriswallsmith/Buzz": "v0.5",
        "symfony/http-foundation": "v2.0.12"
    }
}
{
    "name": "robowhois/Robowhois",
    "type": "library",
    "description": "PHP SDK for Robowhois APIs.",
    "keywords": ["robowhois"],
    "license": "MIT",
    "authors": [
        {
            "name": "Alessandro Nadalin",
            "email": "alessandro.nadalin@gmail.com",
            "homepage": "http://www.odino.org"
        },
        {
            "name": "David Funaro",
            "email": "ing.davidino@gmail.com",
            "homepage": "http://davidfunaro.com"
        }
    ],
    "autoload": {
        "psr-0": {
            "Robowhois": "src/"
        }
    },
    "require": {
        "php": ">=5.3.2",
        "kriswallsmith/Buzz": "v0.5",
        "symfony/http-foundation": "v2.0.12"
    }
}
{
    "name": "robowhois/Robowhois",
    "type": "library",
    "description": "PHP SDK for Robowhois APIs.",
    "keywords": ["robowhois"],
    "license": "MIT",
    "authors": [
        {
            "name": "Alessandro Nadalin",
            "email": "alessandro.nadalin@gmail.com",
            "homepage": "http://www.odino.org"
        },
        {
            "name": "David Funaro",
            "email": "ing.davidino@gmail.com",
            "homepage": "http://davidfunaro.com"
        }
    ],
    "autoload": {
        "psr-0": {
            "Robowhois": "src/"
        }
    },
    "require": {
        "php": ">=5.3.2",
        "kriswallsmith/Buzz": "v0.5",
        "symfony/http-foundation": "v2.0.12"
    }
}
wget http://getcomposer.org/composer.
phar

php composer.phar install
wget http://getcomposer.org/composer.
phar

php composer.phar install
wget http://getcomposer.org/composer.
phar

php composer.phar install
Interoperability
    https://github.com/php-fig/fig-standards
The new exec()
    https://github.com/symfony/Process
<?php

require __DIR__ . '/vendor/.composer/autoload.php';

use SymfonyComponentProcessProcess;

$file = sys_get_temp_dir() . '/test.output.txt';

$handle   = fopen($file, 'w+');
$process = new Process('phpunit -c /home/foor/bar/phpunit.xml
/home/foo/bar');
$process->run(function ($type, $buffer) use($handle) {
  fwrite($handle, nl2br($buffer));
});

fclose($handle);
<?php

require __DIR__ . '/vendor/.composer/autoload.php';

use SymfonyComponentProcessProcess;

$file = sys_get_temp_dir() . '/test.output.txt';

$handle   = fopen($file, 'w+');
$process = new Process('phpunit -c /home/foor/bar/phpunit.xml
/home/foo/bar');
$process->run(function ($type, $buffer) use($handle) {
  fwrite($handle, nl2br($buffer));
});

fclose($handle);
<?php

require __DIR__ . '/vendor/.composer/autoload.php';

use SymfonyComponentProcessProcess;

$file = sys_get_temp_dir() . '/test.output.txt';

$handle   = fopen($file, 'w+');
$process = new Process('phpunit -c /home/foor/bar/phpunit.xml
/home/foo/bar');
$process->run(function ($type, $buffer) use($handle) {
  fwrite($handle, nl2br($buffer));
});

fclose($handle);
<?php

require __DIR__ . '/vendor/.composer/autoload.php';

use SymfonyComponentProcessProcess;

$file = sys_get_temp_dir() . '/test.output.txt';

$handle   = fopen($file, 'w+');
$process = new Process('phpunit -c /home/foor/bar/phpunit.xml
/home/foo/bar');
$process->run(function ($type, $buffer) use($handle) {
  fwrite($handle, nl2br($buffer));
});

fclose($handle);
A "new" simple SAPI
      https://github.com/symfony/Console
<?php

use   SymfonyComponentConsoleCommandCommand;
use   SymfonyComponentConsoleOutputOutputInterface;
use   SymfonyComponentConsoleInputInputInterface;
use   SymfonyComponentProcessProcess;

class Install   extends Command
{
    protected   $installDir;
    protected   $failingProcess;
    protected   $dependenciesContainer;

      public function __construct(DependencyContainer $dependenciesContainer)
      {
          parent::__construct();

          $this->dependenciesContainer = $dependenciesContainer;
      }

      protected function execute(InputInterface $input, OutputInterface $output)
      {
          if ($this->createInstallationDirectory($output)
           && $this->downloadComposer($output)
           && $this->generateJson($output)
           && $this->install($output)) {
              $output->writeln('<info>MISSION ACCOMPLISHED</info>');
          } else {
              $output->writeln('<error>Nasty error happened :'-(</error>');

              if ($this->failingProcess instanceOf Process) {
                  $output->writeln('<error>%s</error>', $this->failingProcess->getErrorOutput());
              }
          }
      }

      protected function configure()
      {
          $this
              ->setName('install')
          ;
      }
}
‫وداﻋﺎ وداﻋﺎ‬

More Related Content

What's hot

Backbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserBackbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The Browser
Howard Lewis Ship
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
Kris Wallsmith
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
Wim Godden
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
Mark Baker
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensions
erwanl
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Kris Wallsmith
 
Testing Web Applications with GEB
Testing Web Applications with GEBTesting Web Applications with GEB
Testing Web Applications with GEB
Howard Lewis Ship
 
Backbone js
Backbone jsBackbone js
Backbone js
rstankov
 
Introduction to Nodejs
Introduction to NodejsIntroduction to Nodejs
Introduction to Nodejs
Gabriele Lana
 
Your code is not a string
Your code is not a stringYour code is not a string
Your code is not a string
Ingvar Stepanyan
 
Why ruby
Why rubyWhy ruby
Why ruby
rstankov
 
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
rstankov
 
ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
Domenic Denicola
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
Konstantin Kudryashov
 
Nubilus Perl
Nubilus PerlNubilus Perl
Nubilus Perl
Flavio Poletti
 
5 Tips for Better JavaScript
5 Tips for Better JavaScript5 Tips for Better JavaScript
5 Tips for Better JavaScript
Todd Anglin
 
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and HobgoblinsModels and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and Hobgoblins
Ross Tuck
 
JavaScript ES6
JavaScript ES6JavaScript ES6
JavaScript ES6
Leo Hernandez
 
PHP 7 – What changed internally? (Forum PHP 2015)
PHP 7 – What changed internally? (Forum PHP 2015)PHP 7 – What changed internally? (Forum PHP 2015)
PHP 7 – What changed internally? (Forum PHP 2015)
Nikita Popov
 
Perl Web Client
Perl Web ClientPerl Web Client
Perl Web Client
Flavio Poletti
 

What's hot (20)

Backbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserBackbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The Browser
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensions
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
 
Testing Web Applications with GEB
Testing Web Applications with GEBTesting Web Applications with GEB
Testing Web Applications with GEB
 
Backbone js
Backbone jsBackbone js
Backbone js
 
Introduction to Nodejs
Introduction to NodejsIntroduction to Nodejs
Introduction to Nodejs
 
Your code is not a string
Your code is not a stringYour code is not a string
Your code is not a string
 
Why ruby
Why rubyWhy ruby
Why ruby
 
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
 
ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
 
Nubilus Perl
Nubilus PerlNubilus Perl
Nubilus Perl
 
5 Tips for Better JavaScript
5 Tips for Better JavaScript5 Tips for Better JavaScript
5 Tips for Better JavaScript
 
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and HobgoblinsModels and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and Hobgoblins
 
JavaScript ES6
JavaScript ES6JavaScript ES6
JavaScript ES6
 
PHP 7 – What changed internally? (Forum PHP 2015)
PHP 7 – What changed internally? (Forum PHP 2015)PHP 7 – What changed internally? (Forum PHP 2015)
PHP 7 – What changed internally? (Forum PHP 2015)
 
Perl Web Client
Perl Web ClientPerl Web Client
Perl Web Client
 

Similar to The state of your own hypertext preprocessor

Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
Daniel Knell
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6Dmitry Soshnikov
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Tsuyoshi Yamamoto
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
Alexander Varwijk
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
Kris Wallsmith
 
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Mail.ru Group
 
Security Meetup 22 октября. «PHP Unserialize Exploiting». Павел Топорков. Лаб...
Security Meetup 22 октября. «PHP Unserialize Exploiting». Павел Топорков. Лаб...Security Meetup 22 октября. «PHP Unserialize Exploiting». Павел Топорков. Лаб...
Security Meetup 22 октября. «PHP Unserialize Exploiting». Павел Топорков. Лаб...
Mail.ru Group
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
Fabien Potencier
 
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Puppet
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 WorldFabien Potencier
 
The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
Michael Girouard
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
Hugo Hamon
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
James Titcumb
 
Code generation for alternative languages
Code generation for alternative languagesCode generation for alternative languages
Code generation for alternative languages
Rafael Winterhalter
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
Hisateru Tanaka
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5arajivmordani
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
Simone Federici
 
Doctrine and NoSQL
Doctrine and NoSQLDoctrine and NoSQL
Doctrine and NoSQL
Benjamin Eberlei
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
Lars Jankowfsky
 

Similar to The state of your own hypertext preprocessor (20)

Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
 
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
 
Security Meetup 22 октября. «PHP Unserialize Exploiting». Павел Топорков. Лаб...
Security Meetup 22 октября. «PHP Unserialize Exploiting». Павел Топорков. Лаб...Security Meetup 22 октября. «PHP Unserialize Exploiting». Павел Топорков. Лаб...
Security Meetup 22 октября. «PHP Unserialize Exploiting». Павел Топорков. Лаб...
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
 
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 World
 
The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
 
Code generation for alternative languages
Code generation for alternative languagesCode generation for alternative languages
Code generation for alternative languages
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
 
Doctrine and NoSQL
Doctrine and NoSQLDoctrine and NoSQL
Doctrine and NoSQL
 
Migrare da symfony 1 a Symfony2
 Migrare da symfony 1 a Symfony2  Migrare da symfony 1 a Symfony2
Migrare da symfony 1 a Symfony2
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 

More from Alessandro Nadalin

Spa, isomorphic and back to the server our journey with js @ frontend con po...
Spa, isomorphic and back to the server  our journey with js @ frontend con po...Spa, isomorphic and back to the server  our journey with js @ frontend con po...
Spa, isomorphic and back to the server our journey with js @ frontend con po...
Alessandro Nadalin
 
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
Alessandro Nadalin
 
Scaling at Namshi @ Seamless Ecommerce Dubai 2017
Scaling at Namshi @ Seamless Ecommerce Dubai 2017Scaling at Namshi @ Seamless Ecommerce Dubai 2017
Scaling at Namshi @ Seamless Ecommerce Dubai 2017
Alessandro Nadalin
 
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in DubaiAccelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
Alessandro Nadalin
 
A tech team of ~10 @ Rocket Tech Summit 2016 in Berlin
A tech team of ~10 @ Rocket Tech Summit 2016 in BerlinA tech team of ~10 @ Rocket Tech Summit 2016 in Berlin
A tech team of ~10 @ Rocket Tech Summit 2016 in Berlin
Alessandro Nadalin
 
React native in the wild @ Codemotion 2016 in Rome
React native in the wild @ Codemotion 2016 in RomeReact native in the wild @ Codemotion 2016 in Rome
React native in the wild @ Codemotion 2016 in Rome
Alessandro Nadalin
 
Dockerize it! @ Codemotion 2016 in Rome
Dockerize it! @ Codemotion 2016 in RomeDockerize it! @ Codemotion 2016 in Rome
Dockerize it! @ Codemotion 2016 in Rome
Alessandro Nadalin
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinDeploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Alessandro Nadalin
 
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Alessandro Nadalin
 
Don't screw it up: how to build durable web apis @ PHPDay 2014 in Verona (ITA)
Don't screw it up: how to build durable web apis @ PHPDay 2014 in Verona (ITA)Don't screw it up: how to build durable web apis @ PHPDay 2014 in Verona (ITA)
Don't screw it up: how to build durable web apis @ PHPDay 2014 in Verona (ITA)Alessandro Nadalin
 
Namshi in 2014: let's rock!
Namshi in 2014: let's rock!Namshi in 2014: let's rock!
Namshi in 2014: let's rock!
Alessandro Nadalin
 
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Alessandro Nadalin
 
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
Alessandro Nadalin
 
A Rocket Internet experience @ ForumPHP Paris 2013
A Rocket Internet experience @ ForumPHP Paris 2013A Rocket Internet experience @ ForumPHP Paris 2013
A Rocket Internet experience @ ForumPHP Paris 2013Alessandro Nadalin
 
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoHTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
Alessandro Nadalin
 
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Alessandro Nadalin
 
The rocket internet experience @ PHP.TO.START 2013 in Turin
The rocket internet experience @ PHP.TO.START 2013 in TurinThe rocket internet experience @ PHP.TO.START 2013 in Turin
The rocket internet experience @ PHP.TO.START 2013 in Turin
Alessandro Nadalin
 
GraphDB in PHP @ Codemotion 03/23/2012
GraphDB in PHP @ Codemotion 03/23/2012GraphDB in PHP @ Codemotion 03/23/2012
GraphDB in PHP @ Codemotion 03/23/2012
Alessandro Nadalin
 
REST in peace @ IPC 2012 in Mainz
REST in peace @ IPC 2012 in MainzREST in peace @ IPC 2012 in Mainz
REST in peace @ IPC 2012 in Mainz
Alessandro Nadalin
 
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
Alessandro Nadalin
 

More from Alessandro Nadalin (20)

Spa, isomorphic and back to the server our journey with js @ frontend con po...
Spa, isomorphic and back to the server  our journey with js @ frontend con po...Spa, isomorphic and back to the server  our journey with js @ frontend con po...
Spa, isomorphic and back to the server our journey with js @ frontend con po...
 
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
 
Scaling at Namshi @ Seamless Ecommerce Dubai 2017
Scaling at Namshi @ Seamless Ecommerce Dubai 2017Scaling at Namshi @ Seamless Ecommerce Dubai 2017
Scaling at Namshi @ Seamless Ecommerce Dubai 2017
 
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in DubaiAccelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
Accelerated Mobile Pages @ Dubytes meetup Dec 2016 in Dubai
 
A tech team of ~10 @ Rocket Tech Summit 2016 in Berlin
A tech team of ~10 @ Rocket Tech Summit 2016 in BerlinA tech team of ~10 @ Rocket Tech Summit 2016 in Berlin
A tech team of ~10 @ Rocket Tech Summit 2016 in Berlin
 
React native in the wild @ Codemotion 2016 in Rome
React native in the wild @ Codemotion 2016 in RomeReact native in the wild @ Codemotion 2016 in Rome
React native in the wild @ Codemotion 2016 in Rome
 
Dockerize it! @ Codemotion 2016 in Rome
Dockerize it! @ Codemotion 2016 in RomeDockerize it! @ Codemotion 2016 in Rome
Dockerize it! @ Codemotion 2016 in Rome
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinDeploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
 
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
 
Don't screw it up: how to build durable web apis @ PHPDay 2014 in Verona (ITA)
Don't screw it up: how to build durable web apis @ PHPDay 2014 in Verona (ITA)Don't screw it up: how to build durable web apis @ PHPDay 2014 in Verona (ITA)
Don't screw it up: how to build durable web apis @ PHPDay 2014 in Verona (ITA)
 
Namshi in 2014: let's rock!
Namshi in 2014: let's rock!Namshi in 2014: let's rock!
Namshi in 2014: let's rock!
 
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
Angular js is the future. maybe. @ ConFoo 2014 in Montreal (CA)
 
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
 
A Rocket Internet experience @ ForumPHP Paris 2013
A Rocket Internet experience @ ForumPHP Paris 2013A Rocket Internet experience @ ForumPHP Paris 2013
A Rocket Internet experience @ ForumPHP Paris 2013
 
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoHTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
 
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
 
The rocket internet experience @ PHP.TO.START 2013 in Turin
The rocket internet experience @ PHP.TO.START 2013 in TurinThe rocket internet experience @ PHP.TO.START 2013 in Turin
The rocket internet experience @ PHP.TO.START 2013 in Turin
 
GraphDB in PHP @ Codemotion 03/23/2012
GraphDB in PHP @ Codemotion 03/23/2012GraphDB in PHP @ Codemotion 03/23/2012
GraphDB in PHP @ Codemotion 03/23/2012
 
REST in peace @ IPC 2012 in Mainz
REST in peace @ IPC 2012 in MainzREST in peace @ IPC 2012 in Mainz
REST in peace @ IPC 2012 in Mainz
 
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
 

Recently uploaded

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 

Recently uploaded (20)

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 

The state of your own hypertext preprocessor

  • 1. The state of your own hypertext processor Alessandro Nadalin 27/03/2012
  • 3.
  • 5.
  • 6.
  • 7.
  • 9.
  • 10.
  • 11.
  • 12. What you should look at
  • 15. trait XmlConversion { public function toXml() { $xml = new SimpleXMLElement('<object></object>'); foreach($this->getXmlAttributes() as $attribute) { $xml->addChild(new ...) } return $xml->asXml(); } abstract protected function getXmlAttributes(); } class Person { use XmlConversion; protected function getXmlAttributes() { return ... } } class Log { use XmlConversion; protected function getXmlAttributes() { return ... } } $user = new Person(); $user->toXml(); $log = new Log(); $log->toXml();
  • 16. trait XmlConversion { public function toXml() { $xml = new SimpleXMLElement('<object></object>'); foreach($this->getXmlAttributes() as $attribute) { $xml->addChild(new ...) } return $xml->asXml(); } abstract protected function getXmlAttributes(); } class Person { use XmlConversion; protected function getXmlAttributes() { return ... } } class Log { use XmlConversion; protected function getXmlAttributes() { return ... } } $user = new Person(); $user->toXml(); $log = new Log(); $log->toXml();
  • 17. trait XmlConversion { public function toXml() { $xml = new SimpleXMLElement('<object></object>'); foreach($this->getXmlAttributes() as $attribute) { $xml->addChild(new ...) } return $xml->asXml(); } abstract protected function getXmlAttributes(); } class Person { use XmlConversion; protected function getXmlAttributes() { return ... } } class Log { use XmlConversion; protected function getXmlAttributes() { return ... } } $user = new Person(); $user->toXml(); $log = new Log(); $log->toXml();
  • 18. trait XmlConversion { public function toXml() { $xml = new SimpleXMLElement('<object></object>'); foreach($this->getXmlAttributes() as $attribute) { $xml->addChild(new ...) } return $xml->asXml(); } abstract protected function getXmlAttributes(); } class Person { use XmlConversion; protected function getXmlAttributes() { return ... } } class Log { use XmlConversion; protected function getXmlAttributes() { return ... } } $user = new Person(); $user->toXml(); $log = new Log(); $log->toXml();
  • 19. trait XmlConversion { public function toXml() { $xml = new SimpleXMLElement('<object></object>'); foreach($this->getXmlAttributes() as $attribute) { $xml->addChild(new ...) } return $xml->asXml(); } abstract protected function getXmlAttributes(); } class Person { use XmlConversion; protected function getXmlAttributes() { return ... } } class Log { use XmlConversion; protected function getXmlAttributes() { return ... } } $user = new Person(); $user->toXml(); $log = new Log(); $log->toXml();
  • 20. trait XmlConversion { public function toXml() { $xml = new SimpleXMLElement('<object></object>'); foreach($this->getXmlAttributes() as $attribute) { $xml->addChild(new ...) } return $xml->asXml(); } abstract protected function getXmlAttributes(); } class Person { use XmlConversion; protected function getXmlAttributes() { return ... } } class Log { use XmlConversion; protected function getXmlAttributes() { return ... } } $user = new Person(); $user->toXml(); $log = new Log(); $log->toXml();
  • 21. trait XmlConversion { public function toXml() { $xml = new SimpleXMLElement('<object></object>'); foreach($this->getXmlAttributes() as $attribute) { $xml->addChild(new ...) } return $xml->asXml(); } abstract protected function getXmlAttributes(); } class Person { use XmlConversion; protected function getXmlAttributes() { return ... } } class Log { use XmlConversion; protected function getXmlAttributes() { return ... } } $user = new Person(); $user->toXml(); $log = new Log(); $log->toXml();
  • 22. trait XmlConversion { public function toXml() { $xml = new SimpleXMLElement('<object></object>'); foreach($this->getXmlAttributes() as $attribute) { $xml->addChild(new ...) } return $xml->asXml(); } abstract protected function getXmlAttributes(); } class Person { use XmlConversion; protected function getXmlAttributes() { return ... } } class Log { use XmlConversion; protected function getXmlAttributes() { return ... } } $user = new Person(); $user->toXml(); $log = new Log(); $log->toXml();
  • 24. PHP application server http://www.photon-project.com/
  • 30. { "name": "robowhois/Robowhois", "type": "library", "description": "PHP SDK for Robowhois APIs.", "keywords": ["robowhois"], "license": "MIT", "authors": [ { "name": "Alessandro Nadalin", "email": "alessandro.nadalin@gmail.com", "homepage": "http://www.odino.org" }, { "name": "David Funaro", "email": "ing.davidino@gmail.com", "homepage": "http://davidfunaro.com" } ], "autoload": { "psr-0": { "Robowhois": "src/" } }, "require": { "php": ">=5.3.2", "kriswallsmith/Buzz": "v0.5", "symfony/http-foundation": "v2.0.12" } }
  • 31. { "name": "robowhois/Robowhois", "type": "library", "description": "PHP SDK for Robowhois APIs.", "keywords": ["robowhois"], "license": "MIT", "authors": [ { "name": "Alessandro Nadalin", "email": "alessandro.nadalin@gmail.com", "homepage": "http://www.odino.org" }, { "name": "David Funaro", "email": "ing.davidino@gmail.com", "homepage": "http://davidfunaro.com" } ], "autoload": { "psr-0": { "Robowhois": "src/" } }, "require": { "php": ">=5.3.2", "kriswallsmith/Buzz": "v0.5", "symfony/http-foundation": "v2.0.12" } }
  • 32. { "name": "robowhois/Robowhois", "type": "library", "description": "PHP SDK for Robowhois APIs.", "keywords": ["robowhois"], "license": "MIT", "authors": [ { "name": "Alessandro Nadalin", "email": "alessandro.nadalin@gmail.com", "homepage": "http://www.odino.org" }, { "name": "David Funaro", "email": "ing.davidino@gmail.com", "homepage": "http://davidfunaro.com" } ], "autoload": { "psr-0": { "Robowhois": "src/" } }, "require": { "php": ">=5.3.2", "kriswallsmith/Buzz": "v0.5", "symfony/http-foundation": "v2.0.12" } }
  • 33. { "name": "robowhois/Robowhois", "type": "library", "description": "PHP SDK for Robowhois APIs.", "keywords": ["robowhois"], "license": "MIT", "authors": [ { "name": "Alessandro Nadalin", "email": "alessandro.nadalin@gmail.com", "homepage": "http://www.odino.org" }, { "name": "David Funaro", "email": "ing.davidino@gmail.com", "homepage": "http://davidfunaro.com" } ], "autoload": { "psr-0": { "Robowhois": "src/" } }, "require": { "php": ">=5.3.2", "kriswallsmith/Buzz": "v0.5", "symfony/http-foundation": "v2.0.12" } }
  • 37. Interoperability https://github.com/php-fig/fig-standards
  • 38. The new exec() https://github.com/symfony/Process
  • 39. <?php require __DIR__ . '/vendor/.composer/autoload.php'; use SymfonyComponentProcessProcess; $file = sys_get_temp_dir() . '/test.output.txt'; $handle = fopen($file, 'w+'); $process = new Process('phpunit -c /home/foor/bar/phpunit.xml /home/foo/bar'); $process->run(function ($type, $buffer) use($handle) { fwrite($handle, nl2br($buffer)); }); fclose($handle);
  • 40. <?php require __DIR__ . '/vendor/.composer/autoload.php'; use SymfonyComponentProcessProcess; $file = sys_get_temp_dir() . '/test.output.txt'; $handle = fopen($file, 'w+'); $process = new Process('phpunit -c /home/foor/bar/phpunit.xml /home/foo/bar'); $process->run(function ($type, $buffer) use($handle) { fwrite($handle, nl2br($buffer)); }); fclose($handle);
  • 41. <?php require __DIR__ . '/vendor/.composer/autoload.php'; use SymfonyComponentProcessProcess; $file = sys_get_temp_dir() . '/test.output.txt'; $handle = fopen($file, 'w+'); $process = new Process('phpunit -c /home/foor/bar/phpunit.xml /home/foo/bar'); $process->run(function ($type, $buffer) use($handle) { fwrite($handle, nl2br($buffer)); }); fclose($handle);
  • 42. <?php require __DIR__ . '/vendor/.composer/autoload.php'; use SymfonyComponentProcessProcess; $file = sys_get_temp_dir() . '/test.output.txt'; $handle = fopen($file, 'w+'); $process = new Process('phpunit -c /home/foor/bar/phpunit.xml /home/foo/bar'); $process->run(function ($type, $buffer) use($handle) { fwrite($handle, nl2br($buffer)); }); fclose($handle);
  • 43. A "new" simple SAPI https://github.com/symfony/Console
  • 44. <?php use SymfonyComponentConsoleCommandCommand; use SymfonyComponentConsoleOutputOutputInterface; use SymfonyComponentConsoleInputInputInterface; use SymfonyComponentProcessProcess; class Install extends Command { protected $installDir; protected $failingProcess; protected $dependenciesContainer; public function __construct(DependencyContainer $dependenciesContainer) { parent::__construct(); $this->dependenciesContainer = $dependenciesContainer; } protected function execute(InputInterface $input, OutputInterface $output) { if ($this->createInstallationDirectory($output) && $this->downloadComposer($output) && $this->generateJson($output) && $this->install($output)) { $output->writeln('<info>MISSION ACCOMPLISHED</info>'); } else { $output->writeln('<error>Nasty error happened :'-(</error>'); if ($this->failingProcess instanceOf Process) { $output->writeln('<error>%s</error>', $this->failingProcess->getErrorOutput()); } } } protected function configure() { $this ->setName('install') ; } }