Пример #1
0
 *
 * 	-s 	startDate with format dd/MM/yyyy (11/06/2011)
 *  -e 	endDate with format dd/MM/yyyy (11/06/2011)
 *	-n 	network name of the Oara_Network class for the network (AffiliateWindow, BuyAt, Dgm, WebGains......)
 *	-t 	type this param is not compulsory, choose which report we want, by default it will show us all of them (payment, merchant, transaction, overview)
 *
 *
 *	Examples from command line:
 *
 *	php affjet.php -s 12/02/2010 -e 15/06/2011 -n TradeDoubler
 *	php affjet.php -s 12/02/2010 -e 15/06/2011 -n TradeDoubler -t merchant
 *	php affjet.php -s 12/02/2010 -e 15/06/2011 -n AffiliateWindow -t payment
 *
 */
require realpath(dirname(__FILE__)) . '/../settings.php';
$arguments = Oara_Utilities::arguments($argv);
$argumentsMap = array();
$argumentsNumber = count($arguments['arguments']);
for ($i = 0; $i < $argumentsNumber; $i++) {
    $argumentsMap[$arguments['flags'][$i]] = $arguments['arguments'][$i];
}
if (isset($argumentsMap['s']) && isset($argumentsMap['e']) && isset($argumentsMap['n'])) {
    //Retrieving the credentials for the network selected
    $config = Zend_Registry::getInstance()->get('credentialsIni');
    $iniNetworkOption = strtolower($argumentsMap['n']);
    $credentials = $config->{$iniNetworkOption}->toArray();
    // Path for cookies inside of COOKIES_BASE_DIR
    $credentials["cookiesDir"] = "example";
    $credentials["cookiesSubDir"] = "Affjet";
    $credentials["cookieName"] = "test";
    //The name of the network, It should be the same that the class inside Oara/Network