container: fetch: refactor for php
- Refactors locations for internal `fetch` impl and deps (composer) * A softer hardcoding without the need for a new autoloader * A restructured solution to silence the linter (phpstan) NOTE: variables are prepended with *_PHP_* as to not bring confusion with any other `dfi` dependencies or the `dfi` `root` module (C++).
This commit is contained in:
@@ -27,11 +27,11 @@
|
|||||||
|
|
||||||
namespace docker_finance\blockchains
|
namespace docker_finance\blockchains
|
||||||
{
|
{
|
||||||
require_once('blockchains/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||||
require_once('blockchains/internal/blockchains/algorand.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/blockchains/algorand.php');
|
||||||
require_once('blockchains/internal/blockchains/ethereum.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/blockchains/ethereum.php');
|
||||||
require_once('blockchains/internal/blockchains/tezos.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/blockchains/tezos.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
namespace docker_finance\blockchains\internal
|
namespace docker_finance\blockchains\internal
|
||||||
{
|
{
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ namespace docker_finance\blockchains\internal
|
|||||||
|
|
||||||
namespace docker_finance\blockchains
|
namespace docker_finance\blockchains
|
||||||
{
|
{
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
namespace docker_finance\blockchains\internal\blockchains\algorand
|
namespace docker_finance\blockchains\internal\blockchains\algorand
|
||||||
{
|
{
|
||||||
require_once('blockchains/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\blockchains\internal as internal;
|
use docker_finance\blockchains\internal as internal;
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
@@ -270,8 +270,8 @@ namespace docker_finance\blockchains\internal\blockchains\algorand
|
|||||||
|
|
||||||
namespace docker_finance\blockchains\internal\blockchains
|
namespace docker_finance\blockchains\internal\blockchains
|
||||||
{
|
{
|
||||||
require_once('blockchains/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\blockchains\internal as internal;
|
use docker_finance\blockchains\internal as internal;
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
namespace docker_finance\blockchains\internal\blockchains\ethereum
|
namespace docker_finance\blockchains\internal\blockchains\ethereum
|
||||||
{
|
{
|
||||||
require_once('blockchains/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\blockchains\internal as internal;
|
use docker_finance\blockchains\internal as internal;
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
@@ -322,8 +322,8 @@ namespace docker_finance\blockchains\internal\blockchains\ethereum
|
|||||||
|
|
||||||
namespace docker_finance\blockchains\internal\blockchains
|
namespace docker_finance\blockchains\internal\blockchains
|
||||||
{
|
{
|
||||||
require_once('blockchains/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\blockchains\internal as internal;
|
use docker_finance\blockchains\internal as internal;
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
namespace docker_finance\blockchains\internal\blockchains\tezos
|
namespace docker_finance\blockchains\internal\blockchains\tezos
|
||||||
{
|
{
|
||||||
require_once('blockchains/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\blockchains\internal as internal;
|
use docker_finance\blockchains\internal as internal;
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
@@ -265,8 +265,8 @@ namespace docker_finance\blockchains\internal\blockchains\tezos
|
|||||||
|
|
||||||
namespace docker_finance\blockchains\internal\blockchains
|
namespace docker_finance\blockchains\internal\blockchains
|
||||||
{
|
{
|
||||||
require_once('blockchains/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\blockchains\internal as internal;
|
use docker_finance\blockchains\internal as internal;
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
|
|
||||||
namespace docker_finance\exchanges
|
namespace docker_finance\exchanges
|
||||||
{
|
{
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('exchanges/internal/exchanges/coinbase.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/exchanges/coinbase.php');
|
||||||
require_once('exchanges/internal/exchanges/gemini.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/exchanges/gemini.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal
|
namespace docker_finance\exchanges\internal
|
||||||
{
|
{
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ namespace docker_finance\exchanges\internal
|
|||||||
|
|
||||||
namespace docker_finance\exchanges
|
namespace docker_finance\exchanges
|
||||||
{
|
{
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal\exchanges\bittrex
|
namespace docker_finance\exchanges\internal\exchanges\bittrex
|
||||||
{
|
{
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
@@ -249,8 +249,8 @@ namespace docker_finance\exchanges\internal\exchanges\bittrex
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal\exchanges
|
namespace docker_finance\exchanges\internal\exchanges
|
||||||
{
|
{
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Facade for Bittrex implementation
|
* @brief Facade for Bittrex implementation
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal\exchanges\celsius
|
namespace docker_finance\exchanges\internal\exchanges\celsius
|
||||||
{
|
{
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
@@ -170,8 +170,8 @@ namespace docker_finance\exchanges\internal\exchanges\celsius
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal\exchanges
|
namespace docker_finance\exchanges\internal\exchanges
|
||||||
{
|
{
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Facade for Celsius implementation
|
* @brief Facade for Celsius implementation
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,9 +27,8 @@
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal\exchanges\coinbase_pro
|
namespace docker_finance\exchanges\internal\exchanges\coinbase_pro
|
||||||
{
|
{
|
||||||
require_once('php/vendor/autoload.php'); //!< mocking-magician/coinbase-pro-sdk
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
require_once('utils/utils.php');
|
|
||||||
|
|
||||||
use MockingMagician\CoinbaseProSdk\CoinbaseFacade;
|
use MockingMagician\CoinbaseProSdk\CoinbaseFacade;
|
||||||
use MockingMagician\CoinbaseProSdk\Contracts\Api\ApiInterface;
|
use MockingMagician\CoinbaseProSdk\Contracts\Api\ApiInterface;
|
||||||
@@ -275,8 +274,8 @@ namespace docker_finance\exchanges\internal\exchanges\coinbase_pro
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal\exchanges
|
namespace docker_finance\exchanges\internal\exchanges
|
||||||
{
|
{
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Facade for Coinbase Pro implementation
|
* @brief Facade for Coinbase Pro implementation
|
||||||
|
|||||||
@@ -27,9 +27,8 @@
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal\exchanges\coinbase
|
namespace docker_finance\exchanges\internal\exchanges\coinbase
|
||||||
{
|
{
|
||||||
require_once('php/vendor/autoload.php'); //!< ccxt
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
require_once('utils/utils.php');
|
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
@@ -279,8 +278,8 @@ namespace docker_finance\exchanges\internal\exchanges\coinbase
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal\exchanges
|
namespace docker_finance\exchanges\internal\exchanges
|
||||||
{
|
{
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Facade for Coinbase implementation
|
* @brief Facade for Coinbase implementation
|
||||||
|
|||||||
@@ -27,9 +27,8 @@
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal\exchanges\gemini
|
namespace docker_finance\exchanges\internal\exchanges\gemini
|
||||||
{
|
{
|
||||||
require_once('php/vendor/autoload.php'); //!< ccxt
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
require_once('utils/utils.php');
|
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
use DateTime; // PHP
|
use DateTime; // PHP
|
||||||
@@ -490,8 +489,8 @@ namespace docker_finance\exchanges\internal\exchanges\gemini
|
|||||||
|
|
||||||
namespace docker_finance\exchanges\internal\exchanges
|
namespace docker_finance\exchanges\internal\exchanges
|
||||||
{
|
{
|
||||||
require_once('exchanges/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Facade for Gemini implementation
|
* @brief Facade for Gemini implementation
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,12 +25,21 @@
|
|||||||
|
|
||||||
//! @since docker-finance 1.0.0
|
//! @since docker-finance 1.0.0
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
//! Dependencies (via composer)
|
||||||
|
define('__DFI_PHP_DEPS__', getenv('__DFI_PHP_DEPS__') . '/');
|
||||||
|
require_once(__DFI_PHP_DEPS__ . 'vendor/autoload.php');
|
||||||
|
|
||||||
|
//! docker-finance `fetch` impl
|
||||||
|
define('__DFI_PHP_ROOT__', getenv('__DFI_PHP_ROOT__') . '/');
|
||||||
|
}
|
||||||
|
|
||||||
namespace docker_finance
|
namespace docker_finance
|
||||||
{
|
{
|
||||||
require_once('blockchains/fetch.php');
|
require_once(__DFI_PHP_ROOT__ . 'blockchains/fetch.php');
|
||||||
require_once('exchanges/fetch.php');
|
require_once(__DFI_PHP_ROOT__ . 'exchanges/fetch.php');
|
||||||
require_once('prices/fetch.php');
|
require_once(__DFI_PHP_ROOT__ . 'prices/fetch.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief API executor
|
* @brief API executor
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,9 +27,9 @@
|
|||||||
|
|
||||||
namespace docker_finance\prices
|
namespace docker_finance\prices
|
||||||
{
|
{
|
||||||
require_once('prices/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'prices/internal/base.php');
|
||||||
require_once('prices/internal/prices/crypto.php');
|
require_once(__DFI_PHP_ROOT__ . 'prices/internal/prices/crypto.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
namespace docker_finance\prices\internal
|
namespace docker_finance\prices\internal
|
||||||
{
|
{
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
@@ -443,7 +443,7 @@ namespace docker_finance\prices\internal
|
|||||||
|
|
||||||
namespace docker_finance\prices
|
namespace docker_finance\prices
|
||||||
{
|
{
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
namespace docker_finance\prices\internal\prices\crypto
|
namespace docker_finance\prices\internal\prices\crypto
|
||||||
{
|
{
|
||||||
require_once('prices/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'prices/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\prices\internal as internal;
|
use docker_finance\prices\internal as internal;
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
@@ -239,8 +239,8 @@ namespace docker_finance\prices\internal\prices\crypto
|
|||||||
|
|
||||||
namespace docker_finance\prices\internal\prices
|
namespace docker_finance\prices\internal\prices
|
||||||
{
|
{
|
||||||
require_once('prices/internal/base.php');
|
require_once(__DFI_PHP_ROOT__ . 'prices/internal/base.php');
|
||||||
require_once('utils/utils.php');
|
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||||
|
|
||||||
use docker_finance\utils as utils;
|
use docker_finance\utils as utils;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,8 +27,6 @@
|
|||||||
|
|
||||||
namespace docker_finance\utils
|
namespace docker_finance\utils
|
||||||
{
|
{
|
||||||
require_once('php/vendor/autoload.php'); //!< JsonCsv
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Environment mapper
|
* @brief Environment mapper
|
||||||
* @details From CLI<->PHP
|
* @details From CLI<->PHP
|
||||||
|
|||||||
@@ -833,7 +833,13 @@ function lib_fetch::__fetch_exec()
|
|||||||
[ -z "$_type" ] && lib_utils::die_fatal
|
[ -z "$_type" ] && lib_utils::die_fatal
|
||||||
[ -z "$_subtype" ] && lib_utils::die_fatal
|
[ -z "$_subtype" ] && lib_utils::die_fatal
|
||||||
|
|
||||||
local _dir="${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/fetch"
|
# `fetch` deps location (PHP)
|
||||||
|
local _deps="/usr/local/lib/php"
|
||||||
|
|
||||||
|
# `fetch` impl location (PHP)
|
||||||
|
local _impl="${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/fetch"
|
||||||
|
|
||||||
|
# NOTE: must reset IFS after executing
|
||||||
local _ifs="$IFS"
|
local _ifs="$IFS"
|
||||||
IFS=' '
|
IFS=' '
|
||||||
|
|
||||||
@@ -857,14 +863,14 @@ function lib_fetch::__fetch_exec()
|
|||||||
|
|
||||||
# TODO: remove no-limit after internal fetching writes per-paginated instead of per-fetch
|
# TODO: remove no-limit after internal fetching writes per-paginated instead of per-fetch
|
||||||
lib_utils::deps_check "php"
|
lib_utils::deps_check "php"
|
||||||
_exec+=("php" "-d" "memory_limit=\"-1\"" "-d" "include_path=\"/usr/local/lib:${_dir}\"")
|
_exec+=("php" "-d" "memory_limit=\"-1\"" "-d" "include_path=\"${_deps}:${_impl}\"")
|
||||||
lib_utils::print_debug "${_exec[@]}"
|
lib_utils::print_debug "${_exec[@]}"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Execute fetch
|
# Execute fetch
|
||||||
#
|
#
|
||||||
|
|
||||||
"${_exec[@]}" "${_dir}/fetch.php" "$_type" "$_subtype"
|
__DFI_PHP_DEPS__="${_deps}" __DFI_PHP_ROOT__="${_impl}" "${_exec[@]}" "${_impl}/fetch.php" "$_type" "$_subtype"
|
||||||
IFS="$_ifs"
|
IFS="$_ifs"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user