From e802d5204b96d645ec3d40b81b4a8bdc6e0ee675 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Mon, 4 Nov 2019 23:31:31 +0100 Subject: refactor: switch to psr-4 autoloading --- app/class/modelanalyse.php | 73 ---------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 app/class/modelanalyse.php (limited to 'app/class/modelanalyse.php') diff --git a/app/class/modelanalyse.php b/app/class/modelanalyse.php deleted file mode 100644 index 66a443e..0000000 --- a/app/class/modelanalyse.php +++ /dev/null @@ -1,73 +0,0 @@ -getlister(); - - $pagelist2 = []; - foreach ($pagelist as $page) { - $page->setlinkfrom($this->analyselinkfrom($page)); - $pagelist2[] = $page; - } - foreach ($pagelist2 as $page) { - $page->setlinkto($this->analyselinkto($page->id(), $pagelist)); - $this->update($page); - } - } - - - public function analyse(Page $page) - { - $page->setlinkfrom($this->analyselinkfrom($page)); - - $pagelist = $this->getlister(); - $page->setlinkto($this->analyselinkto($page->id(), $pagelist)); - - return $page; - } - - - - - public function analyselinkto($id, $pagelist) - { - //analyse les liens vers cet pageicle en fouillant tout les linkfrom de la bdd, génere un tableau à stocker dans l'pageicle - $linkto = []; - foreach ($pagelist as $link) { - if (in_array($id, $link->linkfrom('array')) && $id != $link->id()) { - $linkto[] = $link->id(); - } - } - return $linkto; - } - - public function analyselinkfrom(Page $page) - { - $linkfrom = []; - foreach (self::TEXT_ELEMENTS as $element) { - preg_match_all('#\]\((\?id=|=)(\w+)\)#', $page->$element(), $out); - $linkfrom = array_merge($linkfrom, $out[2]); - } - return array_unique($linkfrom); - - } - -} - - - - - - - -?> \ No newline at end of file -- cgit v1.2.3