initial commit
This commit is contained in:
29
run.php
Normal file
29
run.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Bcs\Databaseinterface\SqlSrvClient;
|
||||
use Bcs\CategoryChecker\CategoryChecker;
|
||||
use Hpz937\Encryption\DataEncryptor;
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
||||
$dotenv->load();
|
||||
|
||||
|
||||
// Usage
|
||||
// Assuming $pdo is your PDO instance connected to the MSSQL database
|
||||
// and $csvFilePath is the path to your CSV file
|
||||
$enc = new DataEncryptor($_ENV['ENCRYPTION_KEY']);
|
||||
$sqlSrvClient = new SqlSrvClient(
|
||||
$_ENV['MSSQL_SERVER_NAME'],
|
||||
$_ENV['MSSQL_DATABASE'],
|
||||
$_ENV['MSSQL_USERNAME'],
|
||||
$enc->decrypt($_ENV['MSSQL_PASSWORD'])
|
||||
);
|
||||
$csvFilePath = 'goggle-categories.csv';
|
||||
$outputFilePath = 'mismatch-category-rpt.xlsx';
|
||||
$outputCsvFilePath = 'remove-cat.csv';
|
||||
|
||||
$categoryChecker = new CategoryChecker($sqlSrvClient, $csvFilePath);
|
||||
$categoryChecker->outputMismatchesAsXlsx($outputFilePath);
|
||||
$categoryChecker->outputMissingCategoriesAsCsv($outputCsvFilePath);
|
||||
Reference in New Issue
Block a user