From 632b2df0396b6e99fe900fdb9fd0886fbd801fa4 Mon Sep 17 00:00:00 2001 From: Sergio Brighenti Date: Sat, 13 Oct 2018 13:45:57 +0200 Subject: [PATCH] Added command to switch between bootswatch.com themes --- bin/theme | 29 +++++++++++++++++++++++++++++ composer.json | 4 +++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 bin/theme diff --git a/bin/theme b/bin/theme new file mode 100644 index 0000000..72e7ea8 --- /dev/null +++ b/bin/theme @@ -0,0 +1,29 @@ +#!/usr/bin/env php +' . PHP_EOL; + echo 'Here a list of available Bootswatch themes:' . PHP_EOL; +} + +foreach ($json->themes as $theme) { + if (isset($argv[1]) && $argv[1] === mb_strtolower($theme->name)) { + file_put_contents('static/bootstrap/css/bootstrap.min.css', file_get_contents($theme->cssMin)); + echo "Installed theme {$theme->name}." . PHP_EOL; + break; + } + + if (!isset($argv[1])) { + echo " - {$theme->name} ({$theme->description})[Preview: {$theme->preview}]" . PHP_EOL; + } +} + +exit(0); \ No newline at end of file diff --git a/composer.json b/composer.json index 06ace52..1029bc9 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,9 @@ "league/flysystem": "^1.0.45", "twig/twig": "~2.0", "monolog/monolog": "^1.23", - "php": ">=7.1" + "php": ">=7.1", + "ext-json": "*", + "ext-gd": "*" }, "autoload": { "psr-4": {