24 lines
626 B
PHP
24 lines
626 B
PHP
<?php
|
|
namespace lib\Controller;
|
|
|
|
require_once "lib/autoload.php";
|
|
|
|
if ($argc < 2) {
|
|
die("사용법 : php main.php 데이타파일명 [Type]\n");
|
|
}
|
|
if (!is_file($argv[1])) {
|
|
die($argv[1] . "는 파일형식이 아닙니다. \n");
|
|
}
|
|
$client_type = isset($argv[2]) ? $argv[2]:'Client_Code';
|
|
$lines = file($argv[1]);
|
|
if (!is_array($lines)) {
|
|
die($argv[1] . "는 파일데이터에 오류가 있습니다. \n");
|
|
}
|
|
|
|
$debug = false;
|
|
$coupon = new Coupon();
|
|
list($successes,$failes) = $coupon->execute($lines,$client_type,$debug);
|
|
print("Coupon 설정이 완료되었습니다.\n");
|
|
print_r($successes);
|
|
print_r($failes);
|