コード例 #1
0
    def search_ext_version(self, found_extensions, threads):
        """
            This method adds a job for every installed extension.
            The goal is to find a file with version information.
        """
        thread_pool = ThreadPool()
        for extension,values in found_extensions.items():
            thread_pool.add_job((request.version_information, (values['url'] + 'Documentation/ChangeLog/Index.rst', None)))
            thread_pool.add_job((request.version_information, (values['url'] + 'Documentation/Changelog/Index.rst', None)))
            thread_pool.add_job((request.version_information, (values['url'] + 'Documentation/Settings.cfg', None)))
            thread_pool.add_job((request.version_information, (values['url'] + 'Documentation/Settings.yml', '(?:release:)\s?([0-9]+\.[0-9]+\.?[0-9]?[0-9]?)')))
            thread_pool.add_job((request.version_information, (values['url'] + 'Settings.yml', '(?:release:)\s?([0-9]+\.[0-9]+\.?[0-9]?[0-9]?)')))
            thread_pool.add_job((request.version_information, (values['url'] + 'Documentation/ChangeLog', None)))
            thread_pool.add_job((request.version_information, (values['url'] + 'Documentation/Index.rst', None)))
            thread_pool.add_job((request.version_information, (values['url'] + 'composer.json', '(?:"dev-master":|"version":)\s?"([0-9]+\.[0-9]+\.?[0-9x]?[0-9x]?)')))
            thread_pool.add_job((request.version_information, (values['url'] + 'Index.rst', None)))
            thread_pool.add_job((request.version_information, (values['url'] + 'doc/manual.sxw', None)))
            thread_pool.add_job((request.version_information, (values['url'] + 'ChangeLog', None)))
            thread_pool.add_job((request.version_information, (values['url'] + 'CHANGELOG.md', None)))
            thread_pool.add_job((request.version_information, (values['url'] + 'ChangeLog.txt', None)))
        
        thread_pool.start(threads, version_search=True)

        for version_path in thread_pool.get_result():
            path = version_path[0][0]
            version = version_path[1]
            name = version_path[0][0]
            if 'Documentation/' in name:
                name = name[:name.rfind('Documentation/')+1]
            if 'doc/' in name:
                name = name[:name.rfind('doc/')+1] 
            name = name[name.find('ext/')+4:name.rfind('/')]
            found_extensions[name]['version'] = version
            found_extensions[name]['file'] = path
        return found_extensions
コード例 #2
0
    def search_extension(self, domain, extensions, threads):
        """
            This method loads the extensions from the database and searches for installed extensions.
                /typo3conf/ext/:        Local installation path. This is where extensions usually get installed.
                /typo3/ext/:            Global installation path (not used atm)
                /typo3/sysext/:         Extensions shipped with core
        """
        found_extensions = {}
        thread_pool = ThreadPool()
        for ext in extensions:
            thread_pool.add_job((request.head_request,
                                 ('{}/typo3conf/ext/{}/'.format(domain, ext))))
            thread_pool.add_job((request.head_request,
                                 ('{}/typo3/sysext/{}/'.format(domain, ext))))
            #thread_pool.add_job((request.head_request, ('{}/typo3/ext/{}/'.format(domain, ext))))
        thread_pool.start(threads)

        for installed_extension in thread_pool.get_result():
            name = installed_extension[1][:-1]
            name = name[name.rfind('/') + 1:]
            found_extensions[name] = {
                'url': installed_extension[1],
                'version': None,
                'file': None
            }
        return found_extensions
コード例 #3
0
    def search_ext_version(self, domain, extension_dict):
        """
			This method adds a job for every installed extension.
			The goal is to find a ChangeLog or Readme in order to determine the version.
		"""
        config = json.load(open('lib/config.json'))
        thread_pool = ThreadPool()
        for extension_path in extension_dict:
            thread_pool.add_job(
                (Request.head_request, (domain.get_name(),
                                        extension_path + '/ChangeLog')))
            thread_pool.add_job(
                (Request.head_request, (domain.get_name(),
                                        extension_path + '/ChangeLog.txt')))
            thread_pool.add_job(
                (Request.head_request, (domain.get_name(),
                                        extension_path + '/Readme.txt')))
            thread_pool.add_job(
                (Request.head_request, (domain.get_name(),
                                        extension_path + '/README.md')))
            thread_pool.add_job(
                (Request.head_request, (domain.get_name(),
                                        extension_path + '/README.rst')))

        thread_pool.start(config['threads'], True)

        for changelog_path in thread_pool.get_result():
            ext, path = self.parse_extension(changelog_path)
            domain.set_installed_extensions_version(path, ext[4])
コード例 #4
0
ファイル: extensions.py プロジェクト: whoot/Typo-Enumerator
	def search_extension(self, domain, extensions):
		"""
			This method searches for installed extensions.
				/typo3conf/ext/:		Local installation path. This is where extensions get usually installed.
				/typo3/ext/:			Global installation path (not used atm)
				/typo3/sysext/:			Extensions shipped with core (not used atm)
		"""
		config = json.load(open(os.path.join(self.__path, 'lib', 'config.json')))
		thread_pool = ThreadPool()
		for ext in extensions:
			thread_pool.add_job((Request.head_request, (domain.get_name(), '/typo3conf/ext/' + ext)))
			#thread_pool.add_job((Request.head_request, (domain.get_name(), '/typo3/ext/' + ext)))
			#thread_pool.add_job((Request.head_request, (domain.get_name(), '/typo3/sysext/' + ext)))
		thread_pool.start(config['threads'])

		for installed_extension in thread_pool.get_result():
			domain.set_installed_extensions(installed_extension[1][1])
コード例 #5
0
ファイル: extensions.py プロジェクト: whoot/Typo-Enumerator
	def search_ext_version(self, domain, extension_dict):
		"""
			This method adds a job for every installed extension.
			The goal is to find a ChangeLog or Readme in order to determine the version.
		"""
		config = json.load(open('lib/config.json'))
		thread_pool = ThreadPool()
		for extension_path in extension_dict:
			thread_pool.add_job((Request.head_request, (domain.get_name(), extension_path + '/ChangeLog')))
			thread_pool.add_job((Request.head_request, (domain.get_name(), extension_path + '/ChangeLog.txt')))
			thread_pool.add_job((Request.head_request, (domain.get_name(), extension_path + '/Readme.txt')))
			thread_pool.add_job((Request.head_request, (domain.get_name(), extension_path + '/README.md')))
			thread_pool.add_job((Request.head_request, (domain.get_name(), extension_path + '/README.rst')))
		
		thread_pool.start(config['threads'], True)

		for changelog_path in thread_pool.get_result():
			ext, path = self.parse_extension(changelog_path)
			domain.set_installed_extensions_version(path, ext[4])
コード例 #6
0
    def search_extension(self, domain, extensions):
        """
			This method searches for installed extensions.
				/typo3conf/ext/:		Local installation path. This is where extensions get usually installed.
				/typo3/ext/:			Global installation path (not used atm)
				/typo3/sysext/:			Extensions shipped with core (not used atm)
		"""
        config = json.load(
            open(os.path.join(self.__path, 'lib', 'config.json')))
        thread_pool = ThreadPool()
        for ext in extensions:
            thread_pool.add_job((Request.head_request,
                                 (domain.get_name(), '/typo3conf/ext/' + ext)))
            #thread_pool.add_job((Request.head_request, (domain.get_name(), '/typo3/ext/' + ext)))
            #thread_pool.add_job((Request.head_request, (domain.get_name(), '/typo3/sysext/' + ext)))
        thread_pool.start(config['threads'])

        for installed_extension in thread_pool.get_result():
            domain.set_installed_extensions(installed_extension[1][1])