Move PHP from rules to module