]>
git.agnieray.net Git - galette.git/blob - galette/post_contribution_test.php
4 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
7 * Post configuration script test
11 * Copyright © 2013-2014 The Galette Team
13 * This file is part of Galette (http://galette.tuxfamily.org).
15 * Galette is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
20 * Galette is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
31 * @author Johan Cwiklinski <johan@x-tnd.be>
32 * @copyright 2013-2014 The Galette Team
33 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
34 * @link http://galette.tuxfamily.org
35 * @since Available since 0.7.5dev - 2013-06-10
41 if (defined('STDIN')) {
42 //we're called from command line
43 $args = stream_get_contents(STDIN
);
44 } else if (count($_POST) > 0) {
45 //we're called from HTTP POST
47 //check if we're called from galette internal
48 if (isset($_POST['galette_internal'])) {
50 include_once 'includes/galette.inc.php';
51 unset($_POST['galette_internal']);
53 'Requested as Galette HTTP POST with parameters:' . "\n" .
57 echo 'Requested as HTTP POST with parameters:<br/>';
59 } else if (count($_GET) > 0) {
60 //we're called from HTTP GET
61 echo 'Requested as HTTP GET with parameters:<br/>';
65 if (count($args) == 0) {
66 //we're called without arguments => exit.
70 if (defined('STDIN')) {
71 //a successfull script returns 0, we do not output anything
72 $fp = fopen(__DIR__
. '/cache/galette_post_contrib_file.txt', 'w');
76 $json_args = json_decode($args);
77 foreach ($json_args as $k => $v) {
78 echo 'key: ' . $k . ' | value: ' . $v;