Rebuild in PHP of the functions of Fit Library as described in the Fit Book