Catch .info file syntax error

mattyoung - February 11, 2009 - 17:31
Project:Coder
Version:6.x-1.0
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I just found out when .info has syntax error, the core module system can still install the problem module and show no error. However, this cause problem with "Update status". For example, I made a mistake like this in my .info:

name = My Module Name
description = this string do not parse "because it has quote" in the middle

Eventhough the second line is bad, somehow module can still install. But when this .info file is checked in to contributes repo, new release version get out-of-date warning in Update status, and recommend using the previous version. I believe the problem is error in parsing the second line so the rest of the .info lines gets ignore and there is no datastamp to compare.

So it would be nice if Coder can test .info for syntax error as part of code review by running parse_ini_file() on .info file and check for 'false' return.

#1

mattyoung - February 11, 2009 - 18:51

Nevermind the bit about using parse_ini_file(). I found out the info files are parsed with this:

drupal_parse_info_file()

 
 

Drupal is a registered trademark of Dries Buytaert.