cc-4105: added some comments to describe development

This commit is contained in:
Rudi Grinberg 2012-07-17 12:03:57 -04:00
parent 93276f64fc
commit e0ba52644f
1 changed files with 3 additions and 2 deletions

View File

@ -443,6 +443,7 @@ class ApiController extends Zend_Controller_Action
$this->view->watched_dirs = $watchedDirsPath;
}
// TODO : Remove this dry run bs after finishing testing
public function dispatchMetadataAction($md, $mode, $dry_run=false)
{
// Replace this compound result in a hash with proper error handling later on
@ -536,17 +537,17 @@ class ApiController extends Zend_Controller_Action
// The value is a json encoded hash that has all the information related to this action
// The key does not have any meaning as of yet but it could potentially correspond
// to some unique id.
Logging::log("Entering controller, mang");
$responses = array();
foreach ($request->getParams() as $k => $raw_json) {
$info_json = json_decode($raw_json, $assoc=true);
if( !array_key_exists('mode', $info_json) ) {
Logging::log("Received bad request, no 'mode' parameter");
Logging::log("Received bad request, no 'mode' parameter. Bad request is:");
Logging::log( $info_json );
continue;
}
$mode = $info_json['mode'];
unset( $info_json['mode'] );
// TODO : remove the $dry_run parameter after finished testing
$response = $this->dispatchMetadataAction($info_json, $info_json['mode'], $dry_run=true);
array_push($responses, $response);
// Like wise, remove the following line when done