SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
SERVER SIDE BREAKOUT
                             php




Wednesday, November 2, 11
5 YEARS AGO (2006)


                                 PHP version 5.2.0
                                native JSON support




Wednesday, November 2, 11
MODERN USAGE



                               77% of all websites




Wednesday, November 2, 11
MODERN USAGE



                                Middleware




Wednesday, November 2, 11
INTERFACES


                                 REST
                               Ext.Direct




Wednesday, November 2, 11
REST

                                 Great for APIs
                                 Cross-domain
                             Status code messages
                            One setup for all purposes

                                   echo $json




Wednesday, November 2, 11
REST



                            proxy: {
                                       type: 'rest',
                                       url: 'api/users'
                                   }




Wednesday, November 2, 11
REST


                            Extra server setup may be needed
                             Difficult concurrency (buffering)
                              Requires access to php://input




Wednesday, November 2, 11
EXT.DIRECT

                                         OOB buffering
                                         Effortless setup
                                      API integration (RPC)
                            Easier RPC role-based method distribution

                                          return $array




Wednesday, November 2, 11
EXT.DIRECT

                            Ext.ns("Ext.app");
                            Ext.app.REMOTING_API = {
                               "url":"php/router.php",
                               "type":"remoting",
                               "actions":{
                                  "TestAction":[
                                    {"name":"doEcho","len":1}
                                  ]
                                }
                            };




Wednesday, November 2, 11
EXT.DIRECT


                            proxy: {
                                       type: 'direct',
                                       directFn: doEcho
                                   }




Wednesday, November 2, 11
EXT.DIRECT

                            proxy: {
                                       type: 'direct',
                                        api: {
                                            create : Rpc.users.Add,
                                            read   : Rpc.users.List,
                                            update : Rpc.users.Update,
                                            delete : Rpc.users.Delete
                                   }




Wednesday, November 2, 11
EXT.DIRECT


                            Not cross-domain friendly
                            Needs a router (s-s stack)
                                No file uploading
                            Exception stops execution




Wednesday, November 2, 11
SAMPLE USAGE
                            RESTFUL INTERFACE




Wednesday, November 2, 11
EXT.DIRECT




Wednesday, November 2, 11
JSON VS. JSONP


            {                                 Ext.util.JSONP.callback1({
                ‘name’ : ‘John’,                   ‘name’ : ‘John’,
                ‘email’ : ‘john@smith.com',        ‘email’ : ‘john@smith.com',
                ‘dob‘ : 19781213,                  ‘dob‘ : 19781213,
                ‘kids‘ : [‘Sarah’, ‘Norah’]        ‘kids‘ : [‘Sarah’, ‘Norah’]
            }                                 })




Wednesday, November 2, 11
JSON VS. JSONP

                            $callback = $_REQUEST[“callback”];

                            $select = $db->select()->from('products');
                            $stmt = $select->query();
                            $result = $stmt->fetchAll();
                            $output = json_encode($result);

                            if ($callback) {
                              header('Content-Type: text/javascript');
                              echo $callback . '(' . $output . ');';
                            } else {
                              header('Content-Type: application/x-json');
                              echo $output;
                            }




Wednesday, November 2, 11
BIG APPS



                              Big apps




Wednesday, November 2, 11
BIG APPS


                                      MVC
                            Fat model - thin controller




Wednesday, November 2, 11
BIG APPS



                             Abstracting




Wednesday, November 2, 11
LOADING APP COMPONENTS


                                       Ext.Loader
                            Sencha command / jsbuilder on the fly




Wednesday, November 2, 11
ENVIRONMENT



                                Apache




Wednesday, November 2, 11
ENVIRONMENT


                                    Apache
                                       +
                              Nginx reverse proxy




Wednesday, November 2, 11
ENVIRONMENT


                            SetEnv APP_ENV "development"

                               $_SERVER['APP_ENV'])




Wednesday, November 2, 11
ENVIRONMENT


                                     MIME handling

                            JSONP : application/javascript
                            JSON     : application/json
                            appcache : text/cache-manifest




Wednesday, November 2, 11
ENVIRONMENT



                               File structure




Wednesday, November 2, 11
Wednesday, November 2, 11
ENVIRONMENT



                               DB layout




Wednesday, November 2, 11
TRADITIONAL RELATIONAL
                    MODEL




Wednesday, November 2, 11
CENTRALIZED RELATIONAL
                    MODEL




Wednesday, November 2, 11
Wednesday, November 2, 11
FIREPHP


                            $logger = new Zend_Log();
                            $writer = new Zend_Log_Writer_Firebug();
                            $logger->addWriter($writer);
                            Zend_Registry::set('logger',$logger);




Wednesday, November 2, 11
FIREPHP

             $select = $ssoDb->select() ->from('products');

             $logger->log($select->__toString(), Zend_Log::INFO);
             $logger->log($data, Zend_Log::INFO);




Wednesday, November 2, 11
BAD IDEAS

                          Enclose entire class in a single try/catch block
                        Use sleep to wait for another task/thread to finish
                           Setting global vars to return multiple values
                                     Altering framework files
                          Performing DB aggregate operations in PHP
                                    Keeping connections open




Wednesday, November 2, 11
BAD IDEAS

                        Using self-made cyphers for encryption
              Clear text passwords, CC info, personal details (inc names)
                 Not checking for user credentials on every request
                          Trusting client-side input validation
                   Constructing sql queries by using concatenation
                    Not using DB transactions on multiple changes
                          Direct access to files for download



Wednesday, November 2, 11
Grgur Grisogono
                                @ggrgur




Wednesday, November 2, 11

Mais conteúdo relacionado

Mais procurados

Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn WorkshopBastian Feder
 
Linux shell env
Linux shell envLinux shell env
Linux shell envRahul Pola
 
Fluentd v0.12 master guide
Fluentd v0.12 master guideFluentd v0.12 master guide
Fluentd v0.12 master guideN Masahiro
 
Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)N Masahiro
 
system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarGauravRaikar3
 
2019 11-bgphp
2019 11-bgphp2019 11-bgphp
2019 11-bgphpdantleech
 
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012Treasure Data, Inc.
 
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...Puppet
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with AugeasPuppet
 
Launching containers with fleet
Launching containers with fleetLaunching containers with fleet
Launching containers with fleet충섭 김
 
Containers: What are they, Really?
Containers: What are they, Really?Containers: What are they, Really?
Containers: What are they, Really?Sneha Inguva
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupGreg DeKoenigsberg
 

Mais procurados (20)

Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn Workshop
 
Linux shell env
Linux shell envLinux shell env
Linux shell env
 
Fluentd v0.12 master guide
Fluentd v0.12 master guideFluentd v0.12 master guide
Fluentd v0.12 master guide
 
Linux Containers (LXC)
Linux Containers (LXC)Linux Containers (LXC)
Linux Containers (LXC)
 
Shell programming
Shell programmingShell programming
Shell programming
 
Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)Fluentd meetup dive into fluent plugin (outdated)
Fluentd meetup dive into fluent plugin (outdated)
 
system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikar
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
2019 11-bgphp
2019 11-bgphp2019 11-bgphp
2019 11-bgphp
 
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
 
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
 
CoreOS Overview
CoreOS OverviewCoreOS Overview
CoreOS Overview
 
Shell Script Tutorial
Shell Script TutorialShell Script Tutorial
Shell Script Tutorial
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
17.my sql triggers in laravel
17.my sql triggers in laravel17.my sql triggers in laravel
17.my sql triggers in laravel
 
Launching containers with fleet
Launching containers with fleetLaunching containers with fleet
Launching containers with fleet
 
Containers: What are they, Really?
Containers: What are they, Really?Containers: What are they, Really?
Containers: What are they, Really?
 
Shellscripting
ShellscriptingShellscripting
Shellscripting
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetup
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
 

Semelhante a PHP Server-side Breakout

MVC In Depth, part 2, Tommy Maintz
MVC In Depth, part 2, Tommy MaintzMVC In Depth, part 2, Tommy Maintz
MVC In Depth, part 2, Tommy MaintzSencha
 
Active Record Introduction - 3
Active Record Introduction - 3Active Record Introduction - 3
Active Record Introduction - 3Blazing Cloud
 
TorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyTorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyBruno Oliveira
 
MVC In Depth, part 1
MVC In Depth, part 1MVC In Depth, part 1
MVC In Depth, part 1Sencha
 
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e RubyTorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e RubyBruno Oliveira
 
Building Sencha Themes
Building Sencha ThemesBuilding Sencha Themes
Building Sencha ThemesSencha
 
NoSQL CGN: CouchDB (11/2011)
NoSQL CGN: CouchDB (11/2011)NoSQL CGN: CouchDB (11/2011)
NoSQL CGN: CouchDB (11/2011)Sebastian Cohnen
 
Owasp top 10
Owasp top 10Owasp top 10
Owasp top 10markstory
 
Hardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls
Hardware Acceleration on Mobile, Ariya Hidayat & Jarred NichollsHardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls
Hardware Acceleration on Mobile, Ariya Hidayat & Jarred NichollsSencha
 
Devon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDevon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDaum DNA
 
How To Build A Web Service
How To Build A Web ServiceHow To Build A Web Service
How To Build A Web ServiceMoses Ngone
 
fastcgi_conf and mime_types
fastcgi_conf and mime_typesfastcgi_conf and mime_types
fastcgi_conf and mime_typesNaoya Nakazawa
 
Ext JS 4: Advanced Expert Techniques
Ext JS 4: Advanced Expert TechniquesExt JS 4: Advanced Expert Techniques
Ext JS 4: Advanced Expert TechniquesSencha
 
Community Code: The SenchaCon App
Community Code: The SenchaCon AppCommunity Code: The SenchaCon App
Community Code: The SenchaCon AppSencha
 
Your first rails app - 2
 Your first rails app - 2 Your first rails app - 2
Your first rails app - 2Blazing Cloud
 
nginxをソースからインストールしてみたよ
nginxをソースからインストールしてみたよnginxをソースからインストールしてみたよ
nginxをソースからインストールしてみたよmamoru tateoka
 

Semelhante a PHP Server-side Breakout (18)

MVC In Depth, part 2, Tommy Maintz
MVC In Depth, part 2, Tommy MaintzMVC In Depth, part 2, Tommy Maintz
MVC In Depth, part 2, Tommy Maintz
 
Active Record Introduction - 3
Active Record Introduction - 3Active Record Introduction - 3
Active Record Introduction - 3
 
TorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyTorqueBox - When Java meets Ruby
TorqueBox - When Java meets Ruby
 
MVC In Depth, part 1
MVC In Depth, part 1MVC In Depth, part 1
MVC In Depth, part 1
 
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e RubyTorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
 
Building Sencha Themes
Building Sencha ThemesBuilding Sencha Themes
Building Sencha Themes
 
NoSQL CGN: CouchDB (11/2011)
NoSQL CGN: CouchDB (11/2011)NoSQL CGN: CouchDB (11/2011)
NoSQL CGN: CouchDB (11/2011)
 
Owasp top 10
Owasp top 10Owasp top 10
Owasp top 10
 
Hardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls
Hardware Acceleration on Mobile, Ariya Hidayat & Jarred NichollsHardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls
Hardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls
 
Devon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDevon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascript
 
JRuby and You
JRuby and YouJRuby and You
JRuby and You
 
How To Build A Web Service
How To Build A Web ServiceHow To Build A Web Service
How To Build A Web Service
 
fastcgi_conf and mime_types
fastcgi_conf and mime_typesfastcgi_conf and mime_types
fastcgi_conf and mime_types
 
Ext JS 4: Advanced Expert Techniques
Ext JS 4: Advanced Expert TechniquesExt JS 4: Advanced Expert Techniques
Ext JS 4: Advanced Expert Techniques
 
Community Code: The SenchaCon App
Community Code: The SenchaCon AppCommunity Code: The SenchaCon App
Community Code: The SenchaCon App
 
Einführung in Node.js
Einführung in Node.jsEinführung in Node.js
Einführung in Node.js
 
Your first rails app - 2
 Your first rails app - 2 Your first rails app - 2
Your first rails app - 2
 
nginxをソースからインストールしてみたよ
nginxをソースからインストールしてみたよnginxをソースからインストールしてみたよ
nginxをソースからインストールしてみたよ
 

Mais de Sencha

Breathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsBreathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsSencha
 
Ext JS 6.6 Highlights
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 HighlightsSencha
 
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha
 
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha
 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha
 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha
 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridSencha
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportSencha
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsSencha
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSencha
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...Sencha
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...Sencha
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSencha
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsSencha
 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...Sencha
 

Mais de Sencha (20)

Breathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsBreathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web Components
 
Ext JS 6.6 Highlights
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 Highlights
 
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha Test
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop First
 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell Simeons
 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingThe Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingSelcen Ozturkcan
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingThe Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

PHP Server-side Breakout

  • 1. SERVER SIDE BREAKOUT php Wednesday, November 2, 11
  • 2. 5 YEARS AGO (2006) PHP version 5.2.0 native JSON support Wednesday, November 2, 11
  • 3. MODERN USAGE 77% of all websites Wednesday, November 2, 11
  • 4. MODERN USAGE Middleware Wednesday, November 2, 11
  • 5. INTERFACES REST Ext.Direct Wednesday, November 2, 11
  • 6. REST Great for APIs Cross-domain Status code messages One setup for all purposes echo $json Wednesday, November 2, 11
  • 7. REST proxy: { type: 'rest', url: 'api/users' } Wednesday, November 2, 11
  • 8. REST Extra server setup may be needed Difficult concurrency (buffering) Requires access to php://input Wednesday, November 2, 11
  • 9. EXT.DIRECT OOB buffering Effortless setup API integration (RPC) Easier RPC role-based method distribution return $array Wednesday, November 2, 11
  • 10. EXT.DIRECT Ext.ns("Ext.app"); Ext.app.REMOTING_API = { "url":"php/router.php", "type":"remoting", "actions":{ "TestAction":[ {"name":"doEcho","len":1} ] } }; Wednesday, November 2, 11
  • 11. EXT.DIRECT proxy: { type: 'direct', directFn: doEcho } Wednesday, November 2, 11
  • 12. EXT.DIRECT proxy: { type: 'direct', api: { create : Rpc.users.Add, read : Rpc.users.List, update : Rpc.users.Update, delete : Rpc.users.Delete } Wednesday, November 2, 11
  • 13. EXT.DIRECT Not cross-domain friendly Needs a router (s-s stack) No file uploading Exception stops execution Wednesday, November 2, 11
  • 14. SAMPLE USAGE RESTFUL INTERFACE Wednesday, November 2, 11
  • 16. JSON VS. JSONP { Ext.util.JSONP.callback1({ ‘name’ : ‘John’, ‘name’ : ‘John’, ‘email’ : ‘john@smith.com', ‘email’ : ‘john@smith.com', ‘dob‘ : 19781213, ‘dob‘ : 19781213, ‘kids‘ : [‘Sarah’, ‘Norah’] ‘kids‘ : [‘Sarah’, ‘Norah’] } }) Wednesday, November 2, 11
  • 17. JSON VS. JSONP $callback = $_REQUEST[“callback”]; $select = $db->select()->from('products'); $stmt = $select->query(); $result = $stmt->fetchAll(); $output = json_encode($result); if ($callback) { header('Content-Type: text/javascript'); echo $callback . '(' . $output . ');'; } else { header('Content-Type: application/x-json'); echo $output; } Wednesday, November 2, 11
  • 18. BIG APPS Big apps Wednesday, November 2, 11
  • 19. BIG APPS MVC Fat model - thin controller Wednesday, November 2, 11
  • 20. BIG APPS Abstracting Wednesday, November 2, 11
  • 21. LOADING APP COMPONENTS Ext.Loader Sencha command / jsbuilder on the fly Wednesday, November 2, 11
  • 22. ENVIRONMENT Apache Wednesday, November 2, 11
  • 23. ENVIRONMENT Apache + Nginx reverse proxy Wednesday, November 2, 11
  • 24. ENVIRONMENT SetEnv APP_ENV "development" $_SERVER['APP_ENV']) Wednesday, November 2, 11
  • 25. ENVIRONMENT MIME handling JSONP : application/javascript JSON : application/json appcache : text/cache-manifest Wednesday, November 2, 11
  • 26. ENVIRONMENT File structure Wednesday, November 2, 11
  • 28. ENVIRONMENT DB layout Wednesday, November 2, 11
  • 29. TRADITIONAL RELATIONAL MODEL Wednesday, November 2, 11
  • 30. CENTRALIZED RELATIONAL MODEL Wednesday, November 2, 11
  • 32. FIREPHP $logger = new Zend_Log(); $writer = new Zend_Log_Writer_Firebug(); $logger->addWriter($writer); Zend_Registry::set('logger',$logger); Wednesday, November 2, 11
  • 33. FIREPHP $select = $ssoDb->select() ->from('products'); $logger->log($select->__toString(), Zend_Log::INFO); $logger->log($data, Zend_Log::INFO); Wednesday, November 2, 11
  • 34. BAD IDEAS Enclose entire class in a single try/catch block Use sleep to wait for another task/thread to finish Setting global vars to return multiple values Altering framework files Performing DB aggregate operations in PHP Keeping connections open Wednesday, November 2, 11
  • 35. BAD IDEAS Using self-made cyphers for encryption Clear text passwords, CC info, personal details (inc names) Not checking for user credentials on every request Trusting client-side input validation Constructing sql queries by using concatenation Not using DB transactions on multiple changes Direct access to files for download Wednesday, November 2, 11
  • 36. Grgur Grisogono @ggrgur Wednesday, November 2, 11