#NEWLINE# def to_php( self , filename , composer_location = None ) : #NEWLINE# #INDENT# if ( composer_location is None ) : #NEWLINE# #INDENT# bootstrap_path = "__DIR__.'/src/bootstrap.php'" #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# bootstrap_path = ( "'%s'" % op . join ( composer_location , 'src' , 'bootstrap.php' ) ) #NEWLINE# #UNINDENT# template = tempita . Template ( self . template_string ) #NEWLINE# remote_packages = self . remote_repository . list_packages ( ) #NEWLINE# installed_packages = self . installed_repository . list_packages ( ) #NEWLINE# variables = { #NEWLINE# #INDENT# 'bootstrap_path' : bootstrap_path , #NEWLINE# 'remote_repo_json_string' : packages_list_to_php_json ( remote_packages ) , #NEWLINE# 'installed_repo_json_string' : packages_list_to_php_json ( installed_packages ) , #NEWLINE# 'request' : [ ( job . job_type , job . requirement . name , job_to_php_constraints ( job ) ) for job in self . request . jobs ] , #NEWLINE# 'common_imports' : COMMON_IMPORTS , #NEWLINE# #UNINDENT# } #NEWLINE# with open ( filename , 'wt' ) as fp : #NEWLINE# #INDENT# fp . write ( template . substitute ( variables ) )