SlideShare a Scribd company logo
@wadearnold
      wadearnold.com
wade.arnold@t8webware.com
me?
• PHP developer who became a flash’er MX
• Wrote majority of Zend Amf & lots of
  AMFPHP
• Flash Builder 4 PHP data services
• Currently
 • Scala: Akka STM
 • Thrift: PHP
 • Hadoop: HBase, HDFS, Hive
Every solution I've ever seen or developed in PHP feels
clunky and bulky, there is no elegance or grace. Working
with PHP is a bit like throwing a 10 pound concrete cube
from a ten story building: You'll get where you're going
fast, but it's not very elegant. ... I love PHP, and it's the right
tool for some jobs. It's just an ugly, cumbersome tool that
makes me cry and have nightmares. It's the new VB6 in a C
dress.
Fredrik Holmstrm
Digg, Wikipedia, Facebook, Stumble Upon, Flicker, Tagged,
Vimeo, iStockPhoto, FeedBurner, TechCrunch,YouTube*

                     Written in PHP

               Wordpress, Drupal, Joomla

                     Written in PHP
Some of the largest sites on the internet -- sites you
probably interact with on a daily basis -- are written in
PHP. If PHP sucks so profoundly, why is it powering so
much of the internet?
The only conclusion I can draw is that building a
compelling application is far more important
than choice of language. While PHP wouldn't be my
choice, and if pressed, I might argue that it should never be
the choice for any rational human being sitting in front of a
computer, I can't argue with the results.

                                               Jeff Atwood
                                             Coding Horror
sudo apt-get install zend-framework
Why ZF?
•   Use-at-will Framework

•   Coding Standards / Testing Standards

•   BSD License (Enterprise Friendly)

•   Well Documented

•   Large Community

•   Plenty to integrate!
Why us Zend_Amf?

•   It handles the conversion of data types between
    ActionScript and PHP

•   Converts complex objects and supports class
    mapping

•   Access Control, Authentication, ORM, Logging,
    PHP controllers, another SOA endpoint.
Zend_Amf works?


•   It’s a basic RPC model

    •   SOAP, XML-RPC, REST, etc

•   Call & Response
1 1/2 year’s.....
• Zend Amf Beta was released Oct ‘08
• 226 bugs fixed w/ test cases
• 8 Features added
• 84 outstanding features / bugs
• 89% code coverage 100% method
• 14 SVN committers
• 3 Major refactors
Omar Gonzalez @s9tpepper
Files: Root

app/

lib/

log/

pub/

tmp/
Files: lib/

Zend/
  Acl.php
  ACL/
  Auth/
  Amf/
  ....etc.....
Files: pub/
css/
img/
js/
swf/
  main.swf

xml/
  crossdomain.xml
  gateway-config.xml

.htaccess
index.php
Files: pub/.htaccess
1.RewriteEngine on
2.RewriteEngine ^(crossdomain.xml)$ pub/xml/crossdomain.xml
3.RewriteEngine ^(gateway-config.xml)$ pub/xml/gateway-
  config.xml
4.RewriteEngine ^.(js|ico|gif|jpg|png|xml|swf)$ index.php
5. 
6.php_flag magic_quotes_gpc off
7.php_flag register_globals off
8.php_flag display_errors on
9. 
10.php_value session.auto_start 0
Files: pub/index.php
1.require_once './app/models/HelloWorld.php';
2./** Bootstrap */
3. 
4.// Instantiate server
5.$server = new Zend_Amf_Server();
6.$server->setProduction(false);
7.Zend_Session::start();
8.$server->setSession();
9. 
10.$server->addDirectory(dirname(__FILE__) .'/app/models/');
11. 
12.// Add class to be reflected
13.$server->setClass('HelloWorld');
14.$server->setClass('contact.ContactDAO');
15.$server->setClass('contact.events.ContactDispatch');
16.$server->setClassMap('ContactVo',"Contact");
17. 
18.// Handle request
19.$request = $server->handle();
20.echo($request);
Hybrid site
1.<?php
2.class GatewayController extends Zend_Controller_Action
3.{
4.   public function indexAction()
5.   {
6.      $this->getHelper('ViewRenderer')->setNoRender();      
7.      $server = new Zend_Amf_Server();
8.      $server->addDirectory( dirname(__FILE__) . '/../
  services/' );
9.      echo($server->handle());  
10.   }
11.}
Model


package com.t8.census.vo               <?php
{                                      class Person
	 [Bindable]                           {
	 [RemoteClass(alias="Person")]          public $id = 0;
	 public class PersonVO                  public $age = "";
	 {                                      public $classofworker = "";
	 	 public var id:int = 0;               public $education = "";
	 	 public var age:int;                  public $maritalstatus = "";
	 	 public var classofworker:String;     public $race = "";
	 	 public var education:String;         public $sex = "";
	 	 public var maritalstatus:String;   }
	 	 public var race:String;
	 	 public var sex:String;
	 }
}
SQL



1.CREATE TABLE `census` (
2.  `age` varchar(3) DEFAULT NULL,
3.  `classofworker` varchar(255) DEFAULT NULL,
4.  `education` varchar(255) DEFAULT NULL,
5.  `maritalstatus` varchar(255) DEFAULT NULL,
6.  `race` varchar(255) DEFAULT NULL,
7.  `sex` varchar(255) DEFAULT NULL,
8.  `id` int(11) NOT NULL AUTO_INCREMENT,
9.  PRIMARY KEY (`id`)
10.) ENGINE=InnoDB DEFAULT CHARSET=utf-8
Zend_Db_Table_Abstract


1.class Model_DbTable_Census extends Zend_Db_Table_Abstract
2.{
3.    protected $_rowClass = 'Model_Census';
4.    protected $_name = 'census';
5.}



1.class Model_DbTable_Census extends Zend_Db_Table_Abstract
2.{
3.    protected $_rowClass = 'Model_Census';
4.    protected $_name = 'census';
5.}
Active Record

1.class CensusService {
2.    public function getAllCensus() {
3.        $tbl = new Model_DbTable_Census();
4.        return $tbl->fetchAll()->toArray();
5.    }
6. 
7.    public function getCensusByID( $itemID ) {    
8.        $tbl = new Model_DbTable_Census();
9.        return $tbl->find($itemID)->current();
10.    }
11. 
12.    public function createCensus( $item ) {
13.        $tbl = new Model_DbTable_Census();
14.        $row = $tbl->fetchNew();
15.        $row->setFromArray((array)$item);
16.        $row->save();
17.        return $row->id;
18.    }
19.}
Object-relational mapping




Working with Doctrine, Zend Framework, and Flex
                                           Mihai Corlan
DB Resource Plugin
• Mysqli Result
• Mysql Result
public function getArrayCollection() {
   $this -> connect();
   $sql = "SELECT * FROM census " .
   	 "LIMIT 100";
   $result = mysql_query( $sql ) or die( "Query failed: " .
   mysql_error() );
   return $result;
}
DUDE IT’s PHP
1.  public function getAllItems()  {
2.     $this -> connect();
3.     $sql = "SELECT * FROM census";
4.     $result = mysql_query( $sql ) or die( "Query failed: " .
5.       mysql_error() );
6.  
7.     $census = array();
8.  
9.     while( $row = mysql_fetch_assoc( $result ) ) {
10.      $person = new Person();
11.      $person -> id = $row["id"];
12.      $person -> age = $row["age"];
13.      $person -> classofworker = $row["classofworker"];
14.      $person -> education = $row["education"];
15.      $person -> maritalstatus = $row["maritalstatus"];  
16.      $person -> race = $row["race"];
17.      $person -> sex = $row["sex"];  
18.     
19.      array_push( $census, $person );
20.    }
21.    return $census;
22.  }
Simple Rest
spl_autoload_register(); // don't load our classes unless we use
them

$mode = 'debug'; // 'debug' or 'production'
$server = new RestServer($mode);
// $server->refreshCache(); // uncomment momentarily to clear
the cache if classes change in production mode
$server->addClass('TestController');
$server->addClass('ProductsController', '/products'); // adds
this as a base to all the URLs in this class
$server->handle();
Authentication
public function ServiceDelegateAmf(responder:IResponder):void {
	 this.responder = responder;
	 this.service =
ServiceLocator.getInstance().getRemoteObject("zendamf");
	 this.service.setCredentials("wade", "arnold");
}
Create Auth Adapter
class RemoteUser extends Zend_Amf_Auth_Abstract
{
    public function __construct($name, $role)
    {
        $this->_name = $name;
        $this->_role = $role;
    }
    public function authenticate()
    {
        $id = new stdClass();
        $id->role = $this->_role;
        $id->name = $this->_name;
        return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS,
$id);
    }
}
bootstrap

$this->_server = new Zend_Amf_Server();

$this->_acl = new Zend_Acl();
$this->_server->setAuth(new RemoteUser("wade", "testrole"));
$this->_acl->addRole(new Zend_Acl_Role("testrole"));
$this->_acl->allow("testrole", null, null);
$this->_server->setAcl($this->_acl);
Basic Service
class demo {
    function hello() {
        return "hello!";
    }

    function hello2() {
        return "hello2!";
    }

    function initAcl(Zend_Acl $acl) {
        $acl->allow("testrole", null, "hello");
        $acl->allow("testrole2", null, "hello2");
        return true;
    }
}
More Auth & ACL!

• Open ID
• Ldap
• Database
• Conditional rules
• OAuth
What’s Next?
• Better Class Loader, AMF0 complete
• Documentation
 • Adobe Evangalist, Adobe TV, DZone
• HTTP Long Pulling
• Speed
 • cache reflection
 • AMFEXT
Help?


 Issue tracker
   Mailing list
Documentation
twitter.com/wadearnold
      wadearnold.com
wade.arnold@t8webware.com

More Related Content

What's hot

The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
Kacper Gunia
 
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowForget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Kacper Gunia
 
Redis for your boss
Redis for your bossRedis for your boss
Redis for your boss
Elena Kolevska
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Kris Wallsmith
 
Redis for your boss 2.0
Redis for your boss 2.0Redis for your boss 2.0
Redis for your boss 2.0
Elena Kolevska
 
Intro to PHP
Intro to PHPIntro to PHP
Intro to PHP
Sandy Smith
 
Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015
Konstantin Kudryashov
 
Intro to php
Intro to phpIntro to php
Intro to php
Sp Singh
 
Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)
Kris Wallsmith
 
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
 
Min-Maxing Software Costs
Min-Maxing Software CostsMin-Maxing Software Costs
Min-Maxing Software Costs
Konstantin Kudryashov
 
Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!
Kacper Gunia
 
PHPCon 2016: PHP7 by Witek Adamus / XSolve
PHPCon 2016: PHP7 by Witek Adamus / XSolvePHPCon 2016: PHP7 by Witek Adamus / XSolve
PHPCon 2016: PHP7 by Witek Adamus / XSolve
XSolve
 
The IoC Hydra
The IoC HydraThe IoC Hydra
The IoC Hydra
Kacper Gunia
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8PrinceGuru MS
 
You code sucks, let's fix it
You code sucks, let's fix itYou code sucks, let's fix it
You code sucks, let's fix it
Rafael Dohms
 
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
 

What's hot (20)

The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
 
Php security3895
Php security3895Php security3895
Php security3895
 
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowForget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers Cracow
 
Redis for your boss
Redis for your bossRedis for your boss
Redis for your boss
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
 
Redis for your boss 2.0
Redis for your boss 2.0Redis for your boss 2.0
Redis for your boss 2.0
 
Intro to PHP
Intro to PHPIntro to PHP
Intro to PHP
 
Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015
 
Intro to php
Intro to phpIntro to php
Intro to php
 
Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)
 
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
 
Min-Maxing Software Costs
Min-Maxing Software CostsMin-Maxing Software Costs
Min-Maxing Software Costs
 
Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!
 
PHPCon 2016: PHP7 by Witek Adamus / XSolve
PHPCon 2016: PHP7 by Witek Adamus / XSolvePHPCon 2016: PHP7 by Witek Adamus / XSolve
PHPCon 2016: PHP7 by Witek Adamus / XSolve
 
CodeIgniter 3.0
CodeIgniter 3.0CodeIgniter 3.0
CodeIgniter 3.0
 
The IoC Hydra
The IoC HydraThe IoC Hydra
The IoC Hydra
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8
 
You code sucks, let's fix it
You code sucks, let's fix itYou code sucks, let's fix it
You code sucks, let's fix it
 
Lithium Best
Lithium Best Lithium Best
Lithium Best
 
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
 

Similar to Fatc

Zendcon 09
Zendcon 09Zendcon 09
Zendcon 09
Wade Arnold
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
chartjes
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
Hisateru Tanaka
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applicationselliando dias
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
Shinya Ohyanagi
 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...King Foo
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
Joey Kudish
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
Alive Kuo
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
Michelangelo 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 PHPStorm
Michelangelo van Dam
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
Michelangelo van Dam
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
Mikel Torres Ugarte
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
Jonathan Wage
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
Gordon Forsythe
 
Unit testing zend framework apps
Unit testing zend framework appsUnit testing zend framework apps
Unit testing zend framework apps
Michelangelo van Dam
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development
Adam Tomat
 
Dmp hadoop getting_start
Dmp hadoop getting_startDmp hadoop getting_start
Dmp hadoop getting_start
Gim GyungJin
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5
Elena Kolevska
 
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)arcware
 

Similar to Fatc (20)

Zendcon 09
Zendcon 09Zendcon 09
Zendcon 09
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applications
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
 
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
 
Building Custom PHP Extensions
Building Custom PHP ExtensionsBuilding Custom PHP Extensions
Building Custom PHP Extensions
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 
Unit testing zend framework apps
Unit testing zend framework appsUnit testing zend framework apps
Unit testing zend framework apps
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development
 
Dmp hadoop getting_start
Dmp hadoop getting_startDmp hadoop getting_start
Dmp hadoop getting_start
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5
 
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
 

Recently uploaded

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
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
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
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
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
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
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
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
 
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
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
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
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
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...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
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)
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
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...
 
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
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

Fatc

  • 1. @wadearnold wadearnold.com wade.arnold@t8webware.com
  • 2. me? • PHP developer who became a flash’er MX • Wrote majority of Zend Amf & lots of AMFPHP • Flash Builder 4 PHP data services • Currently • Scala: Akka STM • Thrift: PHP • Hadoop: HBase, HDFS, Hive
  • 3. Every solution I've ever seen or developed in PHP feels clunky and bulky, there is no elegance or grace. Working with PHP is a bit like throwing a 10 pound concrete cube from a ten story building: You'll get where you're going fast, but it's not very elegant. ... I love PHP, and it's the right tool for some jobs. It's just an ugly, cumbersome tool that makes me cry and have nightmares. It's the new VB6 in a C dress. Fredrik Holmstrm
  • 4.
  • 5. Digg, Wikipedia, Facebook, Stumble Upon, Flicker, Tagged, Vimeo, iStockPhoto, FeedBurner, TechCrunch,YouTube* Written in PHP Wordpress, Drupal, Joomla Written in PHP
  • 6. Some of the largest sites on the internet -- sites you probably interact with on a daily basis -- are written in PHP. If PHP sucks so profoundly, why is it powering so much of the internet? The only conclusion I can draw is that building a compelling application is far more important than choice of language. While PHP wouldn't be my choice, and if pressed, I might argue that it should never be the choice for any rational human being sitting in front of a computer, I can't argue with the results. Jeff Atwood Coding Horror
  • 7.
  • 8.
  • 9.
  • 10. sudo apt-get install zend-framework
  • 11.
  • 12.
  • 13. Why ZF? • Use-at-will Framework • Coding Standards / Testing Standards • BSD License (Enterprise Friendly) • Well Documented • Large Community • Plenty to integrate!
  • 14. Why us Zend_Amf? • It handles the conversion of data types between ActionScript and PHP • Converts complex objects and supports class mapping • Access Control, Authentication, ORM, Logging, PHP controllers, another SOA endpoint.
  • 15. Zend_Amf works? • It’s a basic RPC model • SOAP, XML-RPC, REST, etc • Call & Response
  • 16. 1 1/2 year’s..... • Zend Amf Beta was released Oct ‘08 • 226 bugs fixed w/ test cases • 8 Features added • 84 outstanding features / bugs • 89% code coverage 100% method • 14 SVN committers • 3 Major refactors
  • 18.
  • 20. Files: lib/ Zend/ Acl.php ACL/ Auth/ Amf/ ....etc.....
  • 21. Files: pub/ css/ img/ js/ swf/ main.swf xml/ crossdomain.xml gateway-config.xml .htaccess index.php
  • 22. Files: pub/.htaccess 1.RewriteEngine on 2.RewriteEngine ^(crossdomain.xml)$ pub/xml/crossdomain.xml 3.RewriteEngine ^(gateway-config.xml)$ pub/xml/gateway- config.xml 4.RewriteEngine ^.(js|ico|gif|jpg|png|xml|swf)$ index.php 5.  6.php_flag magic_quotes_gpc off 7.php_flag register_globals off 8.php_flag display_errors on 9.  10.php_value session.auto_start 0
  • 23. Files: pub/index.php 1.require_once './app/models/HelloWorld.php'; 2./** Bootstrap */ 3.  4.// Instantiate server 5.$server = new Zend_Amf_Server(); 6.$server->setProduction(false); 7.Zend_Session::start(); 8.$server->setSession(); 9.  10.$server->addDirectory(dirname(__FILE__) .'/app/models/'); 11.  12.// Add class to be reflected 13.$server->setClass('HelloWorld'); 14.$server->setClass('contact.ContactDAO'); 15.$server->setClass('contact.events.ContactDispatch'); 16.$server->setClassMap('ContactVo',"Contact"); 17.  18.// Handle request 19.$request = $server->handle(); 20.echo($request);
  • 24. Hybrid site 1.<?php 2.class GatewayController extends Zend_Controller_Action 3.{ 4.   public function indexAction() 5.   { 6.      $this->getHelper('ViewRenderer')->setNoRender();       7.      $server = new Zend_Amf_Server(); 8.      $server->addDirectory( dirname(__FILE__) . '/../ services/' ); 9.      echo($server->handle());   10.   } 11.}
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. Model package com.t8.census.vo <?php { class Person [Bindable] { [RemoteClass(alias="Person")] public $id = 0; public class PersonVO public $age = ""; { public $classofworker = ""; public var id:int = 0; public $education = ""; public var age:int; public $maritalstatus = ""; public var classofworker:String; public $race = ""; public var education:String; public $sex = ""; public var maritalstatus:String; } public var race:String; public var sex:String; } }
  • 31. SQL 1.CREATE TABLE `census` ( 2.  `age` varchar(3) DEFAULT NULL, 3.  `classofworker` varchar(255) DEFAULT NULL, 4.  `education` varchar(255) DEFAULT NULL, 5.  `maritalstatus` varchar(255) DEFAULT NULL, 6.  `race` varchar(255) DEFAULT NULL, 7.  `sex` varchar(255) DEFAULT NULL, 8.  `id` int(11) NOT NULL AUTO_INCREMENT, 9.  PRIMARY KEY (`id`) 10.) ENGINE=InnoDB DEFAULT CHARSET=utf-8
  • 32. Zend_Db_Table_Abstract 1.class Model_DbTable_Census extends Zend_Db_Table_Abstract 2.{ 3.    protected $_rowClass = 'Model_Census'; 4.    protected $_name = 'census'; 5.} 1.class Model_DbTable_Census extends Zend_Db_Table_Abstract 2.{ 3.    protected $_rowClass = 'Model_Census'; 4.    protected $_name = 'census'; 5.}
  • 33. Active Record 1.class CensusService { 2.    public function getAllCensus() { 3.        $tbl = new Model_DbTable_Census(); 4.        return $tbl->fetchAll()->toArray(); 5.    } 6.  7.    public function getCensusByID( $itemID ) {     8.        $tbl = new Model_DbTable_Census(); 9.        return $tbl->find($itemID)->current(); 10.    } 11.  12.    public function createCensus( $item ) { 13.        $tbl = new Model_DbTable_Census(); 14.        $row = $tbl->fetchNew(); 15.        $row->setFromArray((array)$item); 16.        $row->save(); 17.        return $row->id; 18.    } 19.}
  • 34. Object-relational mapping Working with Doctrine, Zend Framework, and Flex Mihai Corlan
  • 35. DB Resource Plugin • Mysqli Result • Mysql Result public function getArrayCollection() { $this -> connect(); $sql = "SELECT * FROM census " . "LIMIT 100"; $result = mysql_query( $sql ) or die( "Query failed: " . mysql_error() ); return $result; }
  • 36. DUDE IT’s PHP 1.  public function getAllItems()  { 2.     $this -> connect(); 3.     $sql = "SELECT * FROM census"; 4.     $result = mysql_query( $sql ) or die( "Query failed: " . 5.       mysql_error() ); 6.   7.     $census = array(); 8.   9.     while( $row = mysql_fetch_assoc( $result ) ) { 10.      $person = new Person(); 11.      $person -> id = $row["id"]; 12.      $person -> age = $row["age"]; 13.      $person -> classofworker = $row["classofworker"]; 14.      $person -> education = $row["education"]; 15.      $person -> maritalstatus = $row["maritalstatus"];   16.      $person -> race = $row["race"]; 17.      $person -> sex = $row["sex"];   18.      19.      array_push( $census, $person ); 20.    } 21.    return $census; 22.  }
  • 37. Simple Rest spl_autoload_register(); // don't load our classes unless we use them $mode = 'debug'; // 'debug' or 'production' $server = new RestServer($mode); // $server->refreshCache(); // uncomment momentarily to clear the cache if classes change in production mode $server->addClass('TestController'); $server->addClass('ProductsController', '/products'); // adds this as a base to all the URLs in this class $server->handle();
  • 38. Authentication public function ServiceDelegateAmf(responder:IResponder):void { this.responder = responder; this.service = ServiceLocator.getInstance().getRemoteObject("zendamf"); this.service.setCredentials("wade", "arnold"); }
  • 39. Create Auth Adapter class RemoteUser extends Zend_Amf_Auth_Abstract { public function __construct($name, $role) { $this->_name = $name; $this->_role = $role; } public function authenticate() { $id = new stdClass(); $id->role = $this->_role; $id->name = $this->_name; return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $id); } }
  • 40. bootstrap $this->_server = new Zend_Amf_Server(); $this->_acl = new Zend_Acl(); $this->_server->setAuth(new RemoteUser("wade", "testrole")); $this->_acl->addRole(new Zend_Acl_Role("testrole")); $this->_acl->allow("testrole", null, null); $this->_server->setAcl($this->_acl);
  • 41. Basic Service class demo { function hello() { return "hello!"; } function hello2() { return "hello2!"; } function initAcl(Zend_Acl $acl) { $acl->allow("testrole", null, "hello"); $acl->allow("testrole2", null, "hello2"); return true; } }
  • 42. More Auth & ACL! • Open ID • Ldap • Database • Conditional rules • OAuth
  • 43. What’s Next? • Better Class Loader, AMF0 complete • Documentation • Adobe Evangalist, Adobe TV, DZone • HTTP Long Pulling • Speed • cache reflection • AMFEXT
  • 44. Help? Issue tracker Mailing list Documentation
  • 45. twitter.com/wadearnold wadearnold.com wade.arnold@t8webware.com

Editor's Notes