Creating BaseDocument to not dublicate code
Printing result from phpcdp to stdout as well