PHP 5.5+ resource abstraction layer