php - Code readed by Symfony differently in Controller and Command -
i'm working on symfony2 project put google analytics in database. user fills form date , checks datas want collect. when clicks on "submit", call gacontroller call command.
protected function configure() { $this->setname ( 'ga2' ) ->addargument ( 'startdate', inputargument::required, 'start date (format: yyyy-mm-dd)' ) ->addargument ( 'enddate', inputargument::required, 'end date (format: yyyy-mm-dd)' ) ->addargument ( 'metrics', inputargument::required, 'metrics (format: metric,metric2,...,metricn') ->addargument ( 'dimensions', inputargument::optional, 'dimensions (format: dimension1,dimension2,...,dimensionn'); }
the problem is, metrics , dimensions read controller array, , command-line string ! exemple :
controller read :
array (size=4) 0 => string 'ga:users' (length=8) 1 => string 'ga:newusers' (length=11) 2 => string 'ga:sessionsperuser' (length=18) 3 => string 'ga:percentnewvisits' (length=19) array (size=3) 0 => string 'ga:sessioncount' (length=15) 1 => string 'ga:dayssincelastsession' (length) 2 => string 'ga:userdefinedvalue' (length=19)
command-line read :
string(59) "ga:users,ga:newusers,ga:sessionsperuser" string(59) "ga:sessioncount,ga:dayssincelastsession,ga:userdefinedvalue"
but i'm using implode/explode array/string. need command-line put in windows scheduler.
thanks help.
Comments
Post a Comment