From d7f3313ff4514e38c9f53439cd1a1287e56e45f7 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sun, 11 Nov 2018 17:19:26 +0100 Subject: reboot folder --- w/class/modelanalyse.php | 73 ------------------------------------------------ 1 file changed, 73 deletions(-) delete mode 100644 w/class/modelanalyse.php (limited to 'w/class/modelanalyse.php') diff --git a/w/class/modelanalyse.php b/w/class/modelanalyse.php deleted file mode 100644 index 379c41a..0000000 --- a/w/class/modelanalyse.php +++ /dev/null @@ -1,73 +0,0 @@ -getlister(); - - $artlist2 = []; - foreach ($artlist as $art) { - $art->setlinkfrom($this->analyselinkfrom($art)); - $artlist2[] = $art; - } - foreach ($artlist2 as $art) { - $art->setlinkto($this->analyselinkto($art->id(), $artlist)); - $this->update($art); - } - } - - - public function analyse(Art2 $art) - { - $art->setlinkfrom($this->analyselinkfrom($art)); - - $artlist = $this->getlister(); - $art->setlinkto($this->analyselinkto($art->id(), $artlist)); - - return $art; - } - - - - - public function analyselinkto($id, $artlist) - { - //analyse les liens vers cet article en fouillant tout les linkfrom de la bdd, génere un tableau à stocker dans l'article - $linkto = []; - foreach ($artlist as $link) { - if (in_array($id, $link->linkfrom('array')) && $id != $link->id()) { - $linkto[] = $link->id(); - } - } - return $linkto; - } - - public function analyselinkfrom(Art2 $art) - { - $linkfrom = []; - foreach (self::TEXT_ELEMENTS as $element) { - preg_match_all('#\]\((\?id=|=)(\w+)\)#', $art->$element(), $out); - $linkfrom = array_merge($linkfrom, $out[2]); - } - return array_unique($linkfrom); - - } - -} - - - - - - - -?> \ No newline at end of file -- cgit v1.2.3