Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@josegonzalez
Created April 10, 2011 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josegonzalez/912819 to your computer and use it in GitHub Desktop.
Save josegonzalez/912819 to your computer and use it in GitHub Desktop.
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