projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use default configuration if no config file is to be found
[platal.git]
/
classes
/
env.php
diff --git
a/classes/env.php
b/classes/env.php
index
7a2144f
..
7d67d4a
100644
(file)
--- a/
classes/env.php
+++ b/
classes/env.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-201
0
Polytechnique.org *
+ * Copyright (C) 2003-201
1
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-75,6
+75,18
@@
class Env
{
return array_map(array('Env', 'v'), $keys);
}
{
return array_map(array('Env', 'v'), $keys);
}
+
+ public static function set($key, $value)
+ {
+ $_REQUEST[$key] =& $value;
+ }
+
+ public static function bootstrap($key, $value)
+ {
+ if (!Env::has($key)) {
+ Env::set($key, $value);
+ }
+ }
}
class Post
}
class Post
@@
-133,6
+145,19
@@
class Post
{
return array_map(array('Post', 'v'), $keys);
}
{
return array_map(array('Post', 'v'), $keys);
}
+
+ public static function set($key, $value)
+ {
+ $_POST[$key] =& $value;
+ Env::set($key, $value);
+ }
+
+ public static function bootstrap($key, $value)
+ {
+ if (!Post::has($key)) {
+ Post::set($key, $value);
+ }
+ }
}
class Get
}
class Get
@@
-191,6
+216,19
@@
class Get
{
return array_map(array('Get', 'v'), $keys);
}
{
return array_map(array('Get', 'v'), $keys);
}
+
+ public static function set($key, $value)
+ {
+ $_GET[$key] =& $value;
+ Env::set($key, $value);
+ }
+
+ public static function bootstrap($key, $value)
+ {
+ if (!Get::has($key)) {
+ Get::set($key, $value);
+ }
+ }
}
class Cookie
}
class Cookie
@@
-224,6
+262,7
@@
class Cookie
setcookie($key, $value, time() + 86400 * $days, $globals->cookie_path, '',
$secure, $secure);
$_COOKIE[$key] = $value;
setcookie($key, $value, time() + 86400 * $days, $globals->cookie_path, '',
$secure, $secure);
$_COOKIE[$key] = $value;
+ Env::set($key, $value);
}
}
}
}