@@ -30,13 +30,13 @@ public function set(array $paths)
3030 /**
3131 * {@inheritdoc}
3232 */
33- public function rewrite ($ version , $ timestamp )
33+ public function rewrite ($ version , $ timestamp, $ core = null , $ project = null )
3434 {
3535 foreach ($ this ->paths as $ info_file ) {
3636 // Don't write to files that already contain version information.
3737 if (!$ this ->hasVersionInfo ($ info_file )) {
3838 $ file = fopen ($ info_file , 'a+ ' );
39- fwrite ($ file , $ this ->formatInfo ($ version , $ timestamp ));
39+ fwrite ($ file , $ this ->formatInfo ($ version , $ timestamp, $ core , $ project ));
4040 fclose ($ file );
4141 }
4242 }
@@ -58,14 +58,20 @@ public function rollback()
5858 /**
5959 * Format version and timestamp into YAML.
6060 */
61- protected function formatInfo ($ version , $ timestamp )
61+ protected function formatInfo ($ version , $ timestamp, $ core = null , $ project = null )
6262 {
6363 $ date = gmdate ('c ' , $ timestamp );
6464 $ info = array ();
6565 // Always start with EOL character.
6666 $ info [] = '' ;
6767 $ info [] = "# Information added by drupal-composer/info-rewrite on $ date. " ;
6868 $ info [] = "version: ' $ version' " ;
69+ if ($ core ) {
70+ $ info [] = "core: ' $ core' " ;
71+ }
72+ if ($ project ) {
73+ $ info [] = "project: ' $ project' " ;
74+ }
6975 $ info [] = "datestamp: $ timestamp " ;
7076 // Always end with EOL character.
7177 $ info [] = '' ;
0 commit comments