[ticket/12273] Move $extension to constructor so the path is always set

PHPBB3-12273