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
4. say what
2001:558:1004:9:69:252:76:96
+ Domain Name System
= ipv6.comcast.com
5. who am i
Neal Anders
Senior Software Engineer at Infoblox
http://github.com/nanderoo
http://neal-anders.com
@nanderoo
6. before it was cool
Infoblox is working on some cool stuff...
- DNS, DHCP, IPAM, NCCM
- IPv6 Center of Excellence
- IF-Map / DNSSec
- Hiring (sales, services, support, engineering)
7. who r u
Designers? Developers?
Dev-Ops? Sys-Admin?
Managers? Recruiters?
Looking? Hiring?
9. overview
Let us cover 3 things:
1) Streams and filters overview
2) php://memory & php://temp
3) Demo - word/letter frequency
10. overview
What are streams:
- Streams are resources, a variety of protocols
and 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 and
systems.
11. overview
What 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. overview
Out of the box filters:
- Strings (upper, lower, strip tags, rot13)
- Conversion (base64 encode / decode)
- Compression (gzip, bz2)
- Encryption (mcrypt)
13. overview
More:
- You make your own with php_user_filter()
and stream_filter_register()
- Predefined constants: STREAM_* and
PSFS_*
- Hedge on stuff breaking that isn't your fault