Made registry code native for PHP.