Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
php://memory    redux
say what    2001:558:1004:9:69:252:76:96
say what    2001:558:1004:9:69:252:76:96              + DNS..
say what    2001:558:1004:9:69:252:76:96       + Domain Name System           = ipv6.comcast.com
who am iNeal Anders     Senior Software Engineer at Infoblox     http://github.com/nanderoo     http://neal-anders.com    ...
before it was coolInfoblox is working on some cool stuff...- DNS, DHCP, IPAM, NCCM- IPv6 Center of Excellence- IF-Map / DN...
who r u      Designers? Developers?      Dev-Ops?       Sys-Admin?      Managers? Recruiters?          Looking?    Hiring?
follow along https://github.com/nanderoo/php-memory-redux.git
overviewLet us cover 3 things:1) Streams and filters overview2) php://memory & php://temp3) Demo - word/letter frequency
overviewWhat are streams:- Streams are resources, a variety of protocolsand wrappers: file, http, ftp, zlib, data, glob,ph...
overviewWhat are filters:- Code that performs actions in-situ- As a stream is being written to or read from- Can be stacke...
overviewOut of the box filters:- Strings (upper, lower, strip tags, rot13)- Conversion (base64 encode / decode)- Compressi...
overviewMore:- You make your own with php_user_filter()and stream_filter_register()- Predefined constants: STREAM_* andPSF...
memory & temp        php://memory            and         php://temp
memory & tempWhat are they?- Wrappers to streams, resources.- Others: stdin, stdout, stderr- Support stat() for low-level ...
memory & tempphp://memory examples:  example-01.php = basic functionality  example-02.php = reading in text  example-03.ph...
memory & tempphp://temp examples:example-05.php = temp w/ memory limitexample-06.php = temp
but why- Easy to read and write to- Already baked in- They said no to permissions- Performance / balance resources
bonus demoFrequency Analysis:- What is etaon rishd (and variants)- Take a stream of data- Capture letter frequency
almost fin    Questions? Comments? Musings?       neal.anders@yahoo.com
oh yeahSemaphores, Shared Memory, and IPC?Expect, SNMP, Sockets, StatsD, or Graphite?SurgeCon, MDC3, BSidesDC?/dev/hell & ...
Upcoming SlideShare
Loading in …5
×

Php memory-redux

3,234 views

Published on

This is a follow-up to my PHP://memory and streams for scaling talk I gave at PHP|Tek12 in Chicago. Presented to the local Baltimore PHP User Group on 2012-06-20

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Php memory-redux

  1. 1. php://memory redux
  2. 2. say what 2001:558:1004:9:69:252:76:96
  3. 3. say what 2001:558:1004:9:69:252:76:96 + DNS..
  4. 4. say what 2001:558:1004:9:69:252:76:96 + Domain Name System = ipv6.comcast.com
  5. 5. who am iNeal Anders Senior Software Engineer at Infoblox http://github.com/nanderoo http://neal-anders.com @nanderoo
  6. 6. before it was coolInfoblox is working on some cool stuff...- DNS, DHCP, IPAM, NCCM- IPv6 Center of Excellence- IF-Map / DNSSec- Hiring (sales, services, support, engineering)
  7. 7. who r u Designers? Developers? Dev-Ops? Sys-Admin? Managers? Recruiters? Looking? Hiring?
  8. 8. follow along https://github.com/nanderoo/php-memory-redux.git
  9. 9. overviewLet us cover 3 things:1) Streams and filters overview2) php://memory & php://temp3) Demo - word/letter frequency
  10. 10. overviewWhat are streams:- Streams are resources, a variety of protocolsand wrappers: file, http, ftp, zlib, data, glob,phar, ssh2, expect...- Lets you interact at a lower level, sockets,buffers, 3rd party libs, with other devices andsystems.
  11. 11. overviewWhat are filters:- Code that performs actions in-situ- As a stream is being written to or read from- Can be stacked / combined- Great for cutting data cruft
  12. 12. overviewOut of the box filters:- Strings (upper, lower, strip tags, rot13)- Conversion (base64 encode / decode)- Compression (gzip, bz2)- Encryption (mcrypt)
  13. 13. overviewMore:- You make your own with php_user_filter()and stream_filter_register()- Predefined constants: STREAM_* andPSFS_*- Hedge on stuff breaking that isnt your fault
  14. 14. memory & temp php://memory and php://temp
  15. 15. memory & tempWhat are they?- Wrappers to streams, resources.- Others: stdin, stdout, stderr- Support stat() for low-level insight
  16. 16. memory & tempphp://memory examples: example-01.php = basic functionality example-02.php = reading in text example-03.php = out of memory example-04.php = stream copy workaround
  17. 17. memory & tempphp://temp examples:example-05.php = temp w/ memory limitexample-06.php = temp
  18. 18. but why- Easy to read and write to- Already baked in- They said no to permissions- Performance / balance resources
  19. 19. bonus demoFrequency Analysis:- What is etaon rishd (and variants)- Take a stream of data- Capture letter frequency
  20. 20. almost fin Questions? Comments? Musings? neal.anders@yahoo.com
  21. 21. oh yeahSemaphores, Shared Memory, and IPC?Expect, SNMP, Sockets, StatsD, or Graphite?SurgeCon, MDC3, BSidesDC?/dev/hell & Voices of the ElePHPant

×