diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..011894d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.lock +vendor +node_modules +.php_cs.cache diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..1e4175b --- /dev/null +++ b/.php_cs @@ -0,0 +1,12 @@ +exclude('vendor') + ->in(__DIR__); + +return PhpCsFixer\Config::create() + ->setUsingCache(true) + ->setRules([ + '@PSR2' => true, + 'single_quote' => true, + ])->setFinder($finder); diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..881afd1 --- /dev/null +++ b/composer.json @@ -0,0 +1,24 @@ +{ + "name": "bert/isdefoobaropen.nl", + "description": "Source code for isdefoobaropen.nl", + "type": "project", + "license": "GPLv3", + "authors": [ + { + "name": "Bert Peters", + "email": "bert@bertptrs.nl" + } + ], + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpro/grumphp": "^0.15.0", + "friendsofphp/php-cs-fixer": "^2.14" + }, + "autoload": { + "psr-4": { + "FooBar\\": "src/" + } + } +} diff --git a/config/config.sample.php b/config/config.sample.php new file mode 100644 index 0000000..960737e --- /dev/null +++ b/config/config.sample.php @@ -0,0 +1,15 @@ + [ + 'mask' => 8, + 'address' => '127.0.0.1', + ], + 'state_file' => __DIR__ . '/open.flag', +]; diff --git a/grumphp.yml b/grumphp.yml new file mode 100644 index 0000000..596a5ef --- /dev/null +++ b/grumphp.yml @@ -0,0 +1,6 @@ +parameters: + git_dir: . + bin_dir: vendor/bin + tasks: + phpcsfixer2: + config: .php_cs \ No newline at end of file diff --git a/index.php b/index.php deleted file mode 100644 index 0e4b7f3..0000000 --- a/index.php +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/foobar.css b/public/foobar.css similarity index 100% rename from foobar.css rename to public/foobar.css diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..a8ec2f8 --- /dev/null +++ b/public/index.php @@ -0,0 +1,8 @@ +isOpen()) { + require 'isOpen.php'; +} else { + require 'isGesloten.php'; +} diff --git a/isGesloten.php b/public/isGesloten.php similarity index 100% rename from isGesloten.php rename to public/isGesloten.php diff --git a/isOpen.php b/public/isOpen.php similarity index 100% rename from isOpen.php rename to public/isOpen.php diff --git a/star.png b/public/star.png similarity index 100% rename from star.png rename to public/star.png diff --git a/public/toggle.php b/public/toggle.php new file mode 100644 index 0000000..6f6d8bb --- /dev/null +++ b/public/toggle.php @@ -0,0 +1,31 @@ +isAuthorized()) { + $file = $configuration->stateFile(); + if ($configuration->isOpen()) { + unlink($file); + } else { + touch($file); + } +} +?> + + +
+ +