/**
* Would the given text make this article a "good" article (i.e.,
* suitable for including in the article count)?
+ * @param string $text Text to analyze
+ * @return integer 1 if it can be counted else 0
*/
function isCountable( $text ) {
global $wgUseCommaCount;
- if ( 0 != $this->mTitle->getNamespace() ) { return 0; }
+ if ( NS_MAIN != $this->mTitle->getNamespace() ) { return 0; }
if ( $this->isRedirect( $text ) ) { return 0; }
$token = ($wgUseCommaCount ? ',' : '[[' );
if ( false === strstr( $text, $token ) ) { return 0; }
* @subpackage SpecialPage
*/
class UncategorizedPagesPage extends PageQueryPage {
- var $requestedNamespace = 0;
+ var $requestedNamespace = NS_MAIN;
function getName() {
return "Uncategorizedpages";
$this->mInterwiki = $this->mUrlform =
$this->mTextform = $this->mDbkeyform = '';
$this->mArticleID = -1;
- $this->mNamespace = 0;
+ $this->mNamespace = NS_MAIN;
$this->mRestrictionsLoaded = false;
$this->mRestrictions = array();
# Dont change the following, NS_MAIN is hardcoded in several place
* @static
* @access public
*/
- /* static */ function &newFromText( $text, $defaultNamespace = 0 ) {
+ function &newFromText( $text, $defaultNamespace = NS_MAIN ) {
$fname = 'Title::newFromText';
wfProfileIn( $fname );
* In theory these are value objects and won't get changed...
*/
static $titleCache = array();
- if( $defaultNamespace == 0 && isset( $titleCache[$text] ) ) {
+ if( $defaultNamespace == NS_MAIN && isset( $titleCache[$text] ) ) {
wfProfileOut( $fname );
return $titleCache[$text];
}
$t->mDefaultNamespace = $defaultNamespace;
if( $t->secureAndSplit() ) {
- if( $defaultNamespace == 0 ) {
+ if( $defaultNamespace == NS_MAIN ) {
if( count( $titleCache ) >= MW_TITLECACHE_MAX ) {
# Avoid memory leaks on mass operations...
$titleCache = array();