This is a PHP challenge. It's a simple application that prints a cross or a X, depending on the user's input.
An easy way to install things on Windows is using Chocolatey on PowerShell with administrative rights. It's a package manager for Windows, similar to brew
on Mac and apt
/apt-get
on Linux. This section will suggest how to install the required tools using Chocolatey. Feel free to use any other method you prefer.
- Install Chocolatey;
- Open PowerShell with administrative rights by pressing
Win + X
and then pressingA
; - Make sure you have git installed;
- Check your git version with
git --version
; - If it is not installed, run:
choco install git.install
;
- Check your git version with
- Install php;
- Check your php version with
php -v
; - If it is not installed, run:
choco install php
;
- Check your php version with
- Install composer;
- Check your composer version with
composer --version
; - If it is not installed, run:
choco install composer
;
- Check your composer version with
- Change directory to somewhere where you want to clone this repository;
- Clone this repository;
git clone https://github.com/ArielMAJ/php-challenge.git
;
- Change directory to the cloned repository's
src
(source) folder;cd php-challenge/src
;
- Install dependencies (this may take a while);
composer install --prefer-source
;
If you are a Mac or Linux user, feel free to follow the windows step-by-step above using your package manager of choice. I'm assuming that if you use one of these operating systems, you know how to install these things.
- Make sure you're in the src folder;
cd src/
(if you're in this repository's root folder);
- Run the application;
php core/main.php
;
- Follow the instructions on the screen, which are:
- Press
C
thenEnter
to print a Cross; - Press
X
thenEnter
to print a X; - Press
Ctrl + C
to exit the application, at any point;
- Press
To run the unit tests:
- Make sure you're in the src folder;
cd src/
(if you're in this repository's root folder);
- Run the tests (make sure you did step 8 of the preparing you enviroment step-by-step);
./vendor/bin/phpunit --testdox tests/
;
This application was developed and tested on Windows 11, using PHP 8.2.4 and Composer 2.5.5. It should work on any other operating system, but it was not tested.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to contact me, open issues or a discussion if you have any questions or suggestions. I'm always open to feedback. 😄
- React+Python: https://github.com/ArielMAJ/Python_API_Challenge
- React Client: https://github.com/ArielMAJ/Spotify-Client-Challenge
- HTML/CSS/JS/Bootstrap: https://github.com/tauanesales/GES_website
- HTML/CSS/JS+Python+Jinja: https://github.com/ArielMAJ/CoGES_Web_App
- React (incomplete project): https://github.com/ArielMAJ/Alura_7DaysOfCode
- HTML/CSS: https://github.com/ArielMAJ/arielmaj.github.io