From: <var...@us...> - 2014-10-10 16:45:43
|
Revision: 9247 http://sourceforge.net/p/phpwiki/code/9247 Author: vargenau Date: 2014-10-10 16:45:38 +0000 (Fri, 10 Oct 2014) Log Message: ----------- isa --> is_a Modified Paths: -------------- trunk/SOAP.php trunk/lib/BlockParser.php trunk/lib/CachedMarkup.php trunk/lib/DbSession/ADODB.php trunk/lib/DbSession/PDO.php trunk/lib/DbSession/SQL.php trunk/lib/DbSession.php trunk/lib/ErrorManager.php trunk/lib/HtmlParser.php trunk/lib/InlineParser.php trunk/lib/MailNotify.php trunk/lib/PageList.php trunk/lib/PagePerm.php trunk/lib/PageType.php trunk/lib/Template.php trunk/lib/WikiDB.php trunk/lib/WikiGroup.php trunk/lib/WikiPlugin.php trunk/lib/WikiTheme.php trunk/lib/WikiUser/AdoDb.php trunk/lib/WikiUser/EMailConfirm.php trunk/lib/WikiUser/File.php trunk/lib/WikiUser/PdoDb.php trunk/lib/WikiUser/PearDb.php trunk/lib/WikiUser.php trunk/lib/XmlRpcServer.php trunk/lib/editpage.php trunk/lib/loadsave.php trunk/lib/main.php trunk/lib/plugin/CreateToc.php trunk/lib/plugin/DebugAuthInfo.php trunk/lib/plugin/GooglePlugin.php trunk/lib/plugin/GraphViz.php trunk/lib/plugin/ListPages.php trunk/lib/plugin/PageHistory.php trunk/lib/plugin/PasswordReset.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/SiteMap.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/VisualWiki.php trunk/lib/plugin/WatchPage.php trunk/lib/plugin/WhoIsOnline.php trunk/lib/plugin/WikiBlog.php trunk/lib/plugin/WikiFormRich.php trunk/lib/stdlib.php trunk/lib/wikilens/RatingsDb.php trunk/tests/unit/lib/InlineParserTest.php trunk/tests/unit/lib/plugin/AllPagesTest.php trunk/tests/unit/lib/plugin/AllUsersTest.php trunk/tests/unit/lib/plugin/IncludePageTest.php trunk/tests/unit/lib/plugin/ListPagesTest.php trunk/tests/unit/lib/plugin/OrphanedPagesTest.php trunk/tests/unit/lib/plugin/WantedPagesTest.php trunk/themes/MacOSX/themeinfo.php trunk/themes/Portland/themeinfo.php trunk/themes/Wordpress/themeinfo.php trunk/themes/blog/themeinfo.php Modified: trunk/SOAP.php =================================================================== --- trunk/SOAP.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/SOAP.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -319,7 +319,7 @@ $p = $w->getPlugin($pluginName, false); // second arg? $pagelist = $p->run($dbi, $pluginargs, $request, $basepage); $pages = array(); - if (is_object($pagelist) and isa($pagelist, 'PageList')) { + if (is_object($pagelist) and is_a($pagelist, 'PageList')) { foreach ($pagelist->pageNames() as $name) $pages[] = array('pagename' => $name); } Modified: trunk/lib/BlockParser.php =================================================================== --- trunk/lib/BlockParser.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/BlockParser.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -494,7 +494,7 @@ // If content is a single paragraph, eliminate the paragraph... if (count($this->_content) == 1) { $elem = $this->_content[0]; - if (isa($elem, 'XmlElement') and $elem->getTag() == 'p') { + if (is_a($elem, 'XmlElement') and $elem->getTag() == 'p') { $this->setContent($elem->getContent()); } } @@ -590,7 +590,7 @@ function merge($nextBlock) { - if (isa($nextBlock, 'Block_list') and $this->_tag == $nextBlock->_tag) { + if (is_a($nextBlock, 'Block_list') and $this->_tag == $nextBlock->_tag) { array_splice($this->_content, count($this->_content), 0, $nextBlock->_content); return $this; @@ -733,7 +733,7 @@ function _setTerm($th) { $first_row = &$this->_content[0]; - if (isa($first_row, 'Block_table_dl_defn')) + if (is_a($first_row, 'Block_table_dl_defn')) $first_row->_setTerm($th); else $first_row->unshiftContent($th); @@ -753,7 +753,7 @@ function _IsASubtable($item) { - return isa($item, 'HtmlElement') + return is_a($item, 'HtmlElement') && $item->getTag() == 'table' && $item->getAttr('class') == 'wiki-dl-table'; } @@ -777,7 +777,7 @@ function & firstTR() { $first = &$this->_content[0]; - if (isa($first, 'Block_table_dl_defn')) + if (is_a($first, 'Block_table_dl_defn')) return $first->firstTR(); return $first; } @@ -785,7 +785,7 @@ function & lastTR() { $last = &$this->_content[$this->_nrows - 1]; - if (isa($last, 'Block_table_dl_defn')) + if (is_a($last, 'Block_table_dl_defn')) return $last->lastTR(); return $last; } @@ -798,7 +798,7 @@ $rows = &$this->_content; for ($i = 0; $i < count($rows); $i++) { $row = &$rows[$i]; - if (isa($row, 'Block_table_dl_defn')) + if (is_a($row, 'Block_table_dl_defn')) $row->setWidth($ncols - 1); else { $n = count($row->_content); @@ -1394,7 +1394,7 @@ */ function TransformTextPre($text, $basepage = false) { - if (isa($text, 'WikiDB_PageRevision')) { + if (is_a($text, 'WikiDB_PageRevision')) { $rev = $text; $text = $rev->getPackedContent(); } Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/CachedMarkup.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -45,7 +45,7 @@ // - the history is wrong (user and comment missing) // - the table of contents plugin no longer works global $WikiTheme; - if (isa($WikiTheme, 'WikiTheme_fusionforge')) { + if (is_a($WikiTheme, 'WikiTheme_fusionforge')) { return serialize($this); } @@ -88,7 +88,7 @@ { $links = array(); foreach ($this->_content as $item) { - if (!isa($item, 'Cached_DynamicContent')) + if (!is_a($item, 'Cached_DynamicContent')) continue; if (!($item_links = $item->getWikiPageLinks($this->_basepage))) continue; @@ -110,7 +110,7 @@ function getLinkInfo() { foreach ($this->_content as $link) { - if (!isa($link, 'Cached_Link')) + if (!is_a($link, 'Cached_Link')) continue; $info = $link->getLinkInfo($this->_basepage); $links[$info->href] = $info; @@ -125,13 +125,13 @@ $this->_append($subitem); } elseif (!is_object($item)) { $this->_buf .= $this->_quote((string)$item); - } elseif (isa($item, 'Cached_DynamicContent')) { + } elseif (is_a($item, 'Cached_DynamicContent')) { if ($this->_buf) { $this->_content[] = $this->_buf; $this->_buf = ''; } $this->_content[] = $item; - } elseif (isa($item, 'XmlElement')) { + } elseif (is_a($item, 'XmlElement')) { if ($item->isEmpty()) { $this->_buf .= $item->emptyTag(); } else { @@ -147,7 +147,7 @@ } if (!$item->isInlineElement()) $this->_buf .= "\n"; - } elseif (isa($item, 'XmlContent')) { + } elseif (is_a($item, 'XmlContent')) { foreach ($item->getContent() as $item) $this->_append($item); } elseif (method_exists($item, 'asXML')) { Modified: trunk/lib/DbSession/ADODB.php =================================================================== --- trunk/lib/DbSession/ADODB.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/DbSession/ADODB.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -159,7 +159,7 @@ $time = $dbh->qstr(time()); // postgres can't handle binary data in a TEXT field. - if (isa($dbh, 'ADODB_postgres64')) + if (is_a($dbh, 'ADODB_postgres64')) $sess_data = base64_encode($sess_data); $qdata = $dbh->qstr($sess_data); Modified: trunk/lib/DbSession/PDO.php =================================================================== --- trunk/lib/DbSession/PDO.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/DbSession/PDO.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -101,7 +101,7 @@ $res = ''; } $this->_disconnect(); - if (!empty($res) and isa($dbh, 'ADODB_postgres64')) { + if (!empty($res) and is_a($dbh, 'ADODB_postgres64')) { $res = base64_decode($res); } if (strlen($res) > 4000) { @@ -140,7 +140,7 @@ $time = time(); // postgres can't handle binary data in a TEXT field. - if (isa($dbh, 'ADODB_postgres64')) + if (is_a($dbh, 'ADODB_postgres64')) $sess_data = base64_encode($sess_data); /* AffectedRows with sessions seems to be unstable on certain platforms. Modified: trunk/lib/DbSession/SQL.php =================================================================== --- trunk/lib/DbSession/SQL.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/DbSession/SQL.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -108,7 +108,7 @@ $this->_disconnect(); if (DB::isError($res) || empty($res)) return ''; - if (isa($dbh, 'DB_pgsql')) + if (is_a($dbh, 'DB_pgsql')) //if (preg_match('|^[a-zA-Z0-9/+=]+$|', $res)) $res = base64_decode($res); if (strlen($res) > 4000) { @@ -149,7 +149,7 @@ trigger_error("delete empty session $qid", E_USER_WARNING); } // postgres can't handle binary data in a TEXT field. - if (isa($dbh, 'DB_pgsql')) + if (is_a($dbh, 'DB_pgsql')) $sess_data = base64_encode($sess_data); $qdata = $dbh->quote($sess_data); Modified: trunk/lib/DbSession.php =================================================================== --- trunk/lib/DbSession.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/DbSession.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -27,7 +27,7 @@ { // Check for existing DbSession handler $db_type = $dbh->getParam('dbtype'); - if (isa($dbh, 'WikiDB')) { + if (is_a($dbh, 'WikiDB')) { @include_once("lib/DbSession/" . $db_type . ".php"); $class = "DbSession_" . $db_type; Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/ErrorManager.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -122,7 +122,7 @@ // format it with the worst class (error, warning, notice) $worst_err = $flushed->_content[0]; foreach ($flushed->_content as $err) { - if ($err and isa($err, 'PhpError') and $err->errno > $worst_err->errno) { + if ($err and is_a($err, 'PhpError') and $err->errno > $worst_err->errno) { $worst_err = $err; } } @@ -276,13 +276,7 @@ $this->_die($error); } elseif (($error->errno & error_reporting()) != 0) { if (($error->errno & $this->_postpone_mask) != 0) { - if ((function_exists('isa') and isa($error, 'PhpErrorOnce')) - or (!function_exists('isa') and - ( - // stdlib independent isa() - (strtolower(get_class($error)) == 'phperroronce') - or (is_subclass_of($error, 'PhpErrorOnce')))) - ) { + if (is_a($error, 'PhpErrorOnce')) { $error->removeDoublettes($this->_postponed_errors); if ($error->_count < 2) $this->_postponed_errors[] = $error; Modified: trunk/lib/HtmlParser.php =================================================================== --- trunk/lib/HtmlParser.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/HtmlParser.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -86,7 +86,7 @@ function wikify($node, $parent = null) { $output = ''; - if (isa($node, 'XmlElement')) { + if (is_a($node, 'XmlElement')) { $dialect =& $this->dialect; $conv = $dialect->_handlers[$node->_tag]; if (is_string($conv) and method_exists($dialect, $conv)) { @@ -126,7 +126,7 @@ function elem_contents($node) { $output = ''; - if (isa($node, 'XmlElement')) { + if (is_a($node, 'XmlElement')) { foreach ($node->getContent() as $child) { $output .= $this->wikify($child, isset($node->parent) ? $node->parent : null); } Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/InlineParser.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -1315,7 +1315,7 @@ function _addMarkup($markup) { - if (isa($markup, 'SimpleMarkup')) + if (is_a($markup, 'SimpleMarkup')) $regexp = $markup->getMatchRegexp(); else $regexp = $markup->getStartRegexp(); @@ -1345,7 +1345,7 @@ // No start pattern found before end pattern. // We're all done! if (isset($markup) and is_object($markup) - and isa($markup, 'Markup_plugin') + and is_a($markup, 'Markup_plugin') ) { $current =& $output->_content[count($output->_content) - 1]; $current->setTightness(true, true); @@ -1367,13 +1367,13 @@ // Matched markup. Eat input, push output. // FIXME: combine adjacent strings. - if (isa($markup, 'SimpleMarkup')) + if (is_a($markup, 'SimpleMarkup')) $current = $markup->markup($match->match); else $current = $markup->markup($match->match, $body); $input = $match->postmatch; if (isset($markup) and is_object($markup) - and isa($markup, 'Markup_plugin') + and is_a($markup, 'Markup_plugin') ) { $current->setTightness(true, true); } @@ -1389,7 +1389,7 @@ function _parse_markup_body($markup, $match, &$text, $end_regexps) { - if (isa($markup, 'SimpleMarkup')) { + if (is_a($markup, 'SimpleMarkup')) { return true; // Done. SimpleMarkup is simple. } Modified: trunk/lib/MailNotify.php =================================================================== --- trunk/lib/MailNotify.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/MailNotify.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -323,7 +323,7 @@ */ function onChangePage(&$wikidb, &$wikitext, $version, &$meta) { - if (!isa($GLOBALS['request'], 'MockRequest')) { + if (!is_a($GLOBALS['request'], 'MockRequest')) { $notify = $wikidb->get('notify'); /* Generate notification emails? */ if (!empty($notify) and is_array($notify)) { @@ -342,7 +342,7 @@ { $result = true; /* Generate notification emails? */ - if (!$wikidb->isWikiPage($pagename) and !isa($GLOBALS['request'], 'MockRequest')) { + if (!$wikidb->isWikiPage($pagename) and !is_a($GLOBALS['request'], 'MockRequest')) { $notify = $wikidb->get('notify'); if (!empty($notify) and is_array($notify)) { //TODO: deferr it (quite a massive load if you remove some pages). @@ -358,7 +358,7 @@ function onRenamePage(&$wikidb, $oldpage, $new_pagename) { - if (!isa($GLOBALS['request'], 'MockRequest')) { + if (!is_a($GLOBALS['request'], 'MockRequest')) { $notify = $wikidb->get('notify'); if (!empty($notify) and is_array($notify)) { $this->getPageChangeEmails($notify); Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/PageList.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -958,12 +958,12 @@ { global $request; $dbi =& $request->getDbh(); - if (isa($dbi, 'WikiDB_SQL')) { + if (is_a($dbi, 'WikiDB_SQL')) { extract($dbi->_backend->_table_names); $res = $dbi->_backend->_dbh->getOne("SELECT max(length(pagename)) FROM $page_tbl"); if (DB::isError($res) || empty($res)) return false; else return $res; - } elseif (isa($dbi, 'WikiDB_ADODB')) { + } elseif (is_a($dbi, 'WikiDB_ADODB')) { extract($dbi->_backend->_table_names); $row = $dbi->_backend->_dbh->getRow("SELECT max(length(pagename)) FROM $page_tbl"); return $row ? $row[0] : false; @@ -1413,9 +1413,9 @@ return 0; } else { $pagea = $this->_getPageFromHandle($a); // If a string, convert to page - assert(isa($pagea, 'WikiDB_Page')); + assert(is_a($pagea, 'WikiDB_Page')); $pageb = $this->_getPageFromHandle($b); // If a string, convert to page - assert(isa($pageb, 'WikiDB_Page')); + assert(is_a($pageb, 'WikiDB_Page')); foreach ($this->_sortby as $colNum => $direction) { // get column type object if (!is_int($colNum)) { // or column fieldname Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/PagePerm.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -108,9 +108,9 @@ $perm = $perm_tree[1]; elseif (is_array($perm_tree[1])) { $perm_tree = pagePermissionsSimpleFormat($perm_tree[1],$owner,$group); - if (isa($perm_tree[1],'pagepermission')) + if (is_a($perm_tree[1],'pagepermission')) $perm = $perm_tree[1]; - elseif (isa($perm_tree,'htmlelement')) + elseif (is_a($perm_tree,'htmlelement')) return $perm_tree; } */ @@ -416,7 +416,7 @@ if ($group === ACL_ANONYMOUS) return !$user->isSignedIn(); if ($group === ACL_BOGOUSER) - return isa($user, '_BogoUser') or + return is_a($user, '_BogoUser') or (isWikiWord($user->_userid) and $user->_level >= WIKIAUTH_BOGO); if ($group === ACL_HASHOMEPAGE) return $user->hasHomePage(); Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/PageType.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -523,62 +523,6 @@ } } -/** - * FIXME. not yet used - */ -class PageFormatter_pdf extends PageFormatter -{ - - function _transform($text) - { - include_once 'lib/BlockParser.php'; - return TransformText($text); - } - - // one page or set of pages? - // here we try to format only a single page - function format($text) - { - include_once 'lib/Template.php'; - global $request; - $tokens['page'] = $this->_page; - $tokens['CONTENT'] = $this->_transform($text); - $pagename = $this->_page->getName(); - - // This is a XmlElement tree, which must be converted to PDF - - // We can make use of several pdf extensions. This one - fpdf - // - is pure php and very easy, but looks quite ugly and has a - // terrible interface, as terrible as most of the othes. - // The closest to HTML is htmldoc which needs an external cgi - // binary. - // We use a custom HTML->PDF class converter from PHPWebthings - // to be able to use templates for PDF. - require_once 'lib/fpdf.php'; - require_once 'lib/pdf.php'; - - $pdf = new PDF(); - $pdf->SetTitle($pagename); - $pdf->SetAuthor($this->_page->get('author')); - $pdf->SetCreator(WikiURL($pagename, array(), 1)); - $pdf->AliasNbPages(); - $pdf->AddPage(); - //TODO: define fonts - $pdf->SetFont('Times', '', 12); - //$pdf->SetFont('Arial','B',16); - - // PDF pagelayout from a special template - $template = new Template('pdf', $request, $tokens); - $pdf->ConvertFromHTML($template); - - // specify filename, destination - $pdf->Output($pagename . ".pdf", 'I'); // I for stdin or D for download - - // Output([string name [, string dest]]) - return $pdf; - } -} - class PageFormatter_MediaWiki extends PageFormatter { function _transform($text) Modified: trunk/lib/Template.php =================================================================== --- trunk/lib/Template.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/Template.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -92,7 +92,7 @@ private function _print($val) { - if (isa($val, 'Template')) { + if (is_a($val, 'Template')) { $this->_expandSubtemplate($val); } else { PrintXML($val); Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/WikiDB.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -562,7 +562,7 @@ E_USER_WARNING); } /* Generate notification emails? */ - if ($result and ENABLE_MAILNOTIFY and !isa($GLOBALS['request'], 'MockRequest')) { + if ($result and ENABLE_MAILNOTIFY and !is_a($GLOBALS['request'], 'MockRequest')) { $notify = $this->get('notify'); if (!empty($notify) and is_array($notify)) { include_once 'lib/MailNotify.php'; @@ -1041,12 +1041,12 @@ } /* Generate notification emails? */ - if (ENABLE_MAILNOTIFY and isa($newrevision, 'WikiDB_PageRevision')) { + if (ENABLE_MAILNOTIFY and is_a($newrevision, 'WikiDB_PageRevision')) { // Save didn't fail because of concurrent updates. $notify = $this->_wikidb->get('notify'); if (!empty($notify) and is_array($notify) - and !isa($GLOBALS['request'], 'MockRequest') + and !is_a($GLOBALS['request'], 'MockRequest') ) { include_once 'lib/MailNotify.php'; $MailNotify = new MailNotify($newrevision->getName()); Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/WikiGroup.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -215,7 +215,7 @@ case GROUP_ANONYMOUS: return $this->membership[$group] = !$user->isSignedIn(); case GROUP_BOGOUSER: - return $this->membership[$group] = (isa($user, '_BogoUser') + return $this->membership[$group] = (is_a($user, '_BogoUser') and $user->_level >= WIKIAUTH_BOGO); case GROUP_SIGNED: return $this->membership[$group] = $user->isSignedIn(); @@ -276,12 +276,12 @@ //don't strip WHERE, only the userid stuff. $sql = preg_replace('/(WHERE.*?)\s+\w+\s*=\s*["\']\$userid[\'"]/i', '\\1 AND 1', $sql); $sql = str_replace('WHERE AND 1', '', $sql); - if (isa($dbi, 'ADOConnection')) { + if (is_a($dbi, 'ADOConnection')) { $db_result = $dbi->Execute($sql); foreach ($db_result->GetArray() as $u) { $users = array_merge($users, array_values($u)); } - } elseif (isa($dbi, 'DB_common')) { // PearDB + } elseif (is_a($dbi, 'DB_common')) { // PearDB $users = array_merge($users, $dbi->getCol($sql)); } } @@ -293,12 +293,12 @@ $sql = preg_replace('/(WHERE.*?)\s+\w+\s*=\s*["\']\$userid[\'"]/i', '\\1 AND 1', $dbh->getAuthParam('auth_user_exists')); $sql = str_replace('WHERE AND 1', '', $sql); - if (isa($dbi, 'ADOConnection')) { + if (is_a($dbi, 'ADOConnection')) { $db_result = $dbi->Execute($sql); foreach ($db_result->GetArray() as $u) { $users = array_merge($users, array_values($u)); } - } elseif (isa($dbi, 'DB_common')) { + } elseif (is_a($dbi, 'DB_common')) { $users = array_merge($users, $dbi->getCol($sql)); } } @@ -631,16 +631,16 @@ } if (empty($this->user)) { // use _PassUser::prepare instead - if (isa($request->getUser(), '_PassUser')) + if (is_a($request->getUser(), '_PassUser')) $user = $request->getUser(); else $user = new _PassUser($this->username); - } elseif (!isa($this->user, '_PassUser')) { + } elseif (!is_a($this->user, '_PassUser')) { $user = new _PassUser($this->username); } else { $user =& $this->user; } - if (isa($this->user, '_PassUser')) { // TODO: safety by Charles Corrigan + if (is_a($this->user, '_PassUser')) { // TODO: safety by Charles Corrigan $this->_is_member = $user->prepare($DBAuthParams['is_member'], array('userid', 'groupname')); $this->_group_members = $user->prepare($DBAuthParams['group_members'], 'groupname'); @@ -973,7 +973,7 @@ if (strstr(LDAP_BASE_DN, "ou=")) $this->base_dn = preg_replace("/(ou=\w+,)?()/", "\$2", LDAP_BASE_DN); - if (!isset($this->user) or !isa($this->user, '_LDAPPassUser')) + if (!isset($this->user) or !is_a($this->user, '_LDAPPassUser')) $this->_user = new _LDAPPassUser('LdapGroupTest'); // to have a valid username else $this->_user =& $this->user; Modified: trunk/lib/WikiPlugin.php =================================================================== --- trunk/lib/WikiPlugin.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/WikiPlugin.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -274,7 +274,7 @@ $dbi = $request->getDbh(); $pagelist = $this->run($dbi, $plugin_args, $request, $basepage); $list = array(); - if (is_object($pagelist) and isa($pagelist, 'PageList')) + if (is_object($pagelist) and is_a($pagelist, 'PageList')) return $pagelist->pageNames(); elseif (is_array($pagelist)) return $pagelist; Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/WikiTheme.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -61,18 +61,18 @@ $version = false; - if (isa($page_or_rev, 'WikiDB_PageRevision')) { + if (is_a($page_or_rev, 'WikiDB_PageRevision')) { $version = $page_or_rev->getVersion(); if ($page_or_rev->isCurrent()) $version = false; $page = $page_or_rev->getPage(); $pagename = $page->getName(); $wikipage = $pagename; - } elseif (isa($page_or_rev, 'WikiDB_Page')) { + } elseif (is_a($page_or_rev, 'WikiDB_Page')) { $page = $page_or_rev; $pagename = $page->getName(); $wikipage = $pagename; - } elseif (isa($page_or_rev, 'WikiPageName')) { + } elseif (is_a($page_or_rev, 'WikiPageName')) { $wikipage = $page_or_rev; $pagename = $wikipage->name; if (!$wikipage->isValid('strict')) @@ -101,7 +101,7 @@ // WikiLink makes A link, not a string of fancy ones. // (I think that the fancy split links are just confusing.) // Todo: test external ImageLinks http://some/images/next.gif - if (isa($wikipage, 'WikiPageName') and + if (is_a($wikipage, 'WikiPageName') and !$label and strchr(substr($wikipage->shortName, 1), SUBPAGE_SEPARATOR) ) { @@ -130,7 +130,7 @@ if ($exists) { return $WikiTheme->linkExistingWikiWord($wikipage, $label, $version); } elseif ($type == 'if_known') { - if (!$label && isa($wikipage, 'WikiPageName')) + if (!$label && is_a($wikipage, 'WikiPageName')) $label = $wikipage->shortName; return HTML($label ? $label : $pagename); } else { @@ -607,7 +607,7 @@ $link = HTML::a(array('href' => $url)); - if (isa($wikiword, 'WikiPageName')) + if (is_a($wikiword, 'WikiPageName')) $default_text = $wikiword->shortName; else $default_text = $wikiword; @@ -628,7 +628,7 @@ global $request; // Get rid of anchors on unknown wikiwords - if (isa($wikiword, 'WikiPageName')) { + if (is_a($wikiword, 'WikiPageName')) { $default_text = $wikiword->shortName; $wikiword = $wikiword->name; } else { @@ -667,7 +667,7 @@ $link->setAttr('style', 'text-decoration: underline'); $link->setAttr('class', 'wikiunknown'); } - if (!isa($button, "ImageButton")) + if (!is_a($button, "ImageButton")) $button->setAttr('rel', 'nofollow'); $link->pushContent($button); if ($request->getPref('googleLink')) { @@ -685,13 +685,13 @@ if ($linktext) { $text = $linktext; - } elseif (isa($wikiword, 'WikiPageName')) { + } elseif (is_a($wikiword, 'WikiPageName')) { $text = $wikiword->shortName; } else { $text = $wikiword; } - if (isa($wikiword, 'WikiPageName')) + if (is_a($wikiword, 'WikiPageName')) $message = $wikiword->getWarnings(); else $message = sprintf(_("“%s”: Bad page name"), $wikiword); @@ -1043,7 +1043,7 @@ $pagename = $request->getArg("pagename"); $version = $request->getArg("version"); } elseif (is_object($page_or_rev)) { - if (isa($page_or_rev, 'WikiDB_PageRevision')) { + if (is_a($page_or_rev, 'WikiDB_PageRevision')) { $rev = $page_or_rev; $page = $rev->getPage(); if (!$rev->isCurrent()) $version = $rev->getVersion(); Modified: trunk/lib/WikiUser/AdoDb.php =================================================================== --- trunk/lib/WikiUser/AdoDb.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/WikiUser/AdoDb.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -40,7 +40,7 @@ function _AdoDbPassUser($UserName = '', $prefs = false) { - if (!$this->_prefs and isa($this, "_AdoDbPassUser")) { + if (!$this->_prefs and is_a($this, "_AdoDbPassUser")) { if ($prefs) $this->_prefs = $prefs; if (!isset($this->_prefs->_method)) _PassUser::_PassUser($UserName); Modified: trunk/lib/WikiUser/EMailConfirm.php =================================================================== --- trunk/lib/WikiUser/EMailConfirm.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/WikiUser/EMailConfirm.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -36,7 +36,7 @@ // sets the pref methods, before this class is initialized. function _EMailConfirmPassUser($UserName = '', $prefs = false, $file = '') { - if (!$this->_prefs and isa($this, "_EMailPassUser")) { + if (!$this->_prefs and is_a($this, "_EMailPassUser")) { if ($prefs) $this->_prefs = $prefs; if (!isset($this->_prefs->_method)) _PassUser::_PassUser($UserName); Modified: trunk/lib/WikiUser/File.php =================================================================== --- trunk/lib/WikiUser/File.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/WikiUser/File.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -35,7 +35,7 @@ // sets the pref methods, before this class is initialized. function _FilePassUser($UserName = '', $prefs = false, $file = '') { - if (!$this->_prefs and isa($this, "_FilePassUser")) { + if (!$this->_prefs and is_a($this, "_FilePassUser")) { if ($prefs) $this->_prefs = $prefs; if (!isset($this->_prefs->_method)) _PassUser::_PassUser($UserName); @@ -48,7 +48,7 @@ // same style as in main.php include_once(dirname(__FILE__) . "/../pear/File_Passwd.php"); // "__PHP_Incomplete_Class" - if (!empty($file) or empty($this->_file) or !isa($this->_file, "File_Passwd")) + if (!empty($file) or empty($this->_file) or !is_a($this->_file, "File_Passwd")) $this->_file = new File_Passwd($file, false, $file . '.lock'); else return false; Modified: trunk/lib/WikiUser/PdoDb.php =================================================================== --- trunk/lib/WikiUser/PdoDb.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/WikiUser/PdoDb.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -38,7 +38,7 @@ function _PdoDbPassUser($UserName = '', $prefs = false) { - if (!$this->_prefs and isa($this, "_PdoDbPassUser")) { + if (!$this->_prefs and is_a($this, "_PdoDbPassUser")) { if ($prefs) $this->_prefs = $prefs; } if (!isset($this->_prefs->_method)) Modified: trunk/lib/WikiUser/PearDb.php =================================================================== --- trunk/lib/WikiUser/PearDb.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/WikiUser/PearDb.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -36,7 +36,7 @@ function _PearDbPassUser($UserName = '', $prefs = false) { //global $DBAuthParams; - if (!$this->_prefs and isa($this, "_PearDbPassUser")) { + if (!$this->_prefs and is_a($this, "_PearDbPassUser")) { if ($prefs) $this->_prefs = $prefs; } if (!isset($this->_prefs->_method)) Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/WikiUser.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -305,7 +305,7 @@ */ function UpgradeUser($user, $newuser) { - if (isa($user, '_WikiUser') and isa($newuser, '_WikiUser')) { + if (is_a($user, '_WikiUser') and is_a($newuser, '_WikiUser')) { // populate the upgraded class $newuser with the values from the current user object //only _auth_level, _current_method, _current_index, if (!empty($user->_level) and @@ -349,7 +349,7 @@ $request->_user = $user; return true; } - if (isa($user, '_BogoUser')) + if (is_a($user, '_BogoUser')) $user = new _PassUser($UserName, $user->_prefs); $class = $user->nextClass(); if ($user = new $class($UserName, $user->_prefs)) { @@ -534,15 +534,15 @@ */ function isSignedIn() { - return (isa($this, '_BogoUser') or isa($this, '_PassUser')); + return (is_a($this, '_BogoUser') or is_a($this, '_PassUser')); } /** This is password checked for sure. */ function isAuthenticated() { - //return isa($this,'_PassUser'); - //return isa($this,'_BogoUser') || isa($this,'_PassUser'); + //return is_a($this,'_PassUser'); + //return is_a($this,'_BogoUser') || is_a($this,'_PassUser'); return $this->_level >= WIKIAUTH_BOGO; } @@ -2111,9 +2111,9 @@ foreach (array_keys($this->_prefs) as $type) { $obj =& $this->_prefs[$type]; $obj->_init = $init; - if (!isset($prefs[$type]) and isa($obj, "_UserPreference_bool")) + if (!isset($prefs[$type]) and is_a($obj, "_UserPreference_bool")) $prefs[$type] = false; - if (isset($prefs[$type]) and isa($obj, "_UserPreference_int")) + if (isset($prefs[$type]) and is_a($obj, "_UserPreference_int")) $prefs[$type] = (int)$prefs[$type]; if (isset($prefs[$type]) and $obj->get($type) != $prefs[$type]) { // special systemdefault prefs: Modified: trunk/lib/XmlRpcServer.php =================================================================== --- trunk/lib/XmlRpcServer.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/XmlRpcServer.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -782,7 +782,7 @@ $p = $w->getPlugin($pluginName, false); // second arg? $pagelist = $p->run($dbi, $plugin_args, $request, $basepage); $list = array(); - if (is_object($pagelist) and isa($pagelist, 'PageList')) { + if (is_object($pagelist) and is_a($pagelist, 'PageList')) { foreach ($pagelist->_pages as $page) { $list[] = $page->getName(); } Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/editpage.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -326,7 +326,7 @@ : $this->_currentVersion + 1, // force new? $meta); - if (!isa($newrevision, 'WikiDB_PageRevision')) { + if (!is_a($newrevision, 'WikiDB_PageRevision')) { // Save failed. (Concurrent updates). return false; } @@ -456,14 +456,14 @@ $oldparsed = TransformLinks($oldtext); $oldlinks = array(); foreach ($oldparsed->_content as $link) { - if (isa($link, 'Cached_ExternalLink') and !isa($link, 'Cached_InterwikiLink')) { + if (is_a($link, 'Cached_ExternalLink') and !is_a($link, 'Cached_InterwikiLink')) { $uri = $link->_getURL($this->page->getName()); $oldlinks[$uri]++; } } unset($oldparsed); foreach ($parsed->_content as $link) { - if (isa($link, 'Cached_ExternalLink') and !isa($link, 'Cached_InterwikiLink')) { + if (is_a($link, 'Cached_ExternalLink') and !is_a($link, 'Cached_InterwikiLink')) { $uri = $link->_getURL($this->page->getName()); // only check new links, so admins may add blocked links. if (!array_key_exists($uri, $oldlinks) and ($res = IsBlackListed($uri))) { Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/loadsave.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -41,7 +41,7 @@ { // MockRequest is from the unit testsuite, a faked request. (may be cmd-line) // We are silent on unittests. - if (isa($request, 'MockRequest')) + if (is_a($request, 'MockRequest')) return; // FIXME: This is a hack. This really is the worst overall hack in phpwiki. if ($html) @@ -60,7 +60,7 @@ { global $WikiTheme; - if (isa($request, 'MockRequest')) + if (is_a($request, 'MockRequest')) return; $action = $request->getArg('action'); $label = ''; @@ -119,31 +119,31 @@ PrintXML(HTML::p(HTML::strong(_("Complete."))), HTML::p(fmt("Return to %s", $pagelink))); // Ugly hack to get valid XHTML code - if (isa($WikiTheme, 'WikiTheme_fusionforge')) { + if (is_a($WikiTheme, 'WikiTheme_fusionforge')) { echo "</div>\n"; echo "</div>\n"; echo "</main>\n"; echo "</div>\n"; - } elseif (isa($WikiTheme, 'WikiTheme_Sidebar') - or isa($WikiTheme, 'WikiTheme_MonoBook') + } elseif (is_a($WikiTheme, 'WikiTheme_Sidebar') + or is_a($WikiTheme, 'WikiTheme_MonoBook') ) { echo "</div>\n"; echo "</div>\n"; echo "</div>\n"; echo "</div>\n"; - } elseif (isa($WikiTheme, 'WikiTheme_wikilens')) { + } elseif (is_a($WikiTheme, 'WikiTheme_wikilens')) { echo "</div>\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; - } elseif (isa($WikiTheme, 'WikiTheme_blog')) { + } elseif (is_a($WikiTheme, 'WikiTheme_blog')) { echo "</div>\n"; echo "</div>\n"; - } elseif (isa($WikiTheme, 'WikiTheme_Crao') - or isa($WikiTheme, 'WikiTheme_Hawaiian') - or isa($WikiTheme, 'WikiTheme_MacOSX') - or isa($WikiTheme, 'WikiTheme_shamino_com') - or isa($WikiTheme, 'WikiTheme_smaller') + } elseif (is_a($WikiTheme, 'WikiTheme_Crao') + or is_a($WikiTheme, 'WikiTheme_Hawaiian') + or is_a($WikiTheme, 'WikiTheme_MacOSX') + or is_a($WikiTheme, 'WikiTheme_shamino_com') + or is_a($WikiTheme, 'WikiTheme_smaller') ) { echo "</div>\n"; } @@ -357,13 +357,13 @@ longer_timeout($timeout); // Reset watchdog $pagename = $page->getName(); - if (!isa($request, 'MockRequest')) { + if (!is_a($request, 'MockRequest')) { PrintXML(HTML::br(), $pagename, ' ... '); flush(); } if (in_array($pagename, $excludeList)) { - if (!isa($request, 'MockRequest')) { + if (!is_a($request, 'MockRequest')) { PrintXML(_("Skipped.")); flush(); } @@ -389,7 +389,7 @@ $num = fwrite($fd, $data, strlen($data)); $msg->pushContent(HTML::small(fmt("%s bytes written", $num))); - if (!isa($request, 'MockRequest')) { + if (!is_a($request, 'MockRequest')) { PrintXML($msg); flush(); } @@ -402,7 +402,7 @@ function _copyMsg($page, $smallmsg) { - if (!isa($GLOBALS['request'], 'MockRequest')) { + if (!is_a($GLOBALS['request'], 'MockRequest')) { if ($page) $msg = HTML(HTML::br(), HTML($page), HTML::small($smallmsg)); else $msg = HTML::small($smallmsg); PrintXML($msg); @@ -626,13 +626,13 @@ if ($page->get('locked')) $attrib['write_protected'] = 1; } elseif (!$silent) { - if (!isa($request, 'MockRequest')) { + if (!is_a($request, 'MockRequest')) { PrintXML(HTML::br(), $pagename, ' ... '); flush(); } } if (in_array($pagename, $excludeList)) { - if (!$silent and !isa($request, 'MockRequest')) { + if (!$silent and !is_a($request, 'MockRequest')) { PrintXML(_("Skipped.")); flush(); } @@ -715,7 +715,7 @@ } $msg->pushContent(HTML::small(fmt("%s bytes written", $num), "\n")); if (!$silent) { - if (!isa($request, 'MockRequest')) { + if (!is_a($request, 'MockRequest')) { PrintXML($msg); } flush(); @@ -1006,7 +1006,7 @@ if (!$skip) { // in case of failures print the culprit: - if (!isa($request, 'MockRequest')) { + if (!is_a($request, 'MockRequest')) { PrintXML(HTML::span(WikiLink($pagename))); flush(); } @@ -1053,7 +1053,7 @@ } } - if (!isa($request, 'MockRequest')) { + if (!is_a($request, 'MockRequest')) { if ($skip) PrintXML(HTML::em(WikiLink($pagename)), $mesg); else @@ -1158,7 +1158,7 @@ return $content; // if loading from virgin setup do echo, otherwise trigger_error E_USER_NOTICE - if (!isa($GLOBALS['request'], 'MockRequest')) + if (!is_a($GLOBALS['request'], 'MockRequest')) echo sprintf(_("Loading InterWikiMap from external file %s."), $mapfile), "<br />"; $fd = fopen($mapfile, "rb"); Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/main.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -120,7 +120,7 @@ //$user = $this->getSessionVar('wiki_user'); // revive db handle, because these don't survive sessions if (isset($this->_user) and - (!isa($this->_user, WikiUserClassname()) + (!is_a($this->_user, WikiUserClassname()) or (strtolower(get_class($this->_user)) == '_passuser') or (strtolower(get_class($this->_user)) == '_fusionforgepassuser')) ) { @@ -136,7 +136,7 @@ $this->_user->_HomePagehandle = $this->getPage($userid); } // need to update the lockfile filehandle - if (isa($this->_user, '_FilePassUser') + if (is_a($this->_user, '_FilePassUser') and $this->_user->_file->lockfile and !$this->_user->_file->fplock ) { @@ -247,7 +247,7 @@ function updateAuthAndPrefs() { - if (isset($this->_user) and (!isa($this->_user, WikiUserClassname()))) { + if (isset($this->_user) and (!is_a($this->_user, WikiUserClassname()))) { $this->_user = false; } // Handle authentication request, if any. @@ -255,7 +255,7 @@ $this->setArg('auth', false); $this->_handleAuthRequest($auth_args); // possible NORETURN } elseif (!$this->_user - or (isa($this->_user, WikiUserClassname()) + or (is_a($this->_user, WikiUserClassname()) and !$this->_user->isSignedIn()) ) { // If not auth request, try to sign in as saved user. @@ -414,7 +414,7 @@ } $olduser->PrintLoginForm($this, $auth_args, $fail_message, 'newpage'); $this->finish(); //NORETURN - } elseif (isa($user, WikiUserClassname())) { + } elseif (is_a($user, WikiUserClassname())) { // Successful login (or logout.) $this->_setUser($user); } else { @@ -437,7 +437,7 @@ if (!$this->_user) $this->_user = new _PassUser($userid); $user = $this->_user->AuthCheck(array('userid' => $userid)); - if (isa($user, WikiUserClassname())) { + if (is_a($user, WikiUserClassname())) { $this->_setUser($user); // success! } } @@ -977,7 +977,7 @@ if (empty($_SERVER['PHP_AUTH_USER'])) { return false; } - } elseif (isa($user, WikiUserClassname())) { + } elseif (is_a($user, WikiUserClassname())) { $this->_user = $user; $this->_user->_authhow = 'session'; return $user->UserName(); Modified: trunk/lib/plugin/CreateToc.php =================================================================== --- trunk/lib/plugin/CreateToc.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/CreateToc.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -183,7 +183,7 @@ $content[$j]) ) return $j; - } elseif (isa($content[$j], 'cached_link')) { + } elseif (is_a($content[$j], 'cached_link')) { if (method_exists($content[$j], 'asXML')) { $content[$j]->_basepage = $basepage; $content[$j] = $content[$j]->asXML(); Modified: trunk/lib/plugin/DebugAuthInfo.php =================================================================== --- trunk/lib/plugin/DebugAuthInfo.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/DebugAuthInfo.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -103,7 +103,7 @@ $table = HTML::table(array('class' => 'bordered')); //$table->pushContent(HTML::tr(HTML::td(array('colspan' => 2)))); $userdata = obj2hash($user, array('_dbi', '_request', 'password', 'passwd')); - if (isa($user, "_FilePassUser")) { + if (is_a($user, "_FilePassUser")) { foreach ($userdata['_file']->users as $u => $p) { $userdata['_file']->users[$u] = "<hidden>"; } Modified: trunk/lib/plugin/GooglePlugin.php =================================================================== --- trunk/lib/plugin/GooglePlugin.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/GooglePlugin.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -88,9 +88,9 @@ default: trigger_error("Invalid mode"); } - if (isa($result, 'HTML')) + if (is_a($result, 'HTML')) $html->pushContent($result); - if (isa($result, 'GoogleSearchResults')) { + if (is_a($result, 'GoogleSearchResults')) { //TODO: result template if (!empty($result->resultElements)) { $list = HTML::ol(); Modified: trunk/lib/plugin/GraphViz.php =================================================================== --- trunk/lib/plugin/GraphViz.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/GraphViz.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -339,7 +339,7 @@ protected function getMap($dbi, $argarray, $request) { $result = $this->invokeDot($argarray); - if (isa($result, 'HtmlElement')) + if (is_a($result, 'HtmlElement')) return array(false, $result); else return $result; Modified: trunk/lib/plugin/ListPages.php =================================================================== --- trunk/lib/plugin/ListPages.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/ListPages.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -71,8 +71,8 @@ extract($args); // If the ratings table does not exist, or on dba it will break otherwise. - // Check if WikiTheme isa 'wikilens' - if ($info == 'pagename' and isa($GLOBALS['WikiTheme'], 'wikilens')) + // Check if WikiTheme is_a 'wikilens' + if ($info == 'pagename' and is_a($GLOBALS['WikiTheme'], 'wikilens')) $info .= ",top3recs"; if ($info) $info = explode(',', $info); Modified: trunk/lib/plugin/PageHistory.php =================================================================== --- trunk/lib/plugin/PageHistory.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/PageHistory.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -196,7 +196,7 @@ $minor_flag = ''; } $line = HTML::li(array('class' => $class)); - if (isa($WikiTheme, 'WikiTheme_MonoBook')) { + if (is_a($WikiTheme, 'WikiTheme_MonoBook')) { $line->pushContent( $this->diffLink($rev), ' ', $this->pageLink($rev), ' ', Modified: trunk/lib/plugin/PasswordReset.php =================================================================== --- trunk/lib/plugin/PasswordReset.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/PasswordReset.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -123,7 +123,7 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - if (isa($request, 'MockRequest')) + if (is_a($request, 'MockRequest')) return ''; $user =& $request->_user; Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/RecentChanges.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -541,7 +541,7 @@ $linkorname = $this->pageLink($rev); } - if ((isa($WikiTheme, 'WikiTheme_MonoBook')) or (isa($WikiTheme, 'WikiTheme_fusionforge'))) { + if ((is_a($WikiTheme, 'WikiTheme_MonoBook')) or (is_a($WikiTheme, 'WikiTheme_fusionforge'))) { $line->pushContent( $args['historylinks'] ? '' : $this->historyLink($rev), ' . . ', $linkorname, '; ', Modified: trunk/lib/plugin/SiteMap.php =================================================================== --- trunk/lib/plugin/SiteMap.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/SiteMap.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -188,7 +188,7 @@ reset($pagearr); if (!empty($includepages)) { // disallow direct usage, only via child class IncludeSiteMap - if (!isa($this, "WikiPlugin_IncludeSiteMap") and !isa($this, "WikiPlugin_IncludeTree")) + if (!is_a($this, "WikiPlugin_IncludeSiteMap") and !is_a($this, "WikiPlugin_IncludeTree")) $includepages = ''; if (!is_string($includepages)) $includepages = ' '; // avoid plugin loader problems Modified: trunk/lib/plugin/UserPreferences.php =================================================================== --- trunk/lib/plugin/UserPreferences.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/UserPreferences.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -72,7 +72,7 @@ $args = $this->getArgs($argstr, $request); $user =& $request->_user; $user->_request = $request; - if (isa($request, 'MockRequest')) + if (is_a($request, 'MockRequest')) return ''; if (defined('FUSIONFORGE') and FUSIONFORGE) { if (!($user->isAuthenticated())) { @@ -84,7 +84,7 @@ and (!isset($user->_prefs->_method) or !in_array($user->_prefs->_method, array('ADODB', 'SQL', 'PDO')))) or (in_array($request->getArg('action'), array('zip', 'ziphtml', 'dumphtml'))) - or (isa($user, '_ForbiddenUser')) + or (is_a($user, '_ForbiddenUser')) ) { $no_args = $this->getDefaultArguments(); $no_args['errmsg'] = HTML::p(array('class' => 'error'), Modified: trunk/lib/plugin/VisualWiki.php =================================================================== --- trunk/lib/plugin/VisualWiki.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/VisualWiki.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -148,7 +148,7 @@ /* ($dbi, $large, $recent, $refined, $backlink, $neighbour, $excludelist, $includelist, $color); */ $result = $this->invokeDot($argarray); - if (isa($result, 'HtmlElement')) + if (is_a($result, 'HtmlElement')) return array(false, $result); else return $result; Modified: trunk/lib/plugin/WatchPage.php =================================================================== --- trunk/lib/plugin/WatchPage.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/WatchPage.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -106,7 +106,7 @@ { $args = $this->getArgs($argstr, $request); - if (isa($request, 'MockRequest')) + if (is_a($request, 'MockRequest')) return ''; $user =& $request->_user; $userid = $user->UserName(); Modified: trunk/lib/plugin/WhoIsOnline.php =================================================================== --- trunk/lib/plugin/WhoIsOnline.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/WhoIsOnline.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -133,7 +133,7 @@ if (empty($date)) continue; $num_online++; $user = @unserialize($data); - if (!empty($user) and !isa($user, "__PHP_incomplete_Class")) { + if (!empty($user) and !is_a($user, "__PHP_incomplete_Class")) { // if "__PHP_incomplete_Class" try to avoid notice $userid = @$user->_userid; $level = @$user->_level; Modified: trunk/lib/plugin/WikiBlog.php =================================================================== --- trunk/lib/plugin/WikiBlog.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/WikiBlog.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -387,7 +387,7 @@ list(, $prefix, $month, $day, $time) = $m; return array('pagename' => $pagename, // page (list pages per month) or revision (list months)? - //'title' => isa($rev_or_page,'WikiDB_PageRevision') ? $rev_or_page->get('summary') : '', + //'title' => is_a($rev_or_page,'WikiDB_PageRevision') ? $rev_or_page->get('summary') : '', //'monthtitle' => $this->monthTitle($month), 'month' => $month, 'day' => $day, Modified: trunk/lib/plugin/WikiFormRich.php =================================================================== --- trunk/lib/plugin/WikiFormRich.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/plugin/WikiFormRich.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -147,7 +147,7 @@ $plugin_str = preg_replace(array("/^<!/", "/!>$/"), array("<?", "?>"), $value); // will return a pagelist object! pulldown,checkbox,radiobutton $value = $loader->expandPI($plugin_str, $GLOBALS['request'], $markup, $basepage); - if (isa($value, 'PageList')) + if (is_a($value, 'PageList')) $value = $value->pageNames(); // apply limit elseif (!is_array($value)) trigger_error(sprintf("Invalid argument %s ignored", htmlentities($arg_array[$i])), @@ -366,7 +366,7 @@ trigger_error("invalid input['method'] " . $input['method'], E_USER_WARNING); $pagelist = $p->run($dbi, @$input['args'], $request, $basepage); $values = array(); - if (is_object($pagelist) and isa($pagelist, 'PageList')) { + if (is_object($pagelist) and is_a($pagelist, 'PageList')) { foreach ($pagelist->_pages as $page) { if (is_object($page)) $values[] = $page->getName(); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-10 16:23:28 UTC (rev 9246) +++ trunk/lib/stdlib.php 2014-10-10 16:45:38 UTC (rev 9247) @@ -62,7 +62,6 @@ glob_to_pcre ($glob) glob_match ($glob, $against, $case_sensitive = true) explodePageList ($input, $perm = false) - isa ($object, $class) function_usable ($function_name) wikihash ($x) count_all ($arg) @@ -165,13 +164,13 @@ $anchor = false; if (is_object($pagename)) { - if (isa($pagename, 'WikiDB_Page')) { + if (is_a($pagename, 'WikiDB_Page')) { $pagename = $pagename->getName(); - } elseif (isa($pagename, 'WikiDB_PageRevision')) { + } elseif (is_a($pagename, 'WikiDB_PageRevision')) { $page = $pagename->getPage(); $args['version'] = $pagename->getVersion(); $pagename = $page->getName(); - } elseif (isa($pagename, 'WikiPageName')) { + } elseif (is_a($pagename, 'WikiPageName')) { $anchor = $pagename->anchor; $pagename = $pagename->name; } else { // php5 @@ -898,11 +897,11 @@ function _pagename($page) { - if (isa($page, 'WikiDB_Page')) + if (is_a($page, 'WikiDB_Page')) return $page->getName(); - elseif (isa($page, 'WikiDB_PageRevision')) + elseif (is_a($page, 'WikiDB_PageRevision')) return $page->getPageName(); - elseif (isa($page, 'WikiPageName')) + elseif (is_a($page, 'WikiPageName')) return $page->name; return $page; } @@ -1516,23 +1515,6 @@ // Class introspections -/** - * Determine whether object is of a specified type. - * In PHP builtin since 4.2.0 as is_a() - * is_a() deprecated in PHP 5, in favor of instanceof operator - * @param $object object An object. - * @param $class string Class name. - * @return bool True iff $object is a $class - * or a sub-type of $class. - */ -function isa($object, $class) -{ - $lclass = $class; - return is_object($object) - && (strtolower(get_class($object)) == strtolower($class) - || is_subclass_of($obje... [truncated message content] |