diff --git a/.gitignore b/.gitignore index 7ff619c..d2865bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules development.yml production.yml +vendor diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..f356506 --- /dev/null +++ b/composer.json @@ -0,0 +1,6 @@ +{ + "require": { + "rmccue/requests": "^1.7", + "xamin/handlebars.php": "^0.10.4" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..76df6eb --- /dev/null +++ b/composer.lock @@ -0,0 +1,109 @@ +{ + "_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": "a54bd6daf1501e5092742fd20e496fec", + "packages": [ + { + "name": "rmccue/requests", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/rmccue/Requests.git", + "reference": "87932f52ffad70504d93f04f15690cf16a089546" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rmccue/Requests/zipball/87932f52ffad70504d93f04f15690cf16a089546", + "reference": "87932f52ffad70504d93f04f15690cf16a089546", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "requests/test-server": "dev-master" + }, + "type": "library", + "autoload": { + "psr-0": { + "Requests": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Ryan McCue", + "homepage": "http://ryanmccue.info" + } + ], + "description": "A HTTP library written in PHP, for human beings.", + "homepage": "http://github.com/rmccue/Requests", + "keywords": [ + "curl", + "fsockopen", + "http", + "idna", + "ipv6", + "iri", + "sockets" + ], + "time": "2016-10-13T00:11:37+00:00" + }, + { + "name": "xamin/handlebars.php", + "version": "v0.10.4", + "source": { + "type": "git", + "url": "https://github.com/XaminProject/handlebars.php.git", + "reference": "b85cee07eae96db0e1eec224ca90f5ce1e4d857a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/XaminProject/handlebars.php/zipball/b85cee07eae96db0e1eec224ca90f5ce1e4d857a", + "reference": "b85cee07eae96db0e1eec224ca90f5ce1e4d857a", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "~4.4", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "Handlebars": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "fzerorubigd", + "email": "fzerorubigd@gmail.com" + }, + { + "name": "Behrooz Shabani (everplays)", + "email": "everplays@gmail.com" + } + ], + "description": "Handlebars processor for php", + "homepage": "https://github.com/XaminProject/handlebars.php", + "time": "2016-12-12T13:51:02+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/composer.phar b/composer.phar new file mode 100755 index 0000000..041775a Binary files /dev/null and b/composer.phar differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..56a679f --- /dev/null +++ b/index.php @@ -0,0 +1,46 @@ +body)); + +// var_dump($_GET); +// var_dump($_POST); + +$method = $_SERVER['REQUEST_METHOD']; + +// if ($method == 'GET') { +// echo 'contact running'; +// exit; +// } + +const FORM_FIELDS = [ + '_from', + '_subject', + '_to', + '_attachment', +]; + +const PRIVATE_FIELDS = [ + '_fake', + '_info', + '_next', +]; + +$formData = [ + 'from' => $_POST['_from'], + 'subject' => $_POST['_subject'], + 'to' => $_POST['_to'], + 'attachment' => $_POST['_attachment'], +]; + +$fields = [ + 'fake' => $_POST['_fake'], + 'info' => $_POST['_info'], + 'next' => $_POST['_next'], +]; + +var_dump($formData, $fields); + +echo 'DONE';