initial commit

This commit is contained in:
2024-02-16 17:02:41 -06:00
parent 146f59e14f
commit 5ff8d1b1a5
10 changed files with 2122 additions and 0 deletions

29
run.php Normal file
View 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);