8
0
Fork 0
This commit is contained in:
Daniel Seifert 2020-06-05 13:38:40 +02:00
parent e5f3740f3a
commit 2e882701af
Signed by: DanielS
GPG Key ID: 8A7C4C6ED1915C6F
5 changed files with 98 additions and 0 deletions

11
Models/raiseTaxRate.php Normal file
View File

@ -0,0 +1,11 @@
<?php
namespace D3\TaxRatesAdjustment\Model;
class raiseTaxRate
{
public function run()
{
dumpvar(__METHOD__);
}
}

15
bin/raiseTaxRate Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env php
<?php
$filePath = '../d3/taxratesadjustment/bootstrap.php';
$currentDirectory = __DIR__ . '/';
$filePath = $currentDirectory . $filePath;
require($filePath);
$change = new raiseTaxRate();
try {
$change->run();
} catch ( \Exception $e) {
echo $e->getMessage();
}

2
bin/reduceTaxRate Normal file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env php
<?php

50
bootstrap.php Normal file
View File

@ -0,0 +1,50 @@
<?php
use OxidEsales\ComposerPlugin\Installer\Package\ShopPackageInstaller;
$bootstrapFileName = getenv('ESHOP_BOOTSTRAP_PATH');
if (!empty($bootstrapFileName)) {
$bootstrapFileName = realpath(trim(getenv('ESHOP_BOOTSTRAP_PATH')));
} else {
$count = 0;
$bootstrapFileName = '../../'. ShopPackageInstaller::SHOP_SOURCE_DIRECTORY .'/bootstrap.php';
$currentDirectory = __DIR__ . '/';
while ($count < 5) {
$count++;
if (file_exists($currentDirectory . $bootstrapFileName)) {
$bootstrapFileName = $currentDirectory . $bootstrapFileName;
break;
}
$bootstrapFileName = '../' . $bootstrapFileName;
}
}
if (!(file_exists($bootstrapFileName) && !is_dir($bootstrapFileName))) {
$items = [
"Unable to find eShop bootstrap.php file.",
"You can override the path by using ESHOP_BOOTSTRAP_PATH environment variable.",
"\n"
];
$message = implode(" ", $items);
die($message);
}
require_once($bootstrapFileName);
define('OX_IS_ADMIN', true);
if (false == function_exists('isAdmin')) {
/**
* @return bool
*/
function isAdmin()
{
if (defined('OX_IS_ADMIN')) {
return OX_IS_ADMIN;
}
return true;
}
}

20
composer.json Normal file
View File

@ -0,0 +1,20 @@
{
"name": "d3/taxratesadjustment",
"description": "adjusts the tax rates for the German economic stimulus package 2020 / 2021",
"type": "library",
"require": {
"oxid-esales/oxideshop-ce": "^6.0"
},
"license": "GPL-3.0",
"authors": [
{
"name": "D3 Data Development (Inh. Thomas Dartsch)",
"email": "info@shopmodule.com",
"homepage": "http://www.d3data.de"
}
],
"bin": [
"bin/reduceTaxRate",
"bin/raiseTaxRate"
]
}