first draft with phploc support