Created
April 10, 2011 22:53
-
-
Save josegonzalez/912819 to your computer and use it in GitHub Desktop.
cakepackages control file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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