phar and dup middleware