Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DX] Add a project_get_info helper function. #2385

Open
klonos opened this issue Dec 7, 2016 · 0 comments
Open

[DX] Add a project_get_info helper function. #2385

klonos opened this issue Dec 7, 2016 · 0 comments

Comments

@klonos
Copy link
Member

klonos commented Dec 7, 2016

I thought of this while filing #2384...

I was thinking something like project_get_info($project_name, $property = NULL) that would auto-detect project type (from the .info file or the system table?). If $property is omitted, then an array of all the project info would be returned (keyed by property), else the specific property defined in $property. This would allow us to get a specific project property like this:

$human_readable_name = project_get_info('devel', 'name');

...instead of this:

$module_info = system_get_info('module', 'devel');
$human_readable_name = $module_info['name'];

...while still being able to do things like this:

$module_info = project_get_info('devel');
$human_readable_name = $module_info['name'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant