From: X! Date: Sun, 8 Aug 2010 14:55:08 +0000 (+0000) Subject: Followup to r70638: Clean up code, add prop to function args, add comment X-Git-Tag: 1.31.0-rc.0~35609 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=b528bcdf89c9c3d65e08508e01b3eaa488e959c8;p=lhc%2Fweb%2Fwiklou.git Followup to r70638: Clean up code, add prop to function args, add comment --- diff --git a/includes/api/ApiQueryPageProps.php b/includes/api/ApiQueryPageProps.php index 089c94f18a..4629333beb 100644 --- a/includes/api/ApiQueryPageProps.php +++ b/includes/api/ApiQueryPageProps.php @@ -72,7 +72,7 @@ class ApiQueryPageProps extends ApiQueryBase { foreach ( $this->everything as $pageid => $title ) { - $pageInfo = $this->extractPageInfo( $pageid, $title ); + $pageInfo = $this->extractPageInfo( $pageid, $title, $prop ); $fit = $result->addValue( array( 'query', 'pages' @@ -92,7 +92,7 @@ class ApiQueryPageProps extends ApiQueryBase { * @param $title Title object * @return array */ - private function extractPageInfo( $pageid, $title ) { + private function extractPageInfo( $pageid, $title, $prop ) { global $wgPageProps; $pageInfo = array(); @@ -121,7 +121,7 @@ class ApiQueryPageProps extends ApiQueryBase { return $pageInfo; } - public function getCacheMode( $params ) { + public function getCacheMode() { return 'public'; } @@ -148,6 +148,9 @@ class ApiQueryPageProps extends ApiQueryBase { 'continue' => 'When more results are available, use this to continue', ); + //This mess of code first gets the length of the biggest propname, and adds two onto it to make + //the number of characters should be used before the dash. If the biggest propname is shorter than 12 characters, + //the number of characters before the dash become 14. $maxLen = max( array_map( 'strlen', array_keys( $wgPageProps ) ) ); $matchLen = $maxLen + 2; if( $maxLen < 12 ) {