• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wfLocalFile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wfLocalFile函数的典型用法代码示例。如果您正苦于以下问题:PHP wfLocalFile函数的具体用法?PHP wfLocalFile怎么用?PHP wfLocalFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wfLocalFile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: onPowerDelete

 /**
  * @static
  * @param string $action
  * @param Article $article
  * @return bool
  * @throws UserBlockedError
  * @throws PermissionsError
  */
 static function onPowerDelete($action, $article)
 {
     global $wgOut, $wgUser, $wgRequest;
     if ($action !== 'powerdelete') {
         return true;
     }
     if (!$wgUser->isAllowed('delete') || !$wgUser->isAllowed('powerdelete')) {
         throw new PermissionsError('powerdelete');
     }
     if ($wgUser->isBlocked()) {
         throw new UserBlockedError($wgUser->mBlock);
     }
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return false;
     }
     $reason = $wgRequest->getText('reason');
     $title = $article->getTitle();
     $file = $title->getNamespace() == NS_IMAGE ? wfLocalFile($title) : false;
     if ($file) {
         $oldimage = null;
         FileDeleteForm::doDelete($title, $file, $oldimage, $reason, false);
     } else {
         $article->doDelete($reason);
     }
     // this is stupid, but otherwise, WikiPage::doUpdateRestrictions complains about passing by reference
     $false = false;
     $article->doUpdateRestrictions(array('create' => 'sysop'), array('create' => 'infinity'), $false, $reason, $wgUser);
     return false;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:38,代码来源:PowerTools.class.php


示例2: run

	/**
	 * Run a thumbnail job on a given PDF file.
	 * @return bool true
	 */
	public function run() {
		if ( !isset( $this->params['page'] ) ) {
			wfDebugLog('thumbnails', 'A page for thumbnails job of ' . $this->title->getText() . ' was not specified! That should never happen!');
			return true; // no page set? that should never happen
		}

		$file = wfLocalFile( $this->title ); // we just want a local file
		if ( !$file ) {
			return true; // Just silently fail, perhaps the file was already deleted, don't bother
		}

		switch ($this->params['jobtype']) {
			case self::BIG_THUMB:
				global $wgImageLimits;
				// Ignore user preferences, do default thumbnails
				// everything here shamelessy copied and reused from includes/ImagePage.php
				$sizeSel = User::getDefaultOption( 'imagesize' );

				// The user offset might still be incorrect, specially if
				// $wgImageLimits got changed (see bug #8858).
				if ( !isset( $wgImageLimits[$sizeSel] ) ) {
					// Default to the first offset in $wgImageLimits
					$sizeSel = 0;
				}
				$max = $wgImageLimits[$sizeSel];
				$maxWidth = $max[0];
				$maxHeight = $max[1];
				
				$width_orig = $file->getWidth( $this->params['page'] );
				$width = $width_orig;
				$height_orig = $file->getHeight( $this->params['page'] );
				$height = $height_orig;
				if ( $width > $maxWidth || $height > $maxHeight ) {
					# Calculate the thumbnail size.
					# First case, the limiting factor is the width, not the height.
					if ( $width / $height >= $maxWidth / $maxHeight ) {
						$height = round( $height * $maxWidth / $width );
						$width = $maxWidth;
						# Note that $height <= $maxHeight now.
					} else {
						$newwidth = floor( $width * $maxHeight / $height );
						$height = round( $height * $newwidth / $width );
						$width = $newwidth;
						# Note that $height <= $maxHeight now, but might not be identical
						# because of rounding.
					}
					$transformParams = array( 'page' => $this->params['page'], 'width' => $width );
					$file->transform( $transformParams );
				}
				break;

			case self::SMALL_THUMB:
				global $wgUser;
				$sk = $wgUser->getSkin();
				$sk->makeThumbLinkObj( $this->title, $file, '', '', 'none', array( 'page' => $this->params['page'] ) );
				break;
		}

		return true;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:64,代码来源:CreatePdfThumbnailsJob.class.php


示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->setMwGlobals(array('wgEnableUploads' => true, 'wgAllowCopyUploads' => true));
     if (wfLocalFile('UploadFromUrlTest.png')->exists()) {
         $this->deleteFile('UploadFromUrlTest.png');
     }
 }
开发者ID:paladox,项目名称:2,代码行数:8,代码来源:UploadFromUrlTest.php


示例4: build

 public function build()
 {
     $this->file = wfLocalFile($this->title);
     if ($this->file && $this->file->exists()) {
         $this->fileText();
     }
     return $this->doc;
 }
开发者ID:zoglun,项目名称:mediawiki-extensions-CirrusSearch,代码行数:8,代码来源:FileDataBuilder.php


示例5: doDBUpdates

 public function doDBUpdates()
 {
     $method = $this->getOption('method', 'normal');
     $file = $this->getOption('file');
     $t = -microtime(true);
     $dbw = wfGetDB(DB_MASTER);
     if ($file) {
         $res = $dbw->select('image', array('img_name'), array('img_name' => $file), __METHOD__);
         if (!$res) {
             $this->error("No such file: {$file}", true);
             return false;
         }
         $this->output("Populating img_sha1 field for specified files\n");
     } else {
         $res = $dbw->select('image', array('img_name'), array('img_sha1' => ''), __METHOD__);
         $this->output("Populating img_sha1 field\n");
     }
     $imageTable = $dbw->tableName('image');
     if ($method == 'pipe') {
         // @todo FIXME: Kill this and replace with a second unbuffered DB connection.
         global $wgDBuser, $wgDBserver, $wgDBpassword, $wgDBname;
         $cmd = 'mysql -u' . wfEscapeShellArg($wgDBuser) . ' -h' . wfEscapeShellArg($wgDBserver) . ' -p' . wfEscapeShellArg($wgDBpassword, $wgDBname);
         $this->output("Using pipe method\n");
         $pipe = popen($cmd, 'w');
     }
     $numRows = $res->numRows();
     $i = 0;
     foreach ($res as $row) {
         if ($i % $this->mBatchSize == 0) {
             $this->output(sprintf("Done %d of %d, %5.3f%%  \r", $i, $numRows, $i / $numRows * 100));
             wfWaitForSlaves();
         }
         $file = wfLocalFile($row->img_name);
         if (!$file) {
             continue;
         }
         $sha1 = $file->getRepo()->getFileSha1($file->getPath());
         if (strval($sha1) !== '') {
             $sql = "UPDATE {$imageTable} SET img_sha1=" . $dbw->addQuotes($sha1) . " WHERE img_name=" . $dbw->addQuotes($row->img_name);
             if ($method == 'pipe') {
                 fwrite($pipe, "{$sql};\n");
             } else {
                 $dbw->query($sql, __METHOD__);
             }
         }
         $i++;
     }
     if ($method == 'pipe') {
         fflush($pipe);
         pclose($pipe);
     }
     $t += microtime(true);
     $this->output(sprintf("\nDone %d files in %.1f seconds\n", $numRows, $t));
     return !$file;
     // we only updated *some* files, don't log
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:56,代码来源:populateImageSha1.php


示例6: setUp

 public function setUp()
 {
     global $wgEnableUploads, $wgAllowCopyUploads;
     parent::setUp();
     $wgEnableUploads = true;
     $wgAllowCopyUploads = true;
     wfSetupSession();
     if (wfLocalFile('UploadFromUrlTest.png')->exists()) {
         $this->deleteFile('UploadFromUrlTest.png');
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:UploadFromUrlTest.php


示例7: execute

 public function execute()
 {
     $method = $this->getOption('method', 'normal');
     $file = $this->getOption('file');
     $t = -microtime(true);
     $dbw = wfGetDB(DB_MASTER);
     if ($file) {
         $res = $dbw->selectRow('image', array('img_name'), array('img_name' => $dbw->addQuotes($file)), __METHOD__);
         if (!$res) {
             $this->error("No such file: {$file}", true);
             return;
         }
     } else {
         $res = $dbw->select('image', array('img_name'), array('img_sha1' => ''), __METHOD__);
     }
     $imageTable = $dbw->tableName('image');
     $oldimageTable = $dbw->tableName('oldimage');
     $batch = array();
     if ($method == 'pipe') {
         // @fixme kill this and replace with a second unbuffered DB connection.
         global $wgDBuser, $wgDBserver, $wgDBpassword, $wgDBname;
         $cmd = 'mysql -u' . wfEscapeShellArg($wgDBuser) . ' -h' . wfEscapeShellArg($wgDBserver) . ' -p' . wfEscapeShellArg($wgDBpassword, $wgDBname);
         $this->output("Using pipe method\n");
         $pipe = popen($cmd, 'w');
     }
     $numRows = $res->numRows();
     $i = 0;
     foreach ($res as $row) {
         if ($i % 100 == 0) {
             $this->output(sprintf("Done %d of %d, %5.3f%%  \r", $i, $numRows, $i / $numRows * 100));
             wfWaitForSlaves(5);
         }
         $file = wfLocalFile($row->img_name);
         if (!$file) {
             continue;
         }
         $sha1 = File::sha1Base36($file->getPath());
         if (strval($sha1) !== '') {
             $sql = "UPDATE {$imageTable} SET img_sha1=" . $dbw->addQuotes($sha1) . " WHERE img_name=" . $dbw->addQuotes($row->img_name);
             if ($method == 'pipe') {
                 fwrite($pipe, "{$sql};\n");
             } else {
                 $dbw->query($sql, __METHOD__);
             }
         }
         $i++;
     }
     if ($method == 'pipe') {
         fflush($pipe);
         pclose($pipe);
     }
     $t += microtime(true);
     $this->output(sprintf("\nDone %d files in %.1f seconds\n", $numRows, $t));
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:54,代码来源:populateSha1.php


示例8: execute

    /**
     * Output the information for the external editor
     */
    public function execute()
    {
        global $wgContLang, $wgScript, $wgScriptPath, $wgCanonicalServer;
        $this->getOutput()->disable();
        $response = $this->getRequest()->response();
        $response->header('Content-type: application/x-external-editor; charset=utf-8');
        $response->header('Cache-control: no-cache');
        $special = $wgContLang->getNsText(NS_SPECIAL);
        # $type can be "Edit text", "Edit file" or "Diff text" at the moment
        # See the protocol specifications at [[m:Help:External editors/Tech]] for
        # details.
        if (count($this->urls)) {
            $urls = $this->urls;
            $type = "Diff text";
        } elseif ($this->getRequest()->getVal('mode') == 'file') {
            $type = "Edit file";
            $image = wfLocalFile($this->getTitle());
            if ($image) {
                $urls = array('File' => array('Extension' => $image->getExtension(), 'URL' => $image->getCanonicalURL()));
            } else {
                $urls = array();
            }
        } else {
            $type = "Edit text";
            # *.wiki file extension is used by some editors for syntax
            # highlighting, so we follow that convention
            $urls = array('File' => array('Extension' => 'wiki', 'URL' => $this->getTitle()->getCanonicalURL(array('action' => 'edit', 'internaledit' => 'true'))));
        }
        $files = '';
        foreach ($urls as $key => $vars) {
            $files .= "\n[{$key}]\n";
            foreach ($vars as $varname => $varval) {
                $files .= "{$varname}={$varval}\n";
            }
        }
        $url = $this->getTitle()->getFullURL($this->getRequest()->appendQueryValue('internaledit', 1, true));
        $control = <<<CONTROL
; You're seeing this file because you're using Mediawiki's External Editor feature.
; This is probably because you selected use external editor in your preferences.
; To edit normally, either disable that preference or go to the URL:
; {$url}
; See http://www.mediawiki.org/wiki/Manual:External_editors for details.
[Process]
Type={$type}
Engine=MediaWiki
Script={$wgCanonicalServer}{$wgScript}
Server={$wgCanonicalServer}
Path={$wgScriptPath}
Special namespace={$special}
{$files}
CONTROL;
        echo $control;
    }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:56,代码来源:ExternalEdit.php


示例9: __construct

 function __construct($title, $time = false)
 {
     parent::__construct($title);
     $this->img = wfFindFile($this->mTitle, $time);
     if (!$this->img) {
         $this->img = wfLocalFile($this->mTitle);
         $this->current = $this->img;
     } else {
         $this->current = $time ? wfLocalFile($this->mTitle) : $this->img;
     }
     $this->repo = $this->img->repo;
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:12,代码来源:ImagePage.php


示例10: imageUrl

 /**
  * Return the URL of an image, provided its name.
  *
  * Backwards-compatibility for extensions.
  * Note that fromSharedDirectory will only use the shared path for files
  * that actually exist there now, and will return local paths otherwise.
  *
  * @param string $name	Name of the image, without the leading "Image:"
  * @param boolean $fromSharedDirectory	Should this be in $wgSharedUploadPath?
  * @return string URL of $name image
  * @deprecated
  */
 static function imageUrl($name, $fromSharedDirectory = false)
 {
     wfDeprecated(__METHOD__);
     $image = null;
     if ($fromSharedDirectory) {
         $image = wfFindFile($name);
     }
     if (!$image) {
         $image = wfLocalFile($name);
     }
     return $image->getUrl();
 }
开发者ID:rocLv,项目名称:conference,代码行数:24,代码来源:Image.php


示例11: axMultiEditImageUpload

function axMultiEditImageUpload()
{
    global $wgRequest;
    $res = array();
    $postfix = $wgRequest->getVal('num');
    $infix = '';
    if ($wgRequest->getVal('infix') != '') {
        $infix = $wgRequest->getVal('infix');
    }
    // do the real upload
    $uploadform = new CreatePageImageUploadForm($wgRequest);
    $uploadform->mTempPath = $wgRequest->getFileTempName('wp' . $infix . 'UploadFile' . $postfix);
    $uploadform->mFileSize = $wgRequest->getFileSize('wp' . $infix . 'UploadFile' . $postfix);
    $uploadform->mSrcName = $wgRequest->getFileName('wp' . $infix . 'UploadFile' . $postfix);
    $uploadform->CurlError = $wgRequest->getUploadError('wp' . $infix . 'UploadFile' . $postfix);
    $uploadform->mLastTimestamp = $wgRequest->getText('wp' . $infix . 'LastTimestamp' . $postfix);
    $par_name = $wgRequest->getText('wp' . $infix . 'ParName' . $postfix);
    $file_ext = explode('.', $uploadform->mSrcName);
    $file_ext = @$file_ext[1];
    $uploadform->mParameterExt = $file_ext;
    if ($infix == '') {
        $uploadform->mDesiredDestName = $wgRequest->getText('Createtitle') . ' ' . trim($par_name);
    } else {
        $uploadform->mDesiredDestName = $wgRequest->getText('Createtitle');
    }
    $uploadform->mSessionKey = false;
    $uploadform->mStashed = false;
    $uploadform->mRemoveTempFile = false;
    // some of the values are fixed, we have no need to add them to the form itself
    $uploadform->mIgnoreWarning = 1;
    $uploadform->mUploadDescription = wfMsg('createpage-uploaded-from');
    $uploadform->mWatchthis = 1;
    $uploadedfile = $uploadform->execute();
    if ($uploadedfile['error'] == 0) {
        $imageobj = wfLocalFile($uploadedfile['timestamp']);
        $imageurl = $imageobj->createThumb(60);
        $res = array('error' => 0, 'msg' => $uploadedfile['msg'], 'url' => $imageurl, 'timestamp' => $uploadedfile['timestamp'], 'num' => $postfix);
    } else {
        if ($uploadedfile['once']) {
            #if ( !$error_once ) {
            $res = array('error' => 1, 'msg' => $uploadedfile['msg'], 'num' => $postfix);
            #}
            $error_once = true;
        } else {
            $res = array('error' => 1, 'msg' => $uploadedfile['msg'], 'num' => $postfix);
        }
    }
    $text = json_encode($res);
    $ar = new AjaxResponse($text);
    $ar->setContentType('text/html; charset=utf-8');
    return $ar;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:52,代码来源:SpecialCreatePage_ajax.php


示例12: loadFile

	/**
	 * @return bool
	 */
	protected function loadFile() {
		if ( $this->mFileLoaded ) {
			return true;
		}
		$this->mFileLoaded = true;

		$this->mFile = wfFindFile( $this->mTitle );
		if ( !$this->mFile ) {
			$this->mFile = wfLocalFile( $this->mTitle ); // always a File
		}
		$this->mRepo = $this->mFile->getRepo();
		return true;
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:16,代码来源:WikiFilePage.php


示例13: upload

	function upload( $title, $path ) {
		echo "$title seems not to be present in the wiki. Trying to upload from $path.\n";
		$image = wfLocalFile( $title );
		$archive = $image->publish( $path );
		$image->recordUpload( $archive->value, "Test file used for PagedTiffHandler unit test", "No license" );
		if( !$archive->isGood() )
		{
			echo "Something went wrong. Please manually upload $path\n";
			return false;
		} else {
			echo "Upload was successful.\n";
			return $image;
		}
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:14,代码来源:PagedTiffHandlerTest.php


示例14: doRecreate

	private function doRecreate($all) {
		global $wgExIndexMIMETypes, $wgExIndexOnHTTP;
		$dbw = wfGetDB( DB_MASTER );

		$tbl_pag = $dbw->tableName( 'page' );
		$tbl_idx = $dbw->tableName( 'searchindex' );
		
		$searchWhere = $all ? '' : ' AND NOT EXISTS (SELECT null FROM '.$tbl_idx.' WHERE si_page=p.page_id AND si_url IS NOT null)';
		$result = $dbw->query('SELECT p.page_id FROM '.$tbl_pag.' p WHERE p.page_namespace = '.NS_FILE.$searchWhere );
		$this->output( $result->numRows()." file(s) found\n" );
		
		$syncIdx = false;
		$countDone = 0;
		$countSkipped = 0;

		while (($row = $result->fetchObject()) !== false) {
			$titleObj = Title::newFromID($row->page_id);
			$file = wfLocalFile($titleObj->getText());

			if (in_array( $file->getMimeType(), $wgExIndexMIMETypes )) {
				$url = $wgExIndexOnHTTP ? preg_replace( '/^https:/i', 'http:', $file->getFullUrl() ) : $file->getFullUrl();
				$dbw->update('searchindex',
					array( 'si_url' => $url ), 
					array( 'si_page' => $row->page_id ),
					'SearchIndexUpdate:update' );
				$syncIdx = true;
			} else {
				$countSkipped++;
			}
			$countDone++;
		}
		
		if ( $syncIdx ) {
			$this->output( "Syncing index... " );
			$index = $dbw->getProperty('mTablePrefix')."si_url_idx";
			$dbw->query( "CALL ctx_ddl.sync_index('$index')" );
			$this->output( "Done\n" );
		}
		
		$this->output("Finished ($countDone processed" );
		if ( $countSkipped > 0 ) {
			$this->output(", $countSkipped skipped " );
		}
		$this->output(")\n" );
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:45,代码来源:maintainenceFixOTSLinks.php


示例15: edit

    function edit()
    {
        global $wgOut, $wgScript, $wgScriptPath, $wgServer, $wgLang;
        $wgOut->disable();
        $name = $this->mTitle->getText();
        $pos = strrpos($name, ".") + 1;
        header("Content-type: application/x-external-editor; charset=" . $this->mCharset);
        header("Cache-control: no-cache");
        # $type can be "Edit text", "Edit file" or "Diff text" at the moment
        # See the protocol specifications at [[m:Help:External editors/Tech]] for
        # details.
        if (!isset($this->mMode)) {
            $type = "Edit text";
            $url = $this->mTitle->getFullURL("action=edit&internaledit=true");
            # *.wiki file extension is used by some editors for syntax
            # highlighting, so we follow that convention
            $extension = "wiki";
        } elseif ($this->mMode == "file") {
            $type = "Edit file";
            $image = wfLocalFile($this->mTitle);
            $url = $image->getFullURL();
            $extension = substr($name, $pos);
        }
        $special = $wgLang->getNsText(NS_SPECIAL);
        $control = <<<CONTROL
; You're seeing this file because you're using Mediawiki's External Editor
; feature. This is probably because you selected use external editor
; in your preferences. To edit normally, either disable that preference
; or go to the URL {$url} .
; See http://www.mediawiki.org/wiki/Manual:External_editors for details.
[Process]
Type={$type}
Engine=MediaWiki
Script={$wgServer}{$wgScript}
Server={$wgServer}
Path={$wgScriptPath}
Special namespace={$special}

[File]
Extension={$extension}
URL={$url}
CONTROL;
        echo $control;
    }
开发者ID:GodelDesign,项目名称:Godel,代码行数:44,代码来源:ExternalEdit.php


示例16: doJobLoop

function doJobLoop(){
	global $wgJobTypeConfig, $wahJobDelay, $wahRunOnce, $wahStatusOutput;

	//look for jobs (sleep for $wahJobDelay if none found)
	$job = WahJobManager :: getNewJob(false, 'Internal');
	if(!$job && $wahRunOnce == false){
		if($wahStatusOutput)
			print "no jobs found waiting $wahJobDelay \n";
		sleep($wahJobDelay);
		return doJobLoop();
	}elseif(!$job  && $wahRunOnce == true){
		if($wahStatusOutput)
			print "no job found \n";
		return ;
	}

	$jobSet = WahJobManager ::getJobSetById( $job->job_set_id );
	$jobDetails = FormatJson::decode( $job->job_json ) ;

	//get the title (so we can access the source file)
	$fTitle = Title::newFromText( $job->title, $job->ns );
	$file = wfLocalFile( $fTitle );
	$thumbPath = $file->getThumbPath( $jobSet->set_encodekey );
	//make sure the directory is ready:
	wfMkdirParents( $thumbPath, null, __METHOD__ );

	$destTarget = $thumbPath . '.ogg';
	//issue the encoding command
	if($wahStatusOutput) print "Running Encode Command...\n";
	wahDoEncode($file->getPath(), $destTarget, $jobDetails->encodeSettings );

	//once done with encode update the status:
	WahJobManager :: updateJobDone($job);
	//update set done (if only one item in the set)
	$wjm = WahJobManager::newFromSet( $jobSet );
	$percDone = $wjm->getDonePerc();
	if( $percDone == 1 ){
		WahJobManager :: updateSetDone( $jobSet );
	}else{
		if($wahStatusOutput)
			print "job not complete? (might be mixing chunkDuration types?) ";
	}
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:43,代码来源:internalCmdLineEncoder.php


示例17: validateParameters

 /**
  * Validate the user parameters and set $this->archiveName and $this->file.
  * Throws an error if validation fails
  */
 protected function validateParameters()
 {
     // Validate the input title
     $title = Title::makeTitleSafe(NS_FILE, $this->params['filename']);
     if (is_null($title)) {
         $this->dieUsageMsg(array('invalidtitle', $this->params['filename']));
     }
     // Check if the file really exists
     $this->file = wfLocalFile($title);
     if (!$this->file->exists()) {
         $this->dieUsageMsg('notanarticle');
     }
     // Check if the archivename is valid for this file
     $this->archiveName = $this->params['archivename'];
     $oldFile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName($title, $this->archiveName);
     if (!$oldFile->exists()) {
         $this->dieUsageMsg('filerevert-badversion');
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:23,代码来源:ApiFileRevert.php


示例18: loadFile

 protected function loadFile()
 {
     if ($this->fileLoaded) {
         return true;
     }
     $this->fileLoaded = true;
     $this->displayImg = $this->img = false;
     wfRunHooks('ImagePageFindFile', array($this, &$this->img, &$this->displayImg));
     if (!$this->img) {
         $this->img = wfFindFile($this->mTitle);
         if (!$this->img) {
             $this->img = wfLocalFile($this->mTitle);
         }
     }
     if (!$this->displayImg) {
         $this->displayImg = $this->img;
     }
     $this->repo = $this->img->getRepo();
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:19,代码来源:ImagePage.php


示例19: loadFile

	protected function loadFile() {
		if ( $this->fileLoaded ) {
			return;
		}
		$this->fileLoaded = true;

		$this->displayImg = $img = false;
		wfRunHooks( 'ImagePageFindFile', array( $this, &$img, &$this->displayImg ) );
		if ( !$img ) { // not set by hook?
			$img = wfFindFile( $this->getTitle() );
			if ( !$img ) {
				$img = wfLocalFile( $this->getTitle() );
			}
		}
		$this->mPage->setFile( $img );
		if ( !$this->displayImg ) { // not set by hook?
			$this->displayImg = $img;
		}
		$this->repo = $img->getRepo();
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:20,代码来源:ImagePage.php


示例20: loadFile

 /**
  * @return bool
  */
 protected function loadFile()
 {
     if ($this->mFileLoaded) {
         return true;
     }
     $this->mFileLoaded = true;
     $this->mFile = false;
     if (!$this->mFile) {
         $this->mFile = wfFindFile($this->mTitle);
         /** Wikia change start (@author Garth Webb) */
         wfRunHooks('WikiFilePageCheckFile', [&$this->mFile]);
         /** Wikia change end */
         if (!$this->mFile) {
             $this->mFile = wfLocalFile($this->mTitle);
             // always a File
         }
     }
     $this->mRepo = $this->mFile->getRepo();
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:23,代码来源:WikiFilePage.php



注:本文中的wfLocalFile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wfLogDBError函数代码示例发布时间:2022-05-23
下一篇:
PHP wfLoadSkin函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap