Use XML nodes as iterator

pull/129/head
Thomas Bruederli 11 years ago
parent 8e785956c1
commit 012a65af50

@ -54,18 +54,17 @@ if ($package->license) {
} }
if ($package->lead) { if ($package->lead) {
foreach ($package->lead as $lead) {
$data['authors'][] = array( $data['authors'][] = array(
'name' => strval($package->lead->name), 'name' => strval($lead->name),
'email' => strval($package->lead->email), 'email' => strval($lead->email),
'role' => 'Lead', 'role' => 'Lead',
); );
}
} }
if ($devs = $package->developer) { if ($devs = $package->developer) {
if (!is_array($devs)) { foreach ($package->developer as $dev) {
$devs = array($package->developer);
}
foreach ($devs as $dev) {
$data['authors'][] = array( $data['authors'][] = array(
'name' => strval($dev->name), 'name' => strval($dev->name),
'email' => strval($dev->email), 'email' => strval($dev->email),

Loading…
Cancel
Save