SlideShare ist ein Scribd-Unternehmen logo
1 von 68
2010/03/06 id:heavenshell
wozozo




 …
id:heavenshell (3/6                   )



  http://d.hatena.ne.jp/heavenshell

  http://twitter.com/heavenshell

  http://github.com/heavenshell

  http://openpear.org/maintainer/heavenshell

                    Java                  (Cubby   )

  Python, JavaScript, Vim
2007                 (        )



(PEAR::Pager    ) → Phwittr

 Ver1.5



 Ver1.8   Zend_Application
Zend_Application



                   (2009/10)



  1.10
Zend_Application



                   (2009/10)



  1.10
Doctrine




  Doctrine   Doctrine   …

                   ←
ASP                    (         )

        CRUD




cron

               (JavaScript)       API
Zend Framework        1.9x

  http://github.com/heavenshell/gene
Zend_Db, Revulo_View_Phtmlc

  Doctrine                   Twig

             Github           web-app-theme
http://github.com/pilu/web-app-theme
app
  |-- Gene.php
  |-- config
  |-- layouts
  | |-- admin
  | `-- index
  |-- locales
  | `-- ja
  |-- models
  | |-- Tables
  | `-- Tables.php
  |-- modules
  | |-- admin
  | |-- api
  | `-- index
  |-- plugins
  | `-- Gene
  |-- services
  `-- views
       `-- scripts
app
  |-- Gene.php
  |-- config
  |-- layouts
  | |-- admin
  | `-- index
  |-- locales
  | `-- ja
  |-- models         Zend_Db (   Dao)
  | |-- Tables
  | `-- Tables.php
  |-- modules
  | |-- admin
  | |-- api
  | `-- index
  |-- plugins
  | `-- Gene
  |-- services
  `-- views
       `-- scripts
app
  |-- Gene.php
  |-- config
  |-- layouts
  | |-- admin
  | `-- index
  |-- locales
  | `-- ja
  |-- models         Zend_Db (    Dao)
  | |-- Tables
  | `-- Tables.php
  |-- modules         Zend_Controller
  | |-- admin
  | |-- api
  | `-- index
  |-- plugins
  | `-- Gene
  |-- services
  `-- views
       `-- scripts
app
  |-- Gene.php
  |-- config
  |-- layouts
  | |-- admin
  | `-- index
  |-- locales
  | `-- ja
  |-- models         Zend_Db (       Dao)
  | |-- Tables
  | `-- Tables.php
  |-- modules         Zend_Controller
  | |-- admin
  | |-- api
  | `-- index
  |-- plugins
  | `-- Gene                     (          )
  |-- services
  `-- views
       `-- scripts
app
  |-- Gene.php
  |-- config
  |-- layouts
  | |-- admin
  | `-- index
  |-- locales
  | `-- ja
  |-- models         Zend_Db (       Dao)
  | |-- Tables
  | `-- Tables.php
  |-- modules         Zend_Controller
  | |-- admin
  | |-- api
  | `-- index
  |-- plugins
  | `-- Gene                     (          )
  |-- services
  `-- views
       `-- scripts
modules

          application
Plugin
 Zend_Controller_Plugin_Abstract

                    (              )



   CSRF

            ○○
Zend_Auth::getInstance()->getIdentity();
Q4M
 Openpear::Net_Q4M
                           …

 Zend_Queue

  Zend_Queue_Adapter_Q4m
1.7x
Zend Framework         use-at-will




                   DB, View, Session, Routing,
             etc
1.8

Zend_Application



  Dependency Injection
           noopable

1.7
Storefront (http://www.thepopeisdead.com/)
  Zend_Application

zfdebugdoctrine (http://github.com/danceric/zfdebugdoctrine)
  ZFDebug          Doctrine
Magento (http://www.magentocommerce.com/)
  OSS       EC

Live Commerce (http://www.live-commerce.com/)
              OSS

TomatoCMS (http://tomatocms.com/)
  OSS       CMS
Zend_Application_Bootstrap_Bootstrap



application.ini                      ini

                                    application/
Bootstrap.php
Zend_Application_Bootstrap_Bootstrap
[application.ini]
bootstrap.path = GENE_LIB_PATH "/Bootstrap.php"
bootstrap.class = "Gene_Bootstrap"
 application.ini        ↓              ini

bootstrap.path = GENE_APP_PATH "/Phwitter.php"
                                  application/
bootstrap.class = "Phwittr"
Bootstrap.php
(         junichiro
                      )

Zend_Db, Doctrine
                (           Zend_Db)

View                              (ry

Zend_Log       Zend_Cache
…
Validation
 Zend_Filter_Input
      (Zend_Form     )



 Zend_Translate
FW   ini



           Zend_Translate
$requests = array('name' => 'hogehogehoge');
$validations = array(
   'name' => array(
       new Zend_Validate_StringLength(1, 10, 'utf-8'),
       'messages' => array(
          0 => $translate->_('User name should enter less than 100.'),
     )
   )
);
$validator = new Zend_Filter_Input(null, $validation);
$valid = $validator->setData($requests)->isValid();
var_dump($input->getInvalid());
$requests = array('name' => 'hogehogehoge');
$validations = array(
   'name' => array(
       new Zend_Validate_StringLength(1, 10, 'utf-8'),
       'messages' => array(
          0 => $translate->_('User name should enter less than 100.'),
     )
   )
);
        Zend_Translate
$validator = new Zend_Filter_Input(null, $validation);
$valid = $validator->setData($requests)->isValid();
var_dump($input->getInvalid());
$requests = array('name' => 'hogehogehoge');
$validations = array(
   'name' => array(
       new Zend_Validate_StringLength(1, 10, 'utf-8'),
       'messages' => array(
          0 => $translate->_('User name should enter less than 100.'),
     )
   )
);
        Zend_Translate
$validator = new Zend_Filter_Input(null, $validation);
$valid = $validator->setData($requests)->isValid();
var_dump($input->getInvalid());
$requests = array('name' => 'hogehogehoge');
$validations = array(
   'name' => array(
       new Zend_Validate_StringLength(1, 10, 'utf-8'),
       'messages' => array(
          0 => $translate->_('User name should enter less than 100.'),
     )
   )
);
        Zend_Translate
$validator = new Zend_Filter_Input(null, $validation);
$valid = $validator->setData($requests)->isValid();
var_dump($input->getInvalid());

array(1) {
 ["name"]=>
 array(1) {
  ["stringLengthTooLong"]=>
  string(42) "          10                                 "
}
$requests = array('name' => 'hogehogehoge');
$validations = array(
   'name' => array(
       new Zend_Validate_StringLength(1, 10, 'utf-8'),
       'messages' => array(
          0 => $translate->_('User name should enter less than 100.'),
     )
   )
);
        Zend_Translate
$validator = new Zend_Filter_Input(null, $validation);
$valid = $validator->setData($requests)->isValid();
var_dump($input->getInvalid());

array(1) {
 ["name"]=>
 array(1) {
  ["stringLengthTooLong"]=>
  string(42) "          10                                 "
}
$requests = array('email' => 'example@example.c');
$validations = array(
   'email' => array(
       new Zend_Validate_EmailAddress(),
       'messages' => array(
           0 => $translate->_('Email is invaild.'),
        )
     )
   )
);
$validator = new Zend_Filter_Input(null, $validation);
$valid = $validator->setData($requests)->isValid();
var_dump($input->getInvalid());
$requests = array('email' => 'example@example.c');
$validations = array(
   'email' => array(
       new Zend_Validate_EmailAddress(),
       'messages' => array(
           0 => $translate->_('Email is invaild.'),
        )
     )
   )
);
$validator = new Zend_Filter_Input(null, $validation);
$valid = $validator->setData($requests)->isValid();
var_dump($input->getInvalid());
array(1) {
 ["email"]=>
 array(1) {
  ["emailAddressInvalidHostname"]=>
  string(26) "                      "
    }
}
array(1) {
 ["email"]=>
 array(1) {
  ["emailAddressInvalidHostname"]=>
  string(26) "                      "
    }
}
_




| ∪       __   __       J|             _
      u        ´             ||            |
                                  ||           |




                    ●
| ∪       __   __       J|             _
      u        ´             ||            |
                                  ||           |
array(1) {
  ["email"]=>
  array(3) {
    ["emailAddressInvalidHostname"]=>
    string(70) "'example.c' is no valid hostname for email address
'example@example.c'"
    ["hostnameUndecipherableTld"]=>
    string(68) "'example.c' appears to be a DNS hostname but cannot extract
TLD part"
    ["hostnameLocalNameNotAllowed"]=>
    string(86) "'example.c' appears to be a local network name but local
network names are not allowed"
  }
}
::::::
   ::::::::       ○              ○
|::::::::::::::::::::       __       __   ::::    |   _
 :::::::::            |r -|                 ||            |
   ::::::::::::         `    '´                  ||           |
::::::
   ::::::::       ○              ○
|::::::::::::::::::::       __       __   ::::    |   _
 :::::::::            |r -|                 ||            |
   ::::::::::::         `    '´                  ||           |
Zend_Validation_EmailAddress
Zend_Translate

                            translate
  Zend_Validate_Abstract

Zend_Validate_Abstract::setDefaultTranslator($transla
te);
1.9x, 1.10x

  http://github.com/heavenshell/gene/blob/0.2/app/
  locales/ja/validate.ini
  http://github.com/heavenshell/zf-resources-lang-ja/
  blob/master/Zend_Validate.php
         typo                          <(_ _)>
[Ver1.9x]
$locale = new Zend_Locale();
$path = '/path/to/ja/file.ini';
$translate = new Zend_Translate('ini', $path, $locale);
Zend_Validate_Abstract::setDefaultTranslator($translate);

[Ver1.10x]
$locale = new Zend_Locale();
$path = '/path/to/resources/languages';
$scan = array('scan' => Zend_Translate::LOCALE_DIRECTORY);
$translate = new Zend_Translate('array', $path, $locale, $scan);
Zend_Validate_Abstract::setDefaultTranslator($translate);
[Ver1.9x]
$locale = new Zend_Locale();
$path = '/path/to/ja/file.ini';
$translate = new Zend_Translate('ini', $path, $locale);
Zend_Validate_Abstract::setDefaultTranslator($translate);

[Ver1.10x]                                            array()
$locale = new Zend_Locale();
$path = '/path/to/resources/languages';
$scan = array('scan' => Zend_Translate::LOCALE_DIRECTORY);
$translate = new Zend_Translate('array', $path, $locale, $scan);
Zend_Validate_Abstract::setDefaultTranslator($translate);
→   (   )
trunk
"                 '%value%'       '%hostname%'
                              "



Zend_Validate.php




    Zend_Translate#addTranslation()
return array(
  ''%hostname%' is no valid hostname for email address '%value%'' => '
                                            ///'
);

$locale = new Zend_Locale();
$path = '/path/to/resources/languages';
$scan = array('scan' => Zend_Translate::LOCALE_DIRECTORY);
$translate = new Zend_Translate('array', $path, $locale, $scan);
$anotherpath = '/path/to/resources/languages' . $lang . '/Another.php';
$translate->addTranslation($anotherpath);
Zend_Validate_Abstract::setDefaultTranslator($translate);

array(3) {
 ["emailAddressInvalidHostname"]=>
 string(72) "                                               ///"
     ["hostnameUndecipherableTld"]=>
     string(82) "'examlpe.c' DNS                     TLD                  "
     ["hostnameLocalNameNotAllowed"]=>
     string(126) " 'examle.c'
                            "
}
return array(
  ''%hostname%' is no valid hostname for email address '%value%'' => '
                                            ///'
);

$locale = new Zend_Locale();
$path = '/path/to/resources/languages';
$scan = array('scan' => Zend_Translate::LOCALE_DIRECTORY);
$translate = new Zend_Translate('array', $path, $locale, $scan);
$anotherpath = '/path/to/resources/languages' . $lang . '/Another.php';
$translate->addTranslation($anotherpath);
Zend_Validate_Abstract::setDefaultTranslator($translate);

array(3) {
 ["emailAddressInvalidHostname"]=>
 string(72) "                                               ///"
     ["hostnameUndecipherableTld"]=>
     string(82) "'examlpe.c' DNS                     TLD                  "
     ["hostnameLocalNameNotAllowed"]=>
     string(126) " 'examle.c'
                            "
}
return array(
  ''%hostname%' is no valid hostname for email address '%value%'' => '
                                            ///'
);

$locale = new Zend_Locale();
$path = '/path/to/resources/languages';
$scan = array('scan' => Zend_Translate::LOCALE_DIRECTORY);
$translate = new Zend_Translate('array', $path, $locale, $scan);
$anotherpath = '/path/to/resources/languages' . $lang . '/Another.php';
$translate->addTranslation($anotherpath);
Zend_Validate_Abstract::setDefaultTranslator($translate);

array(3) {
 ["emailAddressInvalidHostname"]=>
 string(72) "                                               ///"
     ["hostnameUndecipherableTld"]=>
     string(82) "'examlpe.c' DNS                     TLD                  "
     ["hostnameLocalNameNotAllowed"]=>
     string(126) " 'examle.c'
                            "
}
CRUD



  →        →   x(     +    )x



Scafford
FW




TDD
PHPUnit

Stagehand_Testrunner



                                 …



                …
CRUD



     →   →       x(   +   )

DB

 FW (        )                …
Zend Framework

                  Zend_Application




 Zend_Translate



                       (    )
Any questions?

Weitere ähnliche Inhalte

Was ist angesagt?

関西アンカンファレンス PHP ではじめるテストコード
関西アンカンファレンス PHP ではじめるテストコード関西アンカンファレンス PHP ではじめるテストコード
関西アンカンファレンス PHP ではじめるテストコードShinya Ohyanagi
 
Smolder @Silex
Smolder @SilexSmolder @Silex
Smolder @SilexJeen Lee
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
Security 202 - Are you sure your site is secure?
Security 202 - Are you sure your site is secure?Security 202 - Are you sure your site is secure?
Security 202 - Are you sure your site is secure?ConFoo
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)julien pauli
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsMark Baker
 
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesPHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesEric Poe
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13julien pauli
 
Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+ConFoo
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5Wim Godden
 
Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8Nikita Popov
 
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 OverlordsI, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlordsheumann
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6Wim Godden
 
How to deploy node to production
How to deploy node to productionHow to deploy node to production
How to deploy node to productionSean Hess
 
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPIPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPGuilherme Blanco
 

Was ist angesagt? (20)

関西アンカンファレンス PHP ではじめるテストコード
関西アンカンファレンス PHP ではじめるテストコード関西アンカンファレンス PHP ではじめるテストコード
関西アンカンファレンス PHP ではじめるテストコード
 
Smolder @Silex
Smolder @SilexSmolder @Silex
Smolder @Silex
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
New in php 7
New in php 7New in php 7
New in php 7
 
Security 202 - Are you sure your site is secure?
Security 202 - Are you sure your site is secure?Security 202 - Are you sure your site is secure?
Security 202 - Are you sure your site is secure?
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
 
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesPHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return Types
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13
 
Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+
 
PHP7 Presentation
PHP7 PresentationPHP7 Presentation
PHP7 Presentation
 
The new features of PHP 7
The new features of PHP 7The new features of PHP 7
The new features of PHP 7
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5
 
Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8
 
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 OverlordsI, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlords
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
 
Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6
 
PHP7 is coming
PHP7 is comingPHP7 is coming
PHP7 is coming
 
How to deploy node to production
How to deploy node to productionHow to deploy node to production
How to deploy node to production
 
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPIPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
 

Ähnlich wie Zend Framework Study@Tokyo #2

Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxMichelangelo van Dam
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11Michelangelo van Dam
 
Quality assurance for php projects with PHPStorm
Quality assurance for php projects with PHPStormQuality assurance for php projects with PHPStorm
Quality assurance for php projects with PHPStormMichelangelo van Dam
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Michelangelo van Dam
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From IusethisMarcus Ramberg
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of LithiumNate Abele
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applicationschartjes
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Michelangelo van Dam
 
Disregard Inputs, Acquire Zend_Form
Disregard Inputs, Acquire Zend_FormDisregard Inputs, Acquire Zend_Form
Disregard Inputs, Acquire Zend_FormDaniel Cousineau
 
Lithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate FrameworksLithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate FrameworksNate Abele
 
Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web servicesMichelangelo van Dam
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf Conference
 
Zend Framework 2 - Basic Components
Zend Framework 2  - Basic ComponentsZend Framework 2  - Basic Components
Zend Framework 2 - Basic ComponentsMateusz Tymek
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Leonardo Proietti
 

Ähnlich wie Zend Framework Study@Tokyo #2 (20)

Unit testing zend framework apps
Unit testing zend framework appsUnit testing zend framework apps
Unit testing zend framework apps
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
 
Quality assurance for php projects with PHPStorm
Quality assurance for php projects with PHPStormQuality assurance for php projects with PHPStorm
Quality assurance for php projects with PHPStorm
 
Fatc
FatcFatc
Fatc
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
 
Framework
FrameworkFramework
Framework
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Disregard Inputs, Acquire Zend_Form
Disregard Inputs, Acquire Zend_FormDisregard Inputs, Acquire Zend_Form
Disregard Inputs, Acquire Zend_Form
 
Lithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate FrameworksLithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate Frameworks
 
Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web services
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
Zend Framework 2 - Basic Components
Zend Framework 2  - Basic ComponentsZend Framework 2  - Basic Components
Zend Framework 2 - Basic Components
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5
 

Kürzlich hochgeladen

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

Zend Framework Study@Tokyo #2

  • 3.
  • 4. id:heavenshell (3/6 ) http://d.hatena.ne.jp/heavenshell http://twitter.com/heavenshell http://github.com/heavenshell http://openpear.org/maintainer/heavenshell Java (Cubby ) Python, JavaScript, Vim
  • 5. 2007 ( ) (PEAR::Pager ) → Phwittr Ver1.5 Ver1.8 Zend_Application
  • 6. Zend_Application (2009/10) 1.10
  • 7. Zend_Application (2009/10) 1.10
  • 8. Doctrine Doctrine Doctrine … ←
  • 9.
  • 10. ASP ( ) CRUD cron (JavaScript) API
  • 11. Zend Framework 1.9x http://github.com/heavenshell/gene Zend_Db, Revulo_View_Phtmlc Doctrine Twig Github web-app-theme http://github.com/pilu/web-app-theme
  • 12. app |-- Gene.php |-- config |-- layouts | |-- admin | `-- index |-- locales | `-- ja |-- models | |-- Tables | `-- Tables.php |-- modules | |-- admin | |-- api | `-- index |-- plugins | `-- Gene |-- services `-- views `-- scripts
  • 13. app |-- Gene.php |-- config |-- layouts | |-- admin | `-- index |-- locales | `-- ja |-- models Zend_Db ( Dao) | |-- Tables | `-- Tables.php |-- modules | |-- admin | |-- api | `-- index |-- plugins | `-- Gene |-- services `-- views `-- scripts
  • 14. app |-- Gene.php |-- config |-- layouts | |-- admin | `-- index |-- locales | `-- ja |-- models Zend_Db ( Dao) | |-- Tables | `-- Tables.php |-- modules Zend_Controller | |-- admin | |-- api | `-- index |-- plugins | `-- Gene |-- services `-- views `-- scripts
  • 15. app |-- Gene.php |-- config |-- layouts | |-- admin | `-- index |-- locales | `-- ja |-- models Zend_Db ( Dao) | |-- Tables | `-- Tables.php |-- modules Zend_Controller | |-- admin | |-- api | `-- index |-- plugins | `-- Gene ( ) |-- services `-- views `-- scripts
  • 16. app |-- Gene.php |-- config |-- layouts | |-- admin | `-- index |-- locales | `-- ja |-- models Zend_Db ( Dao) | |-- Tables | `-- Tables.php |-- modules Zend_Controller | |-- admin | |-- api | `-- index |-- plugins | `-- Gene ( ) |-- services `-- views `-- scripts
  • 17. modules application
  • 19.
  • 20.
  • 22. Q4M Openpear::Net_Q4M … Zend_Queue Zend_Queue_Adapter_Q4m
  • 23.
  • 24. 1.7x Zend Framework use-at-will DB, View, Session, Routing, etc
  • 25. 1.8 Zend_Application Dependency Injection noopable 1.7
  • 26. Storefront (http://www.thepopeisdead.com/) Zend_Application zfdebugdoctrine (http://github.com/danceric/zfdebugdoctrine) ZFDebug Doctrine
  • 27. Magento (http://www.magentocommerce.com/) OSS EC Live Commerce (http://www.live-commerce.com/) OSS TomatoCMS (http://tomatocms.com/) OSS CMS
  • 29. Zend_Application_Bootstrap_Bootstrap [application.ini] bootstrap.path = GENE_LIB_PATH "/Bootstrap.php" bootstrap.class = "Gene_Bootstrap" application.ini ↓ ini bootstrap.path = GENE_APP_PATH "/Phwitter.php" application/ bootstrap.class = "Phwittr" Bootstrap.php
  • 30. ( junichiro ) Zend_Db, Doctrine ( Zend_Db) View (ry Zend_Log Zend_Cache
  • 31.
  • 32.
  • 33. Validation Zend_Filter_Input (Zend_Form ) Zend_Translate
  • 34. FW ini Zend_Translate
  • 35. $requests = array('name' => 'hogehogehoge'); $validations = array( 'name' => array( new Zend_Validate_StringLength(1, 10, 'utf-8'), 'messages' => array( 0 => $translate->_('User name should enter less than 100.'), ) ) ); $validator = new Zend_Filter_Input(null, $validation); $valid = $validator->setData($requests)->isValid(); var_dump($input->getInvalid());
  • 36. $requests = array('name' => 'hogehogehoge'); $validations = array( 'name' => array( new Zend_Validate_StringLength(1, 10, 'utf-8'), 'messages' => array( 0 => $translate->_('User name should enter less than 100.'), ) ) ); Zend_Translate $validator = new Zend_Filter_Input(null, $validation); $valid = $validator->setData($requests)->isValid(); var_dump($input->getInvalid());
  • 37. $requests = array('name' => 'hogehogehoge'); $validations = array( 'name' => array( new Zend_Validate_StringLength(1, 10, 'utf-8'), 'messages' => array( 0 => $translate->_('User name should enter less than 100.'), ) ) ); Zend_Translate $validator = new Zend_Filter_Input(null, $validation); $valid = $validator->setData($requests)->isValid(); var_dump($input->getInvalid());
  • 38. $requests = array('name' => 'hogehogehoge'); $validations = array( 'name' => array( new Zend_Validate_StringLength(1, 10, 'utf-8'), 'messages' => array( 0 => $translate->_('User name should enter less than 100.'), ) ) ); Zend_Translate $validator = new Zend_Filter_Input(null, $validation); $valid = $validator->setData($requests)->isValid(); var_dump($input->getInvalid()); array(1) { ["name"]=> array(1) { ["stringLengthTooLong"]=> string(42) " 10 " }
  • 39. $requests = array('name' => 'hogehogehoge'); $validations = array( 'name' => array( new Zend_Validate_StringLength(1, 10, 'utf-8'), 'messages' => array( 0 => $translate->_('User name should enter less than 100.'), ) ) ); Zend_Translate $validator = new Zend_Filter_Input(null, $validation); $valid = $validator->setData($requests)->isValid(); var_dump($input->getInvalid()); array(1) { ["name"]=> array(1) { ["stringLengthTooLong"]=> string(42) " 10 " }
  • 40. $requests = array('email' => 'example@example.c'); $validations = array( 'email' => array( new Zend_Validate_EmailAddress(), 'messages' => array( 0 => $translate->_('Email is invaild.'), ) ) ) ); $validator = new Zend_Filter_Input(null, $validation); $valid = $validator->setData($requests)->isValid(); var_dump($input->getInvalid());
  • 41. $requests = array('email' => 'example@example.c'); $validations = array( 'email' => array( new Zend_Validate_EmailAddress(), 'messages' => array( 0 => $translate->_('Email is invaild.'), ) ) ) ); $validator = new Zend_Filter_Input(null, $validation); $valid = $validator->setData($requests)->isValid(); var_dump($input->getInvalid());
  • 42. array(1) { ["email"]=> array(1) { ["emailAddressInvalidHostname"]=> string(26) " " } }
  • 43. array(1) { ["email"]=> array(1) { ["emailAddressInvalidHostname"]=> string(26) " " } }
  • 44. _ | ∪ __ __ J| _ u ´ || | || | ● | ∪ __ __ J| _ u ´ || | || |
  • 45. array(1) { ["email"]=> array(3) { ["emailAddressInvalidHostname"]=> string(70) "'example.c' is no valid hostname for email address 'example@example.c'" ["hostnameUndecipherableTld"]=> string(68) "'example.c' appears to be a DNS hostname but cannot extract TLD part" ["hostnameLocalNameNotAllowed"]=> string(86) "'example.c' appears to be a local network name but local network names are not allowed" } }
  • 46. :::::: :::::::: ○ ○ |:::::::::::::::::::: __ __ :::: | _ ::::::::: |r -| || | :::::::::::: ` '´ || |
  • 47. :::::: :::::::: ○ ○ |:::::::::::::::::::: __ __ :::: | _ ::::::::: |r -| || | :::::::::::: ` '´ || |
  • 49. Zend_Translate translate Zend_Validate_Abstract Zend_Validate_Abstract::setDefaultTranslator($transla te);
  • 50. 1.9x, 1.10x http://github.com/heavenshell/gene/blob/0.2/app/ locales/ja/validate.ini http://github.com/heavenshell/zf-resources-lang-ja/ blob/master/Zend_Validate.php typo <(_ _)>
  • 51. [Ver1.9x] $locale = new Zend_Locale(); $path = '/path/to/ja/file.ini'; $translate = new Zend_Translate('ini', $path, $locale); Zend_Validate_Abstract::setDefaultTranslator($translate); [Ver1.10x] $locale = new Zend_Locale(); $path = '/path/to/resources/languages'; $scan = array('scan' => Zend_Translate::LOCALE_DIRECTORY); $translate = new Zend_Translate('array', $path, $locale, $scan); Zend_Validate_Abstract::setDefaultTranslator($translate);
  • 52. [Ver1.9x] $locale = new Zend_Locale(); $path = '/path/to/ja/file.ini'; $translate = new Zend_Translate('ini', $path, $locale); Zend_Validate_Abstract::setDefaultTranslator($translate); [Ver1.10x] array() $locale = new Zend_Locale(); $path = '/path/to/resources/languages'; $scan = array('scan' => Zend_Translate::LOCALE_DIRECTORY); $translate = new Zend_Translate('array', $path, $locale, $scan); Zend_Validate_Abstract::setDefaultTranslator($translate);
  • 53. ( )
  • 54.
  • 55.
  • 56. trunk
  • 57. " '%value%' '%hostname%' " Zend_Validate.php Zend_Translate#addTranslation()
  • 58. return array( ''%hostname%' is no valid hostname for email address '%value%'' => ' ///' ); $locale = new Zend_Locale(); $path = '/path/to/resources/languages'; $scan = array('scan' => Zend_Translate::LOCALE_DIRECTORY); $translate = new Zend_Translate('array', $path, $locale, $scan); $anotherpath = '/path/to/resources/languages' . $lang . '/Another.php'; $translate->addTranslation($anotherpath); Zend_Validate_Abstract::setDefaultTranslator($translate); array(3) { ["emailAddressInvalidHostname"]=> string(72) " ///" ["hostnameUndecipherableTld"]=> string(82) "'examlpe.c' DNS TLD " ["hostnameLocalNameNotAllowed"]=> string(126) " 'examle.c' " }
  • 59. return array( ''%hostname%' is no valid hostname for email address '%value%'' => ' ///' ); $locale = new Zend_Locale(); $path = '/path/to/resources/languages'; $scan = array('scan' => Zend_Translate::LOCALE_DIRECTORY); $translate = new Zend_Translate('array', $path, $locale, $scan); $anotherpath = '/path/to/resources/languages' . $lang . '/Another.php'; $translate->addTranslation($anotherpath); Zend_Validate_Abstract::setDefaultTranslator($translate); array(3) { ["emailAddressInvalidHostname"]=> string(72) " ///" ["hostnameUndecipherableTld"]=> string(82) "'examlpe.c' DNS TLD " ["hostnameLocalNameNotAllowed"]=> string(126) " 'examle.c' " }
  • 60. return array( ''%hostname%' is no valid hostname for email address '%value%'' => ' ///' ); $locale = new Zend_Locale(); $path = '/path/to/resources/languages'; $scan = array('scan' => Zend_Translate::LOCALE_DIRECTORY); $translate = new Zend_Translate('array', $path, $locale, $scan); $anotherpath = '/path/to/resources/languages' . $lang . '/Another.php'; $translate->addTranslation($anotherpath); Zend_Validate_Abstract::setDefaultTranslator($translate); array(3) { ["emailAddressInvalidHostname"]=> string(72) " ///" ["hostnameUndecipherableTld"]=> string(82) "'examlpe.c' DNS TLD " ["hostnameLocalNameNotAllowed"]=> string(126) " 'examle.c' " }
  • 61.
  • 62.
  • 63. CRUD → → x( + )x Scafford
  • 66. CRUD → → x( + ) DB FW ( ) …
  • 67. Zend Framework Zend_Application Zend_Translate ( )

Hinweis der Redaktion