SlideShare une entreprise Scribd logo
1  sur  41
Télécharger pour lire hors ligne
Let’s Exciting on Your
      Own PHP!
         Kousuke Ebihara
     <ebihara@tejimaya.com>
4           OpenPNE 3.2    3.4



•       (^o^)

•
•   OpenPNE                      PHP



•

    •            (Ebinglish)

    •
Go to our main topic...
My “php -i”
My “phpinfo()”
Let’s Exciting on Your Own PHP

Why do I want to get my own PHP ?
What for?


• Improving my work
• Just for fun
Use 5.3. And 5.2
• You should use PHP 5.3 for your
  developing, if you know about backward
  incompatible changes in the version
 • Some code for PHP 5.2 may not work
    under PHP 5.3 :( But the other way
    around if you are careful.
• Use 5.2 when you worry about your script.
  (So must ready to use PHP 5.2!)
But then ...
•   Do you know about the following script is not
    work under PHP 5.2? Why?
Result
Oh, it is just a bug!




http://bugs.php.net/bug.php?id=45820
Fixed ... ?
Trace changes

• From 16 Jul 2009, PHP is hosted on SVN
  and there is a GitHub mirror!
• So you can trace some changes in your git
  clone easy
 • Let’s tour through changes by using Git
Fixed only in PHP 5.3?
View changes
In PHP 5.2




 So dreadful...
Talk about something
        else
•   I’ve written the following code by an oversight in
    template (But it is only worked in
    “short_open_tag=1” environment):
       <?= $var ?>
•   And I’ve written the following code too (But it is
    only worked in “short_open_tag=0”
    environment):
    <?xml version=”1.0” encoding=”utf-8”?>
    <?php if ($flag): ?>
         :
A developer of Debian
has the interesting patch

• The patch makes the PHP 5.3 notify
  E_DEPRECATED error if the script uses
  short open tags (c.f. debian git repository)
 • If the feature had been in PHP, I wouldn’t
    have gotten the mentioned error.
Unfortunately, the patch
  may be rejected ...

• [PHP-DEV] Throwing an E_DEPRECATED
  for short_open_tag
  http://marc.info/?t=126334748600001
• But I really need it!
So I want to get
        the following PHP 5.3
       for improving my work


• Notify errors to code that doesn’t work
  under the php 5.2.x
• Notify to environment dependency code
  (e.g. short_open_tag)
I thought of...


• creating my own PHP!
Let’s Exciting on Your Own PHP

Build PHP
Knowing the way to
build PHP is important
• You can build many variations of PHP by
  your needs
• You can test your script under the specified
  version of PHP (e.g. array_unique() is
  breaked BC only in PHP 5.2.9)
Prepare to build PHP
•   Here we get source code from Git repository for our customizing
    •   http://github.com/php/php-src
•   See http://www.php.net/manual/ja/install.unix.php and
     http://www.php.net/svn.php
    •   Combinations of “autoconf”, “automake” and “libtool” is very important.You
        may get older version of them by your hand
    •   If you want to compile Git or SVN version of PHP 5.2, you must prepare flex
        2.5.4
    •   Some program may be not used if you using packaged PHP (because it
        contains pre-generated files)
•   If you want to use Git version of PHP, please get latest git and git-svn (I got errors
    by using git 1.6.5)
•   Of course, you must prepare some packages needed by extensions that you want
    to use
Prepare configuring
(only for SVN and Git version)
• SVN and Git version of PHP don’t have
  something to configure
• So you should execute “./buildconf”
 • Make sure that you use certain version of
    autoconf, automake and libtool. For
    example, I specified autoconf and
    autoheader to use (in Debian sid)
Configure PHP
• You can see the available configure options
  by executing “./configure --help”


• Some options is for extension (enable-xxx,
  disable-xxx, with-xxx, without-xxx). So you
  don’t need to be afraid of options if you
  know about your needed extensions
  • Build PHP many times is normal
My configure options
•   http://gist.github.com/277126
    •   ./configure --enable-mbstring
         --with-apxs2=/usr/bin/apxs2
         --with-gd --with-mysql --with-pgsql
         --with-pdo-mysql=/usr
         --with-pdo-pgsql --with-pdo-sqlite
         --with-pear --with-jpeg-dir=/usr/lib
         --with-curl --with-zlib
        •   If you want to use multiple php, you may want
            to add --with-config-file-path
Make and Install
• Do make
• Do make test (I always pass it)
• Do make install
 • Compiled php is in sapi/* .You can copy
    the binaries or intermediate files by your
    hand
Let’s Exciting on Your Own PHP

Customize PHP
For my working
Add original error level
 • I want to add “EE_COMPAT_52” and
   “EE_ENV_DEP”
  • EE_COMPAT_52 is for notifying “it may
     not be working under the php 5.2.x“
  • EE_ENV_DEP is for notifying “it may be
     environment depended code”
  • EE_ is Ebi_Error
For my working
Add original error level
•   I referred adding E_DEPRECATED commit
    •   $ git log --grep=”E_DEPRECATED”
•   I must rewrite:
    •   Zend/zend_errors.h : define constants
    •   Zend/zend.c : zend_error()
    •   Zend/zend_constants.c : zend_register_standard_constants()
    •   main/main.c : php_error_cb()
    •   And notify the new error by zend_error() (in Zend Engine)
        and php_error_docref (in PHP)
For my working
Add original error level
 •   Now, I have a patch for realizing this
     •    Adding EE_COMPAT_52 and EE_ENV_DEP
         • http://github.com/ebihara/php-src/commit/
             2fdd6fe27188ad3c5878b1fd3a8229e35f84d8fd


     •    Notice to <?
         • http://github.com/ebihara/php-src/commit/
             e6706d2b9a576cd81991868d9a8522ba50c37593


     •    Notice to $list[‘’] = ‘’;
         • http://github.com/ebihara/php-src/commit/
             1e9484ad04ca03b340bdd51d1f39acee32b86182
For my working
Add original error level
For my working
Add original error level
For my working
Add original error level

• I want to add notices based on
  http://www.php.net/manual/ja/
  migration53.deprecated.php
• Any idea?
For my fun
Insertion ;
For my fun
                Insertion ;
•   ;

    •   ECMA Script
                  (Automatic Semicolon Insertion)




        •   }

        •
For my fun
    Keyword Arguments
•      RSS
For my fun
 Keyword Arguments
• Python
Let's creating your own PHP (tejimaya version)
Question?

Contenu connexe

Tendances

Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014Julio Bitencourt
 
A Modest Introduction to Swift
A Modest Introduction to SwiftA Modest Introduction to Swift
A Modest Introduction to SwiftJohn Anderson
 
Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 OSSCube
 
Code igniter unittest-part1
Code igniter unittest-part1Code igniter unittest-part1
Code igniter unittest-part1Albert Rosa
 
CodeIgniter Ant Scripting
CodeIgniter Ant ScriptingCodeIgniter Ant Scripting
CodeIgniter Ant ScriptingAlbert Rosa
 
PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.Francesco Fullone
 
PHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traitsPHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traitsGraham Weldon
 
CakePHP - The Path to 2.0
CakePHP - The Path to 2.0CakePHP - The Path to 2.0
CakePHP - The Path to 2.0Graham Weldon
 
Zend expressive workshop
Zend expressive workshopZend expressive workshop
Zend expressive workshopAdam Culp
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentShahar Evron
 
Code Igniter Code Sniffer
Code Igniter  Code SnifferCode Igniter  Code Sniffer
Code Igniter Code SnifferAlbert Rosa
 
Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?Kirill Chebunin
 

Tendances (20)

Perl in Teh Cloud
Perl in Teh CloudPerl in Teh Cloud
Perl in Teh Cloud
 
Frontend testing with Codeception
Frontend testing with CodeceptionFrontend testing with Codeception
Frontend testing with Codeception
 
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
 
A Modest Introduction to Swift
A Modest Introduction to SwiftA Modest Introduction to Swift
A Modest Introduction to Swift
 
Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014
 
Padre user experience
Padre user experiencePadre user experience
Padre user experience
 
Code igniter unittest-part1
Code igniter unittest-part1Code igniter unittest-part1
Code igniter unittest-part1
 
CodeIgniter Ant Scripting
CodeIgniter Ant ScriptingCodeIgniter Ant Scripting
CodeIgniter Ant Scripting
 
PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.
 
Pinto+Stratopan+Love
Pinto+Stratopan+LovePinto+Stratopan+Love
Pinto+Stratopan+Love
 
CPAN Training
CPAN TrainingCPAN Training
CPAN Training
 
PHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traitsPHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traits
 
CakePHP - The Path to 2.0
CakePHP - The Path to 2.0CakePHP - The Path to 2.0
CakePHP - The Path to 2.0
 
Zend expressive workshop
Zend expressive workshopZend expressive workshop
Zend expressive workshop
 
Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 
composer_talk_20160209
composer_talk_20160209composer_talk_20160209
composer_talk_20160209
 
Perl
PerlPerl
Perl
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application Deployment
 
Code Igniter Code Sniffer
Code Igniter  Code SnifferCode Igniter  Code Sniffer
Code Igniter Code Sniffer
 
Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?
 

En vedette

State of Web Security RailsConf 2016
State of Web Security RailsConf 2016State of Web Security RailsConf 2016
State of Web Security RailsConf 2016IMMUNIO
 
Asegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File DownloadingAsegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File DownloadingChema Alonso
 
Cross Context Scripting attacks & exploitation
Cross Context Scripting attacks & exploitationCross Context Scripting attacks & exploitation
Cross Context Scripting attacks & exploitationRoberto Suggi Liverani
 
Xml external entities [xxe]
Xml external entities [xxe]Xml external entities [xxe]
Xml external entities [xxe]mattymcfatty
 
Philip Hung Cao - Cloud security, the journey has begun
Philip Hung Cao - Cloud security, the journey has begunPhilip Hung Cao - Cloud security, the journey has begun
Philip Hung Cao - Cloud security, the journey has begunSecurity Bootcamp
 
Bridging the gap - Security and Software Testing
Bridging the gap - Security and Software TestingBridging the gap - Security and Software Testing
Bridging the gap - Security and Software TestingRoberto Suggi Liverani
 
Nguyen Phuong Truong Anh - Some new vulnerabilities in modern web application
Nguyen Phuong Truong Anh  - Some new vulnerabilities in modern web applicationNguyen Phuong Truong Anh  - Some new vulnerabilities in modern web application
Nguyen Phuong Truong Anh - Some new vulnerabilities in modern web applicationSecurity Bootcamp
 
15 Years of Web Security: The Rebellious Teenage Years
15 Years of Web Security: The Rebellious Teenage Years15 Years of Web Security: The Rebellious Teenage Years
15 Years of Web Security: The Rebellious Teenage YearsJeremiah Grossman
 
110864103 adventures-in-bug-hunting
110864103 adventures-in-bug-hunting110864103 adventures-in-bug-hunting
110864103 adventures-in-bug-huntingbob dobbs
 
Pham Ngọc Bắc - An toàn thông tin dưới góc nhìn Quản lý theo tiêu chuẩn Quốc...
Pham Ngọc Bắc - An toàn thông tin dưới góc nhìn Quản lý theo tiêu chuẩn Quốc...Pham Ngọc Bắc - An toàn thông tin dưới góc nhìn Quản lý theo tiêu chuẩn Quốc...
Pham Ngọc Bắc - An toàn thông tin dưới góc nhìn Quản lý theo tiêu chuẩn Quốc...Security Bootcamp
 
Richard Johnson, high performance fuzzing
Richard Johnson, high performance fuzzingRichard Johnson, high performance fuzzing
Richard Johnson, high performance fuzzingPacSecJP
 
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...Kousuke Ebihara
 
Trần Anh Khoa - Kautilya và Powershell trong kỹ thuật tấn công tiếp cận
Trần Anh Khoa - Kautilya và Powershelltrong kỹ thuật tấn công tiếp cậnTrần Anh Khoa - Kautilya và Powershelltrong kỹ thuật tấn công tiếp cận
Trần Anh Khoa - Kautilya và Powershell trong kỹ thuật tấn công tiếp cậnSecurity Bootcamp
 
Exploratory Testing As A Quest
Exploratory Testing As A QuestExploratory Testing As A Quest
Exploratory Testing As A QuestChrishoneybee
 

En vedette (20)

State of Web Security RailsConf 2016
State of Web Security RailsConf 2016State of Web Security RailsConf 2016
State of Web Security RailsConf 2016
 
Asegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File DownloadingAsegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File Downloading
 
Bug Hunting Safari
Bug Hunting SafariBug Hunting Safari
Bug Hunting Safari
 
Reversing JavaScript
Reversing JavaScriptReversing JavaScript
Reversing JavaScript
 
Cross Context Scripting attacks & exploitation
Cross Context Scripting attacks & exploitationCross Context Scripting attacks & exploitation
Cross Context Scripting attacks & exploitation
 
Exploiting Firefox Extensions
Exploiting Firefox ExtensionsExploiting Firefox Extensions
Exploiting Firefox Extensions
 
Xml external entities [xxe]
Xml external entities [xxe]Xml external entities [xxe]
Xml external entities [xxe]
 
Philip Hung Cao - Cloud security, the journey has begun
Philip Hung Cao - Cloud security, the journey has begunPhilip Hung Cao - Cloud security, the journey has begun
Philip Hung Cao - Cloud security, the journey has begun
 
Bridging the gap - Security and Software Testing
Bridging the gap - Security and Software TestingBridging the gap - Security and Software Testing
Bridging the gap - Security and Software Testing
 
Nguyen Phuong Truong Anh - Some new vulnerabilities in modern web application
Nguyen Phuong Truong Anh  - Some new vulnerabilities in modern web applicationNguyen Phuong Truong Anh  - Some new vulnerabilities in modern web application
Nguyen Phuong Truong Anh - Some new vulnerabilities in modern web application
 
Million Browser Botnet
Million Browser BotnetMillion Browser Botnet
Million Browser Botnet
 
15 Years of Web Security: The Rebellious Teenage Years
15 Years of Web Security: The Rebellious Teenage Years15 Years of Web Security: The Rebellious Teenage Years
15 Years of Web Security: The Rebellious Teenage Years
 
110864103 adventures-in-bug-hunting
110864103 adventures-in-bug-hunting110864103 adventures-in-bug-hunting
110864103 adventures-in-bug-hunting
 
Pham Ngọc Bắc - An toàn thông tin dưới góc nhìn Quản lý theo tiêu chuẩn Quốc...
Pham Ngọc Bắc - An toàn thông tin dưới góc nhìn Quản lý theo tiêu chuẩn Quốc...Pham Ngọc Bắc - An toàn thông tin dưới góc nhìn Quản lý theo tiêu chuẩn Quốc...
Pham Ngọc Bắc - An toàn thông tin dưới góc nhìn Quản lý theo tiêu chuẩn Quốc...
 
Richard Johnson, high performance fuzzing
Richard Johnson, high performance fuzzingRichard Johnson, high performance fuzzing
Richard Johnson, high performance fuzzing
 
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...
 
Trần Anh Khoa - Kautilya và Powershell trong kỹ thuật tấn công tiếp cận
Trần Anh Khoa - Kautilya và Powershelltrong kỹ thuật tấn công tiếp cậnTrần Anh Khoa - Kautilya và Powershelltrong kỹ thuật tấn công tiếp cận
Trần Anh Khoa - Kautilya và Powershell trong kỹ thuật tấn công tiếp cận
 
Augmented reality in your web proxy
Augmented reality in your web proxyAugmented reality in your web proxy
Augmented reality in your web proxy
 
Owasp Top 10 A1: Injection
Owasp Top 10 A1: InjectionOwasp Top 10 A1: Injection
Owasp Top 10 A1: Injection
 
Exploratory Testing As A Quest
Exploratory Testing As A QuestExploratory Testing As A Quest
Exploratory Testing As A Quest
 

Similaire à Let's creating your own PHP (tejimaya version)

build your own php extension
build your own php extensionbuild your own php extension
build your own php extensionhazzaz
 
Building Development Environment with php-build and phpenv
Building Development Environment with php-build and phpenvBuilding Development Environment with php-build and phpenv
Building Development Environment with php-build and phpenvYuya Takeyama
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8Wim Godden
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsDECK36
 
Php through the eyes of a hoster
Php through the eyes of a hosterPhp through the eyes of a hoster
Php through the eyes of a hosterCombell NV
 
Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Combell NV
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Molliewillemstuursma
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)p3castro
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugDavid Golden
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworksKirk Madera
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Pantheon
 
Php through the eyes of a hoster confoo
Php through the eyes of a hoster confooPhp through the eyes of a hoster confoo
Php through the eyes of a hoster confooCombell NV
 
Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10Combell NV
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$Joe Ferguson
 
Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13DanWooster1
 
Unit testing symfony plugins with php unit
Unit testing symfony plugins with php unitUnit testing symfony plugins with php unit
Unit testing symfony plugins with php unitChristian Schaefer
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python courseEran Shlomo
 

Similaire à Let's creating your own PHP (tejimaya version) (20)

build your own php extension
build your own php extensionbuild your own php extension
build your own php extension
 
Building Development Environment with php-build and phpenv
Building Development Environment with php-build and phpenvBuilding Development Environment with php-build and phpenv
Building Development Environment with php-build and phpenv
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
Php through the eyes of a hoster
Php through the eyes of a hosterPhp through the eyes of a hoster
Php through the eyes of a hoster
 
Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Mollie
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)
 
FireBug And FirePHP
FireBug And FirePHPFireBug And FirePHP
FireBug And FirePHP
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with Jitterbug
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
Php through the eyes of a hoster confoo
Php through the eyes of a hoster confooPhp through the eyes of a hoster confoo
Php through the eyes of a hoster confoo
 
Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10
 
Php on Windows
Php on WindowsPhp on Windows
Php on Windows
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13
 
Php extensions
Php extensionsPhp extensions
Php extensions
 
Unit testing symfony plugins with php unit
Unit testing symfony plugins with php unitUnit testing symfony plugins with php unit
Unit testing symfony plugins with php unit
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 

Plus de Kousuke Ebihara

お前は PHP の歴史的な理由の数を覚えているのか
お前は PHP の歴史的な理由の数を覚えているのかお前は PHP の歴史的な理由の数を覚えているのか
お前は PHP の歴史的な理由の数を覚えているのかKousuke Ebihara
 
Using Symfony Templating On Symfony 1
Using Symfony Templating On Symfony 1Using Symfony Templating On Symfony 1
Using Symfony Templating On Symfony 1Kousuke Ebihara
 
Introduction of symfony development process & What's symfony 1.3?
Introduction of symfony development process & What's symfony 1.3?Introduction of symfony development process & What's symfony 1.3?
Introduction of symfony development process & What's symfony 1.3?Kousuke Ebihara
 
OAuthで気持ちのいい アクセス制御を
OAuthで気持ちのいいアクセス制御をOAuthで気持ちのいいアクセス制御を
OAuthで気持ちのいい アクセス制御をKousuke Ebihara
 
Php5.3ってなんなんだー
Php5.3ってなんなんだーPhp5.3ってなんなんだー
Php5.3ってなんなんだーKousuke Ebihara
 
ルーティングを使って シンプルなアプリケーション開発を
ルーティングを使ってシンプルなアプリケーション開発をルーティングを使ってシンプルなアプリケーション開発を
ルーティングを使って シンプルなアプリケーション開発をKousuke Ebihara
 

Plus de Kousuke Ebihara (8)

お前は PHP の歴史的な理由の数を覚えているのか
お前は PHP の歴史的な理由の数を覚えているのかお前は PHP の歴史的な理由の数を覚えているのか
お前は PHP の歴史的な理由の数を覚えているのか
 
Open pne3 with_symfony
Open pne3 with_symfonyOpen pne3 with_symfony
Open pne3 with_symfony
 
Hybrid Onboarding
Hybrid OnboardingHybrid Onboarding
Hybrid Onboarding
 
Using Symfony Templating On Symfony 1
Using Symfony Templating On Symfony 1Using Symfony Templating On Symfony 1
Using Symfony Templating On Symfony 1
 
Introduction of symfony development process & What's symfony 1.3?
Introduction of symfony development process & What's symfony 1.3?Introduction of symfony development process & What's symfony 1.3?
Introduction of symfony development process & What's symfony 1.3?
 
OAuthで気持ちのいい アクセス制御を
OAuthで気持ちのいいアクセス制御をOAuthで気持ちのいいアクセス制御を
OAuthで気持ちのいい アクセス制御を
 
Php5.3ってなんなんだー
Php5.3ってなんなんだーPhp5.3ってなんなんだー
Php5.3ってなんなんだー
 
ルーティングを使って シンプルなアプリケーション開発を
ルーティングを使ってシンプルなアプリケーション開発をルーティングを使ってシンプルなアプリケーション開発を
ルーティングを使って シンプルなアプリケーション開発を
 

Dernier

VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 

Dernier (20)

VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 

Let's creating your own PHP (tejimaya version)

  • 1. Let’s Exciting on Your Own PHP! Kousuke Ebihara <ebihara@tejimaya.com>
  • 2. 4 OpenPNE 3.2 3.4 • (^o^) • • OpenPNE PHP • • (Ebinglish) •
  • 3. Go to our main topic...
  • 6. Let’s Exciting on Your Own PHP Why do I want to get my own PHP ?
  • 7. What for? • Improving my work • Just for fun
  • 8. Use 5.3. And 5.2 • You should use PHP 5.3 for your developing, if you know about backward incompatible changes in the version • Some code for PHP 5.2 may not work under PHP 5.3 :( But the other way around if you are careful. • Use 5.2 when you worry about your script. (So must ready to use PHP 5.2!)
  • 9. But then ... • Do you know about the following script is not work under PHP 5.2? Why?
  • 11. Oh, it is just a bug! http://bugs.php.net/bug.php?id=45820
  • 13. Trace changes • From 16 Jul 2009, PHP is hosted on SVN and there is a GitHub mirror! • So you can trace some changes in your git clone easy • Let’s tour through changes by using Git
  • 14. Fixed only in PHP 5.3?
  • 16. In PHP 5.2 So dreadful...
  • 17. Talk about something else • I’ve written the following code by an oversight in template (But it is only worked in “short_open_tag=1” environment): <?= $var ?> • And I’ve written the following code too (But it is only worked in “short_open_tag=0” environment): <?xml version=”1.0” encoding=”utf-8”?> <?php if ($flag): ?> :
  • 18. A developer of Debian has the interesting patch • The patch makes the PHP 5.3 notify E_DEPRECATED error if the script uses short open tags (c.f. debian git repository) • If the feature had been in PHP, I wouldn’t have gotten the mentioned error.
  • 19. Unfortunately, the patch may be rejected ... • [PHP-DEV] Throwing an E_DEPRECATED for short_open_tag http://marc.info/?t=126334748600001 • But I really need it!
  • 20. So I want to get the following PHP 5.3 for improving my work • Notify errors to code that doesn’t work under the php 5.2.x • Notify to environment dependency code (e.g. short_open_tag)
  • 21. I thought of... • creating my own PHP!
  • 22. Let’s Exciting on Your Own PHP Build PHP
  • 23. Knowing the way to build PHP is important • You can build many variations of PHP by your needs • You can test your script under the specified version of PHP (e.g. array_unique() is breaked BC only in PHP 5.2.9)
  • 24. Prepare to build PHP • Here we get source code from Git repository for our customizing • http://github.com/php/php-src • See http://www.php.net/manual/ja/install.unix.php and http://www.php.net/svn.php • Combinations of “autoconf”, “automake” and “libtool” is very important.You may get older version of them by your hand • If you want to compile Git or SVN version of PHP 5.2, you must prepare flex 2.5.4 • Some program may be not used if you using packaged PHP (because it contains pre-generated files) • If you want to use Git version of PHP, please get latest git and git-svn (I got errors by using git 1.6.5) • Of course, you must prepare some packages needed by extensions that you want to use
  • 25. Prepare configuring (only for SVN and Git version) • SVN and Git version of PHP don’t have something to configure • So you should execute “./buildconf” • Make sure that you use certain version of autoconf, automake and libtool. For example, I specified autoconf and autoheader to use (in Debian sid)
  • 26. Configure PHP • You can see the available configure options by executing “./configure --help” • Some options is for extension (enable-xxx, disable-xxx, with-xxx, without-xxx). So you don’t need to be afraid of options if you know about your needed extensions • Build PHP many times is normal
  • 27. My configure options • http://gist.github.com/277126 • ./configure --enable-mbstring --with-apxs2=/usr/bin/apxs2 --with-gd --with-mysql --with-pgsql --with-pdo-mysql=/usr --with-pdo-pgsql --with-pdo-sqlite --with-pear --with-jpeg-dir=/usr/lib --with-curl --with-zlib • If you want to use multiple php, you may want to add --with-config-file-path
  • 28. Make and Install • Do make • Do make test (I always pass it) • Do make install • Compiled php is in sapi/* .You can copy the binaries or intermediate files by your hand
  • 29. Let’s Exciting on Your Own PHP Customize PHP
  • 30. For my working Add original error level • I want to add “EE_COMPAT_52” and “EE_ENV_DEP” • EE_COMPAT_52 is for notifying “it may not be working under the php 5.2.x“ • EE_ENV_DEP is for notifying “it may be environment depended code” • EE_ is Ebi_Error
  • 31. For my working Add original error level • I referred adding E_DEPRECATED commit • $ git log --grep=”E_DEPRECATED” • I must rewrite: • Zend/zend_errors.h : define constants • Zend/zend.c : zend_error() • Zend/zend_constants.c : zend_register_standard_constants() • main/main.c : php_error_cb() • And notify the new error by zend_error() (in Zend Engine) and php_error_docref (in PHP)
  • 32. For my working Add original error level • Now, I have a patch for realizing this • Adding EE_COMPAT_52 and EE_ENV_DEP • http://github.com/ebihara/php-src/commit/ 2fdd6fe27188ad3c5878b1fd3a8229e35f84d8fd • Notice to <? • http://github.com/ebihara/php-src/commit/ e6706d2b9a576cd81991868d9a8522ba50c37593 • Notice to $list[‘’] = ‘’; • http://github.com/ebihara/php-src/commit/ 1e9484ad04ca03b340bdd51d1f39acee32b86182
  • 33. For my working Add original error level
  • 34. For my working Add original error level
  • 35. For my working Add original error level • I want to add notices based on http://www.php.net/manual/ja/ migration53.deprecated.php • Any idea?
  • 37. For my fun Insertion ; • ; • ECMA Script (Automatic Semicolon Insertion) • } •
  • 38. For my fun Keyword Arguments • RSS
  • 39. For my fun Keyword Arguments • Python