'Import the namespace.'

def addNamespaceImport(self, namespace, alias):

    namelist = namespace.split('\\')
    namespace_path = '\\'.join(namelist[:(-1)])
    if (namespace.startswith('\\') and (not namespace_path.startswith('\\'))):
        namespace_path = ('\\%s' % (namespace_path,))
    symbol = namelist[(-1)]
    toScope = (self.currentNamespace or self.fileinfo)
    toScope.includes.append(PHPImport(namespace_path, self.lineno, alias=alias, symbol=symbol))
    log.debug('IMPORT    NAMESPACE:    %s\\%s    as    %r    on    line    %d', namespace_path, symbol, alias, self.lineno)
