php common class & functions