diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..8cfa155 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,20 @@ +# Declare a pipeline +pipeline: + # Declare pipeline step + composer-install: + # Use image for step + image: fpfis/php71-build + # Run commands from this image + commands: + - composer install --ansi + + # Declare another step + lint-code: + image: fpfis/php71-build + commands: + - php -l index.php + + run-code: + image: fpfis/php71-build + commands: + - php index.php diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..24a7a67 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ + +# Base image : +FROM fpfis/php56-build + +# Create a folder for my app in the container +RUN mkdir /app + +# Make the image work in this directory by default +WORKDIR /app + +# Push my local files to the image +ADD . /app + +# Run composer install to get my app ready +RUN composer install + +# Specify which command to run when my container starts +ENTRYPOINT [ "php", "/app/index.php" ] diff --git a/composer.json b/composer.json index e7ac977..00e7dd8 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { "require": { - "symfony/yaml" : "*", + "symfony/yaml" : "*" } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..b5e2eed --- /dev/null +++ b/composer.lock @@ -0,0 +1,76 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "1d14b066a73960476c178ecf92bed18f", + "packages": [ + { + "name": "symfony/yaml", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "de5f125ea39de846b90b313b2cfb031a0152d223" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/de5f125ea39de846b90b313b2cfb031a0152d223", + "reference": "de5f125ea39de846b90b313b2cfb031a0152d223", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-02-19T20:08:53+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..3fb6119 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,23 @@ +version: '2' +services: + + # Define a PHP webserver + php-webserver: + # Use a PHP image with apache + image: fpfis/php56-dev + # Define settings + environment: + - XDEBUG=true + - DOCUMENT_ROOT=/app/build + # Mount a local volume in the container + volumes: + - ./:/app/build + # Share the container port with the host + ports: + - 8080:8080 + + # Define a mysql service + mysql: + image: fpfis/mysql56 + + diff --git a/index.php b/index.php index 03efc33..da36340 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,21 @@ $array = array( 'foo' => 'bar', - 'bar' => array('foo' => 'bar', 'bar' => 'baz' => 'test'), + 'bar' => array('foo' => 'bar', 'bar' => 'baz'), ); echo Yaml::dump($array); +$tree='*'; +$start_time = time(); +while (1) { + $tree = $tree.'*'; + print($tree."\n"); + $a++; + if ($a > 10){ + $a = 1; + $tree = '*'; + } + if ((time() - $start_time) > 600) { + return false; // timeout, function took longer than 300 seconds + } +}