| 1 |
<?php |
<?php |
| 2 |
// $Id: node_factory.module,v 1.1.2.18 2008/08/28 08:59:30 clemenstolboom Exp $ |
// $Id: node_factory.module,v 1.1.2.19 2008/08/28 10:08:50 clemenstolboom Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 284 |
switch ($type) { |
switch ($type) { |
| 285 |
case 'json': |
case 'json': |
| 286 |
$node = json_decode($item, TRUE); |
$node = json_decode($item, TRUE); |
| 287 |
|
var_dump($item); |
| 288 |
break; |
break; |
| 289 |
case 'php': |
case 'php': |
| 290 |
_node_factory_create_php( $item); |
_node_factory_create_php( $item); |
| 314 |
if( DRUSH_VERBOSE) { |
if( DRUSH_VERBOSE) { |
| 315 |
drush_verbose( t('Node !n of type !t created', array( '!n' => $nid, '!t' => $type))); |
drush_verbose( t('Node !n of type !t created', array( '!n' => $nid, '!t' => $type))); |
| 316 |
$node = node_load( array( 'nid'=>$nid)); |
$node = node_load( array( 'nid'=>$nid)); |
|
var_export( $node); |
|
| 317 |
} |
} |
| 318 |
} |
} |
| 319 |
else { |
else { |
| 321 |
} |
} |
| 322 |
} |
} |
| 323 |
|
|
| 324 |
|
|
| 325 |
function _node_factory_create_node_xml() { |
function _node_factory_create_node_xml() { |
| 326 |
// xml://path_to_file |
// xml://path_to_file |
| 327 |
drush_die( t('Not yet implemented')); |
drush_die( t('Not yet implemented')); |
| 328 |
return; |
return; |
| 329 |
} |
} |
| 330 |
|
|
| 331 |
|
|
| 332 |
function _node_factory_create_node_php() { |
function _node_factory_create_node_php() { |
| 333 |
// php://path_to_file/file_name |
// php://path_to_file/file_name |
| 334 |
drush_die( t('Not yet implemented')); |
drush_die( t('Not yet implemented')); |
| 335 |
return; |
return; |
| 336 |
} |
} |
| 337 |
|
|
| 338 |
|
|
| 339 |
function _node_factory_create_node_json() { |
function _node_factory_create_node_json() { |
| 340 |
$nodes = func_get_args(); |
$nodes = func_get_args(); |
| 341 |
drush_verbose( t('Received @d', array( '@d' => count($nodes)))); |
drush_verbose( t('Received @d', array( '@d' => count($nodes)))); |
| 342 |
_node_factory_iterate( 'json', $nodes); |
_node_factory_iterate( 'json', $nodes); |
|
|
|
| 343 |
} |
} |