diff --git a/scripts/split_unimarc_by_site.php b/scripts/split_unimarc_by_site.php index b2e6f9e9ecc09ed638d3bdcd9958be87a4dfd132..f9155458bb4a51aa5a04de2d326bb49aaac4ce68 100644 --- a/scripts/split_unimarc_by_site.php +++ b/scripts/split_unimarc_by_site.php @@ -1,8 +1,5 @@ <?php require(__DIR__.'/../console.php'); -require_once(__DIR__.'/../cosmogramme/php/_init.php'); -require_once(__DIR__.'/../cosmogramme/php/classes/classe_log.php'); - $filename = $argv[1]; $subfield = $argv[2]; @@ -16,11 +13,23 @@ It stores records with related items depending on the subfield parameter. Usage : php split_unimarc_by_site.php <file_to_split_path> <subfield_tag_to_split_file_on> <destination_directory> EOF; -$log = new log('integration'); -$log_debug = new log('debug', false); -$log->setDebugLog($log_debug); -$log->open(true); -$log_debug->open(true); +class Write_Log_In_Temp { + protected $_path = './temp/split_unimarc_by_site.log'; + + public function __construct() { + file_put_contents($this->_path, + ''); + } + + + public function log($message) { + file_put_contents($this->_path, + $message . "\n", + FILE_APPEND); + } +} + +$log = new Write_Log_In_Temp; (new Class_Cosmogramme_Integration_SplitBySite) ->setLogger($log)