Skip to content

Instantly share code, notes, and snippets.

@josegonzalez

josegonzalez/control

Created Apr 10, 2011
Embed
What would you like to do?
cakepackages control file
Package: cakepackages
Source: git://github.com/josegonzalez/cakepackages.git
Type: application
Section: application
Description: An application that can be used
to index other cakephp applications and plugins
Pre-depends: CakePHP==1.3
Recommends:
Suggests:
Bugs: http://github.com/josegonzalez/cakepackages/issues
Callbacks: git-submodules
<?php
function _load($path) {
$last = null;
$contents = array();
$file = file($path);
foreach ($file as $line) {
if (strpos($line, ' ') === 0) {
if (!$last) continue;
$contents[$last] .= ' ' . trim($line);
} else {
if (strstr($line, ':') === false) {
continue;
}
list($last, $line) = explode(':', $line, 2);
$last = strtolower($last);
$contents[$last] = trim($line);
}
}
return $contents;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment