X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FCategoryfinder.php;h=cb67aa82b7f94a4086497e7e58d509d4aaf75232;hb=154a0a03aa545762663c98eeea40417425f8c430;hp=e2b6a0caa6454c478e7e3734654c68c3a179ca75;hpb=37048169d892e175c0a77a11f870713a347ff38a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Categoryfinder.php b/includes/Categoryfinder.php index e2b6a0caa6..cb67aa82b7 100644 --- a/includes/Categoryfinder.php +++ b/includes/Categoryfinder.php @@ -28,17 +28,17 @@ * * Example use : * - * # Determines whether the article with the page_id 12345 is in both - * # "Category 1" and "Category 2" or their subcategories, respectively + * # Determines whether the article with the page_id 12345 is in both + * # "Category 1" and "Category 2" or their subcategories, respectively * - * $cf = new Categoryfinder; - * $cf->seed( - * array( 12345 ), - * array( 'Category 1', 'Category 2' ), - * 'AND' - * ); - * $a = $cf->run(); - * print implode( ',' , $a ); + * $cf = new Categoryfinder; + * $cf->seed( + * array( 12345 ), + * array( 'Category 1', 'Category 2' ), + * 'AND' + * ); + * $a = $cf->run(); + * print implode( ',' , $a ); * * */ @@ -135,7 +135,7 @@ class Categoryfinder { # iterate through the parents foreach ( $this->parents[$id] as $p ) { - $pname = $p->cl_to ; + $pname = $p->cl_to; # Is this a condition? if ( isset( $conds[$pname] ) ) { @@ -172,6 +172,8 @@ class Categoryfinder { * Scans a "parent layer" of the articles/categories in $this->next */ function scan_next_layer() { + wfProfileIn( __METHOD__ ); + # Find all parents of the article currently in $this->next $layer = array(); $res = $this->dbr->select( @@ -209,7 +211,7 @@ class Categoryfinder { $res = $this->dbr->select( /* FROM */ 'page', /* SELECT */ array( 'page_id', 'page_title' ), - /* WHERE */ array( 'page_namespace' => NS_CATEGORY , 'page_title' => $layer ), + /* WHERE */ array( 'page_namespace' => NS_CATEGORY, 'page_title' => $layer ), __METHOD__ . '-2' ); foreach ( $res as $o ) { @@ -225,6 +227,7 @@ class Categoryfinder { foreach ( $layer as $v ) { $this->deadend[$v] = $v; } - } + wfProfileOut( __METHOD__ ); + } }