コード例 #1
0
ファイル: AbuseFilter.php プロジェクト: emijrp/Peachy
 /**
  * Returns a list of all filters
  *
  * @access public
  * @param int $start Filter ID to start at. Default null
  * @param int $end Filter ID to end at. Default null
  * @param string $dir Direction to list. Default newer
  * @param bool $enabled Only list enabled filters. true => only enabled, false => only disabled, null => all
  * @param bool $deleted Only list deleted filters. true => only deleted, false => only non-deleted, null => all
  * @param bool $private Only list private filters. true => only private, false => only non-private, null => all
  * @param int $limit Number of filters to get. Default null
  * @param array $prop Properties to retrieve. Default array( 'id', 'description', 'pattern', 'actions', 'hits', 'comments', 'lasteditor', 'lastedittime', 'status', 'private' )
  * @return array
  */
 public function abusefilters($start = null, $end = null, $dir = 'newer', $enabled = null, $deleted = false, $private = null, $limit = null, $prop = array('id', 'description', 'pattern', 'actions', 'hits', 'comments', 'lasteditor', 'lastedittime', 'status', 'private'))
 {
     $tArray = array('prop' => $prop, '_code' => 'abf', 'abfdir' => $dir, '_limit' => $limit, 'abfshow' => array(), 'list' => 'abusefilters');
     if (!is_null($enabled)) {
         if ($enabled) {
             $tArray['abfshow'][] = 'enabled';
         } else {
             $tArray['abfshow'][] = '!enabled';
         }
     }
     if (!is_null($deleted)) {
         if ($deleted) {
             $tArray['abfshow'][] = 'deleted';
         } else {
             $tArray['abfshow'][] = '!deleted';
         }
     }
     if (!is_null($private)) {
         if ($private) {
             $tArray['abfshow'][] = 'private';
         } else {
             $tArray['abfshow'][] = '!private';
         }
     }
     $tArray['abfshow'] = implode('|', $tArray['abfshow']);
     if (!is_null($start)) {
         $tArray['abfstartid'] = $start;
     }
     if (!is_null($end)) {
         $tArray['abfendid'] = $end;
     }
     pecho("Getting abuse filter list...\n\n", PECHO_NORMAL);
     return $this->wiki->listHandler($tArray);
 }
コード例 #2
0
ファイル: Page.php プロジェクト: emijrp/Peachy
 /**
  * Returns array of pages that embed (transclude) the page given.
  *
  * @param array $namespace Which namespaces to search (default: null).
  * @param int $limit How many results to retrieve (default: null i.e. all).
  * @return array A list of pages the title is transcluded in.
  */
 public function embeddedin($namespace = null, $limit = null)
 {
     $eiArray = array('list' => 'embeddedin', '_code' => 'ei', 'eititle' => $this->title, '_lhtitle' => 'title', '_limit' => $limit);
     if (!is_null($namespace)) {
         $eiArray['einamespace'] = $namespace;
     }
     Hooks::runHook('PreQueryEmbeddedin', array(&$eiArray));
     pecho("Getting list of pages that include {$this->title}...\n\n", PECHO_NORMAL);
     return $this->wiki->listHandler($eiArray);
 }
コード例 #3
0
ファイル: User.php プロジェクト: emijrp/Peachy
 /**
  * List all deleted contributions.
  * The logged in user must have the 'deletedhistory' right
  *
  * @access public
  * @param bool $content Whether or not to return content of each contribution. Default false
  * @param string $start Timestamp to start at. Default null.
  * @param string $end Timestamp to end at. Default null.
  * @param string $dir Direction to list. Default 'older'
  * @param array $prop Information to retrieve. Default array( 'revid', 'user', 'parsedcomment', 'minor', 'len', 'content', 'token' )
  * @return array
  */
 public function deletedcontribs($content = false, $start = null, $end = null, $dir = 'older', $prop = array('revid', 'user', 'parsedcomment', 'minor', 'len', 'content', 'token'))
 {
     if (!in_array('deletedhistory', $this->wiki->get_userrights())) {
         pecho("User is not allowed to view deleted revisions", PECHO_FATAL);
         return false;
     }
     if ($content) {
         $prop[] = 'content';
     }
     $drArray = array('_code' => 'dr', 'list' => 'deletedrevs', 'druser' => $this->username, 'drprop' => implode('|', $prop), 'drdir' => $dir);
     if (!is_null($start)) {
         $drArray['drstart'] = $start;
     }
     if (!is_null($end)) {
         $drArray['drend'] = $end;
     }
     Hooks::runHook('StartDelrevs', array(&$drArray));
     pecho("Getting deleted revisions by {$this->username}...\n\n", PECHO_NORMAL);
     return $this->wiki->listHandler($drArray);
 }
コード例 #4
0
ファイル: Image.php プロジェクト: emijrp/Peachy
 /**
  * Returns all pages where the image is used. If function was already called earlier in the script, it will return the local cache unless $force is set to true.
  *
  * @access public
  * @param string|array $namespace Namespaces to look in. If set as a string, must be set in the syntax "0|1|2|...". If an array, simply the namespace IDs to look in. Default null.
  * @param string $redirects How to filter for redirects. Options are "all", "redirects", or "nonredirects". Default "all".
  * @param bool $followRedir If linking page is a redirect, find all pages that link to that redirect as well. Default false.
  * @param int|null $limit
  * @param bool $force Force regeneration of the cache. Default false (use cache).
  * @return array
  */
 public function get_usage($namespace = null, $redirects = "all", $followRedir = false, $limit = null, $force = false)
 {
     if ($force || !count($this->usage)) {
         $iuArray = array('list' => 'imageusage', '_code' => 'iu', '_lhtitle' => 'title', 'iutitle' => $this->title, 'iufilterredir' => $redirects);
         if (!is_null($namespace)) {
             if (is_array($namespace)) {
                 $namespace = implode('|', $namespace);
             }
             $iuArray['iunamespace'] = $namespace;
         }
         if (!is_null($limit)) {
             $iuArray['iulimit'] = $limit;
         }
         if ($followRedir) {
             $iuArray['iuredirect'] = 'yes';
         }
         pecho("Getting image usage for {$this->title}..\n\n", PECHO_NORMAL);
         $this->usage = $this->wiki->listHandler($iuArray);
     }
     return $this->usage;
 }