- Checkout Fly365 task
Following table demonstrates a concept of the difference:
# | String items in memory at a time | Decoded PHP items in memory at a time | Total |
---|---|---|---|
json_decode | 10000 | 10000 | 20000 |
JsonMachine::fromStream | 1 | 1 | 2 |
This means, that Streaming
is constantly efficient for any size of processed JSON. 100 GB no problem.
-
A REST API application to get transactions from multiple provider with criteria
-
GET
[base-url]/api/payment/transaction
-
Response
{
"transactions": [
{
"id": "flypay-a-0001",
"amount": 99,
"currency": "aud",
"statusCode": 1,
"orderReference": "2e58bd43-0001",
"provider": "flypayA"
}, {
"id": "flypay-a-0007",
"amount": 4,
"currency": "aud",
"statusCode": 1,
"orderReference": "2e58bd43-0007",
"provider": "flypayA"
}
]
}
-
link
http://127.0.0.1:8001/api/payment/transaction?statusCode=authorised&amountMax=1000&amountMin=500&provider=flypayA
-
amountMin
/api/payment/transaction?amountMin=300
requirements="\d+"
-
amountMax
/api/payment/transaction?amountMax=900
requirements="\d+"
-
currency
/api/payment/transaction?currency=usd
requirements="[a-z]+"
-
statusCode
/api/payment/transaction?statusCode=authorised
requirements="[a-z]+"
-
provider
/api/payment/transaction?provider=flypayA
requirements="[a-z]+"
- Create
.env
file from.env.dist
- Run
docker-compose build
- Run
docker-compose up -d
- Run
docker-compose run php composer install
to install the dependencies. - Run
docker-compose up
- Run
docker-compose run php /www/vendor/bin/phpunit
- PHP7.2
- Symfony4
- jms/serializer - Library for (de-)serializing data of any complexity; supports XML, JSON
Please read the following docs: