refactor php directives