aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-10-31 15:28:37 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-10-31 15:28:37 +0100
commit26f88e043ebedcadd337011ce527f6148350f0dc (patch)
treeb41d1c9dd646c35a2cac88ba999b0cdd35726a68 /public
parente17392e46259e6f2e012017987cf7c31c171488f (diff)
downloadwcms-26f88e043ebedcadd337011ce527f6148350f0dc.tar.gz
wcms-26f88e043ebedcadd337011ce527f6148350f0dc.zip
homemade very root database engine
Diffstat (limited to 'public')
-rw-r--r--public/test.php41
-rw-r--r--public/test3.php12
2 files changed, 45 insertions, 8 deletions
diff --git a/public/test.php b/public/test.php
index 7af0a01..35c8575 100644
--- a/public/test.php
+++ b/public/test.php
@@ -1,15 +1,40 @@
<?php
-function test()
+
+
+require('../w/class/art2.php');
+
+$art = new Art2(['id' => 'rr']);
+$art->reset();
+$art->hydrate((['description' => 'fdsfs', 'secure' => 0]));
+
+var_dump($art);
+
+$artencoded = json_encode($art);
+
+var_dump($artencoded);
+
+class Person
{
- static $count = 0;
+ public $id;
+ public $name;
+ public $table = ['coucou', 'lol', 'chouette'];
+ public $date;
- $count++;
- echo $count;
- if ($count < 10) {
- test();
+ public function __construct(array $data)
+ {
+ $this->id = $data['id'];
+ $this->name = $data['name'];
+ $this->date = new DateTimeImmutable();
}
- $count--;
}
-test();
+$person = new Person(array('id' => 1, 'name' => 'Amir'));
+$jsonperson = json_encode($person);
+
+var_dump($jsonperson);
+
+var_dump(json_decode($jsonperson));
+
+
+
?> \ No newline at end of file
diff --git a/public/test3.php b/public/test3.php
index dcdb979..327e2dd 100644
--- a/public/test3.php
+++ b/public/test3.php
@@ -1,5 +1,17 @@
<?php
+$path = '../w/class/';
+$lengh = strlen($path);
+$array = [];
+foreach (glob($path . '*.php') as $filename) {
+ $array[] = substr(substr($filename, $lengh), 0, -4);
+}
+
+var_dump($array);
+
+
+
+