Added recursive flag to chmod()
Fixed phpdocs