A-calc Console Php

dev-master 2019-07-17 15:09 UTC

This package is not auto-updated.

Last update: 2020-10-22 20:36:19 UTC


A-Calc Console (Test)


The preferred way to install this extension is through composer.

Either run

php composer.phar create-project jakharbek/a-calc-console-php-test:dev-master


application             contains application
    input/              contains input files
    output/             contains output results
docker/                 contains docker


First you need to copy the .env.example file and rename it to .env

Then fill out everything as you need to work after you can run docker-compose

docker-compose up -d

If you run this command for the first time, then it will probably download not-available images of the docker and this may take some time.

After you should set write permissions, to do this, run this command.

docker-compose exec app chmod 777 -R /app/application

Now you need to install all the dependencies of the compositor application, to do this, run this command.

docker-compose exec app composer install --working-dir=/app/application

Everything is ready now you can use the console command of our application

Command Calc

[filename] - The file will be used from the folder input

[operation] - Operation list:


docker-compose exec app php /app/application/calc [filename] "[operation]"

After all calculations, the results will be saved in a folder /output/


docker-compose exec app php /app/application/calc test-1.txt "+"

console example output:


Format Input File

The input file format is two numbers separated by a space.

For example:

1 4
6 45
-74 22
-5 12