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

PHP wfDl函数代码示例

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

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



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

示例1: setUp

 protected function setUp()
 {
     parent::setUp();
     if (!wfDl('xml')) {
         $this->markTestSkipped('Requires libxml to do XMP parsing');
     }
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:7,代码来源:XMPTest.php


示例2: testIsOldBroken

 public function testIsOldBroken()
 {
     if (!wfDl('exif')) {
         $this->markTestIncomplete("This test needs the exif extension.");
     }
     $res = $this->handler->isMetadataValid(null, ExifBitmapHandler::OLD_BROKEN_FILE);
     $this->assertEquals(ExifBitmapHandler::METADATA_COMPATIBLE, $res);
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:8,代码来源:ExifBitmapTest.php


示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->setMwGlobals('wgShowEXIF', true);
     $this->handler = new ExifBitmapHandler();
     if (!wfDl('exif')) {
         $this->markTestSkipped("This test needs the exif extension.");
     }
 }
开发者ID:nischayn22,项目名称:mediawiki-core,代码行数:9,代码来源:ExifBitmapTest.php


示例4: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->mediaPath = __DIR__ . '/../../data/media/';
     if (!wfDl('exif')) {
         $this->markTestSkipped("This test needs the exif extension.");
     }
     $this->setMwGlobals('wgShowEXIF', true);
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:9,代码来源:ExifTest.php


示例5: setUp

 public function setUp()
 {
     global $wgShowEXIF;
     $this->showExif = $wgShowEXIF;
     $wgShowEXIF = true;
     $this->handler = new ExifBitmapHandler();
     if (!wfDl('exif')) {
         $this->markTestSkipped("This test needs the exif extension.");
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:10,代码来源:ExifBitmapTest.php


示例6: setUp

 public function setUp()
 {
     $this->mediaPath = __DIR__ . '/../../data/media/';
     if (!wfDl('exif')) {
         $this->markTestSkipped("This test needs the exif extension.");
     }
     global $wgShowEXIF;
     $this->showExif = $wgShowEXIF;
     $wgShowEXIF = true;
 }
开发者ID:Jobava,项目名称:diacritice-meta-repo,代码行数:10,代码来源:ExifTest.php


示例7: setUp

 public function setUp()
 {
     $this->filePath = dirname(__FILE__) . '/../../data/media/';
     if (!wfDl('exif')) {
         $this->markTestSkipped("This test needs the exif extension.");
     }
     global $wgShowEXIF;
     $this->show = $wgShowEXIF;
     $wgShowEXIF = true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:10,代码来源:JpegTest.php


示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     if (!wfDl('exif')) {
         $this->markTestSkipped("This test needs the exif extension.");
     }
     $filePath = __DIR__ . '/../../data/media';
     $this->backend = new FSFileBackend(array('name' => 'localtesting', 'lockManager' => 'nullLockManager', 'containerPaths' => array('data' => $filePath)));
     $this->repo = new FSRepo(array('name' => 'temp', 'url' => 'http://localhost/thumbtest', 'backend' => $this->backend));
     $this->setMwGlobals('wgShowEXIF', true);
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:11,代码来源:FormatMetadataTest.php


示例9: testTiffMetadataExtraction

 public function testTiffMetadataExtraction()
 {
     if (!wfDl('exif')) {
         $this->markTestIncomplete("This test needs the exif extension.");
     }
     $res = $this->handler->getMetadata(null, $this->filePath . 'test.tiff');
     $expected = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}';
     // Re-unserialize in case there are subtle differences between how versions
     // of php serialize stuff.
     $this->assertEquals(unserialize($expected), unserialize($res));
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:11,代码来源:TiffTest.php


示例10: setUp

 public function setUp()
 {
     if (!wfDl('exif')) {
         $this->markTestSkipped("This test needs the exif extension.");
     }
     $filePath = dirname(__FILE__) . '/../../data/media';
     $this->backend = new FSFileBackend(array('name' => 'localtesting', 'lockManager' => 'nullLockManager', 'containerPaths' => array('data' => $filePath)));
     $this->repo = new FSRepo(array('name' => 'temp', 'url' => 'http://localhost/thumbtest', 'backend' => $this->backend));
     global $wgShowEXIF;
     $this->show = $wgShowEXIF;
     $wgShowEXIF = true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:12,代码来源:FormatMetadataTest.php


示例11: testUnicodeUserComment

 public function testUnicodeUserComment()
 {
     if (!wfDl('exif')) {
         $this->markTestIncomplete("This test needs the exif extension.");
     }
     $filename = $this->mediaPath . 'exif-user-comment.jpg';
     $seg = JpegMetadataExtractor::segmentSplitter($filename);
     $exif = new Exif($filename, $seg['byteOrder']);
     $data = $exif->getFilteredData();
     $expected = array('UserComment' => 'test⁔comment');
     $this->assertEquals($expected, $data);
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:12,代码来源:ExifTest.php


示例12: setUp

 function setUp()
 {
     parent::setUp();
     $this->filePath = dirname(__FILE__) . '/../../data/media/';
     $this->handler = new BitmapHandler();
     $this->repo = new FSRepo(array('name' => 'temp', 'directory' => wfTempDir() . '/exif-test-' . time() . '-' . mt_rand(), 'url' => 'http://localhost/thumbtest'));
     if (!wfDl('exif')) {
         $this->markTestSkipped("This test needs the exif extension.");
     }
     global $wgShowEXIF;
     $this->show = $wgShowEXIF;
     $wgShowEXIF = true;
     global $wgEnableAutoRotation;
     $this->oldAuto = $wgEnableAutoRotation;
     $wgEnableAutoRotation = true;
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:16,代码来源:ExifRotationTest.php


示例13: setUp

 function setUp()
 {
     parent::setUp();
     $this->handler = new BitmapHandler();
     $filePath = __DIR__ . '/../../data/media';
     $tmpDir = $this->getNewTempDirectory();
     $this->repo = new FSRepo(array('name' => 'temp', 'url' => 'http://localhost/thumbtest', 'backend' => new FSFileBackend(array('name' => 'localtesting', 'lockManager' => 'nullLockManager', 'containerPaths' => array('temp-thumb' => $tmpDir, 'data' => $filePath)))));
     if (!wfDl('exif')) {
         $this->markTestSkipped("This test needs the exif extension.");
     }
     global $wgShowEXIF;
     $this->show = $wgShowEXIF;
     $wgShowEXIF = true;
     global $wgEnableAutoRotation;
     $this->oldAuto = $wgEnableAutoRotation;
     $wgEnableAutoRotation = true;
 }
开发者ID:Jobava,项目名称:diacritice-meta-repo,代码行数:17,代码来源:ExifRotationTest.php


示例14: initDiffEngines

 /**
  * Make sure the proper modules are loaded before we try to
  * make the diff
  */
 private function initDiffEngines()
 {
     global $wgExternalDiffEngine;
     if ($wgExternalDiffEngine == 'wikidiff' && !function_exists('wikidiff_do_diff')) {
         wfProfileIn(__METHOD__ . '-php_wikidiff.so');
         wfDl('php_wikidiff');
         wfProfileOut(__METHOD__ . '-php_wikidiff.so');
     } elseif ($wgExternalDiffEngine == 'wikidiff2' && !function_exists('wikidiff2_do_diff')) {
         wfProfileIn(__METHOD__ . '-php_wikidiff2.so');
         wfDl('wikidiff2');
         wfProfileOut(__METHOD__ . '-php_wikidiff2.so');
     }
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:17,代码来源:DifferenceEngine.php


示例15: __construct

 /** Initializes the MimeMagic object. This is called by MimeMagic::singleton().
  *
  * This constructor parses the mime.types and mime.info files and build internal mappings.
  */
 function __construct()
 {
     /**
      *   --- load mime.types ---
      */
     global $wgMimeTypeFile, $IP, $wgLoadFileinfoExtension;
     $types = MM_WELL_KNOWN_MIME_TYPES;
     if ($wgMimeTypeFile == 'includes/mime.types') {
         $wgMimeTypeFile = "{$IP}/{$wgMimeTypeFile}";
     }
     if ($wgLoadFileinfoExtension && !self::$extensionLoaded) {
         self::$extensionLoaded = true;
         wfDl('fileinfo');
     }
     if ($wgMimeTypeFile) {
         if (is_file($wgMimeTypeFile) and is_readable($wgMimeTypeFile)) {
             wfDebug(__METHOD__ . ": loading mime types from {$wgMimeTypeFile}\n");
             $types .= "\n";
             $types .= file_get_contents($wgMimeTypeFile);
         } else {
             wfDebug(__METHOD__ . ": can't load mime types from {$wgMimeTypeFile}\n");
         }
     } else {
         wfDebug(__METHOD__ . ": no mime types file defined, using build-ins only.\n");
     }
     $types = str_replace(array("\r\n", "\n\r", "\n\n", "\r\r", "\r"), "\n", $types);
     $types = str_replace("\t", " ", $types);
     $this->mMimeToExt = array();
     $this->mToMime = array();
     $lines = explode("\n", $types);
     foreach ($lines as $s) {
         $s = trim($s);
         if (empty($s)) {
             continue;
         }
         if (strpos($s, '#') === 0) {
             continue;
         }
         $s = strtolower($s);
         $i = strpos($s, ' ');
         if ($i === false) {
             continue;
         }
         $mime = substr($s, 0, $i);
         $ext = trim(substr($s, $i + 1));
         if (empty($ext)) {
             continue;
         }
         if (!empty($this->mMimeToExt[$mime])) {
             $this->mMimeToExt[$mime] .= ' ' . $ext;
         } else {
             $this->mMimeToExt[$mime] = $ext;
         }
         $extensions = explode(' ', $ext);
         foreach ($extensions as $e) {
             $e = trim($e);
             if (empty($e)) {
                 continue;
             }
             if (!empty($this->mExtToMime[$e])) {
                 $this->mExtToMime[$e] .= ' ' . $mime;
             } else {
                 $this->mExtToMime[$e] = $mime;
             }
         }
     }
     /**
      *   --- load mime.info ---
      */
     global $wgMimeInfoFile;
     if ($wgMimeInfoFile == 'includes/mime.info') {
         $wgMimeInfoFile = "{$IP}/{$wgMimeInfoFile}";
     }
     $info = MM_WELL_KNOWN_MIME_INFO;
     if ($wgMimeInfoFile) {
         if (is_file($wgMimeInfoFile) and is_readable($wgMimeInfoFile)) {
             wfDebug(__METHOD__ . ": loading mime info from {$wgMimeInfoFile}\n");
             $info .= "\n";
             $info .= file_get_contents($wgMimeInfoFile);
         } else {
             wfDebug(__METHOD__ . ": can't load mime info from {$wgMimeInfoFile}\n");
         }
     } else {
         wfDebug(__METHOD__ . ": no mime info file defined, using build-ins only.\n");
     }
     $info = str_replace(array("\r\n", "\n\r", "\n\n", "\r\r", "\r"), "\n", $info);
     $info = str_replace("\t", " ", $info);
     $this->mMimeTypeAliases = array();
     $this->mMediaTypes = array();
     $lines = explode("\n", $info);
     foreach ($lines as $s) {
         $s = trim($s);
         if (empty($s)) {
             continue;
         }
         if (strpos($s, '#') === 0) {
//.........这里部分代码省略.........
开发者ID:nischayn22,项目名称:mediawiki-core,代码行数:101,代码来源:MimeMagic.php


示例16: checkExtension

 /**
  * Convenience function.
  * Check if a named extension is present.
  *
  * @see wfDl
  * @param $name
  * @return bool
  */
 protected static function checkExtension($name)
 {
     wfSuppressWarnings();
     $compiled = wfDl($name);
     wfRestoreWarnings();
     return $compiled;
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:15,代码来源:DatabaseInstaller.php


示例17: open

 /**
  * Opens a database connection and returns it
  * Closes any existing connection
  *
  * @param $server String: hostname
  * @param $user String
  * @param $password String
  * @param $dbName String: database name
  * @throws DBConnectionError
  * @return DatabaseBase a fresh connection
  */
 public function open($server, $user, $password, $dbName)
 {
     wfProfileIn(__METHOD__);
     # Load IBM DB2 driver if missing
     wfDl('ibm_db2');
     # Test for IBM DB2 support, to avoid suppressed fatal error
     if (!function_exists('db2_connect')) {
         throw new DBConnectionError($this, "DB2 functions missing, have you enabled the ibm_db2 extension for PHP?");
     }
     global $wgDBport;
     // Close existing connection
     $this->close();
     // Cache conn info
     $this->mServer = $server;
     $this->mPort = $port = $wgDBport;
     $this->mUser = $user;
     $this->mPassword = $password;
     $this->mDBname = $dbName;
     $this->openUncataloged($dbName, $user, $password, $server, $port);
     if (!$this->mConn) {
         $this->installPrint("DB connection error\n");
         $this->installPrint("Server: {$server}, Database: {$dbName}, User: {$user}, Password: " . substr($password, 0, 3) . "...\n");
         $this->installPrint($this->lastError() . "\n");
         wfProfileOut(__METHOD__);
         wfDebug("DB connection error\n");
         wfDebug("Server: {$server}, Database: {$dbName}, User: {$user}, Password: " . substr($password, 0, 3) . "...\n");
         wfDebug($this->lastError() . "\n");
         throw new DBConnectionError($this, $this->lastError());
     }
     // Some MediaWiki code is still transaction-less (?).
     // The strategy is to keep AutoCommit on for that code
     //  but switch it off whenever a transaction is begun.
     db2_autocommit($this->mConn, DB2_AUTOCOMMIT_ON);
     $this->mOpened = true;
     $this->applySchema();
     wfProfileOut(__METHOD__);
     return $this->mConn;
 }
开发者ID:nischayn22,项目名称:mediawiki-core,代码行数:49,代码来源:DatabaseIbm_db2.php


示例18: testPNGXMP

 public function testPNGXMP()
 {
     if (!wfDl('xml')) {
         $this->markTestSkipped("This test needs the xml extension.");
     }
     $handler = new BitmapMetadataHandler();
     $result = $handler->png($this->filePath . 'xmp.png');
     $expected = array('frameCount' => 0, 'loopCount' => 1, 'duration' => 0, 'bitDepth' => 1, 'colorType' => 'index-coloured', 'metadata' => array('SerialNumber' => '123456789', '_MW_PNG_VERSION' => 1));
     $this->assertEquals($expected, $result);
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:10,代码来源:BitmapMetadataHandlerTest.php


示例19: open

 function open($server, $user, $password, $dbName)
 {
     global $wgAllDBsAreLocalhost;
     wfProfileIn(__METHOD__);
     # Load mysql.so if we don't have it
     wfDl('mysql');
     # Fail now
     # Otherwise we get a suppressed fatal error, which is very hard to track down
     if (!function_exists('mysql_connect')) {
         throw new DBConnectionError($this, "MySQL functions missing, have you compiled PHP with the --with-mysql option?\n");
     }
     # Debugging hack -- fake cluster
     if ($wgAllDBsAreLocalhost) {
         $realServer = 'localhost';
     } else {
         $realServer = $server;
     }
     $this->close();
     $this->mServer = $server;
     $this->mUser = $user;
     $this->mPassword = $password;
     $this->mDBname = $dbName;
     wfProfileIn("dbconnect-{$server}");
     # The kernel's default SYN retransmission period is far too slow for us,
     # so we use a short timeout plus a manual retry. Retrying means that a small
     # but finite rate of SYN packet loss won't cause user-visible errors.
     $this->mConn = false;
     if (ini_get('mysql.connect_timeout') <= 3) {
         $numAttempts = 2;
     } else {
         $numAttempts = 1;
     }
     $this->installErrorHandler();
     for ($i = 0; $i < $numAttempts && !$this->mConn; $i++) {
         if ($i > 1) {
             usleep(1000);
         }
         if ($this->mFlags & DBO_PERSISTENT) {
             $this->mConn = mysql_pconnect($realServer, $user, $password);
         } else {
             # Create a new connection...
             $this->mConn = mysql_connect($realServer, $user, $password, true);
         }
         #if ( $this->mConn === false ) {
         #$iplus = $i + 1;
         #wfLogDBError("Connect loop error $iplus of $max ($server): " . mysql_errno() . " - " . mysql_error()."\n");
         #}
     }
     $phpError = $this->restoreErrorHandler();
     # Always log connection errors
     if (!$this->mConn) {
         $error = $this->lastError();
         if (!$error) {
             $error = $phpError;
         }
         wfLogDBError("Error connecting to {$this->mServer}: {$error}\n");
         wfDebug("DB connection error\n");
         wfDebug("Server: {$server}, User: {$user}, Password: " . substr($password, 0, 3) . "..., error: " . mysql_error() . "\n");
     }
     wfProfileOut("dbconnect-{$server}");
     if ($dbName != '' && $this->mConn !== false) {
         wfSuppressWarnings();
         $success = mysql_select_db($dbName, $this->mConn);
         wfRestoreWarnings();
         if (!$success) {
             $error = "Error selecting database {$dbName} on server {$this->mServer} " . "from client host " . wfHostname() . "\n";
             wfLogDBError(" Error selecting database {$dbName} on server {$this->mServer} \n");
             wfDebug($error);
         }
     } else {
         # Delay USE query
         $success = (bool) $this->mConn;
     }
     if ($success) {
         $version = $this->getServerVersion();
         if (version_compare($version, '4.1') >= 0) {
             // Tell the server we're communicating with it in UTF-8.
             // This may engage various charset conversions.
             global $wgDBmysql5;
             if ($wgDBmysql5) {
                 $this->query('SET NAMES utf8', __METHOD__);
             } else {
                 $this->query('SET NAMES binary', __METHOD__);
             }
             // Set SQL mode, default is turning them all off, can be overridden or skipped with null
             global $wgSQLMode;
             if (is_string($wgSQLMode)) {
                 $mode = $this->addQuotes($wgSQLMode);
                 $this->query("SET sql_mode = {$mode}", __METHOD__);
             }
         }
         // Turn off strict mode if it is on
     } else {
         $this->reportConnectionError($phpError);
     }
     $this->mOpened = $success;
     wfProfileOut(__METHOD__);
     return $success;
 }
开发者ID:namrenni,项目名称:mediawiki,代码行数:99,代码来源:DatabaseMysql.php


示例20: wfDl

image/tiff [BITMAP]
image/vnd.djvu [BITMAP]
image/x-xcf [BITMAP]
image/x-portable-pixmap [BITMAP]
text/plain [TEXT]
text/html [TEXT]
video/ogg [VIDEO]
video/mpeg [VIDEO]
unknown/unknown application/octet-stream application/x-empty [UNKNOWN]
END_STRING
);
#note: because this file is possibly included by a function,
#we need to access the global scope explicitely!
global $wgLoadFileinfoExtension;
if ($wgLoadFileinfoExtension) {
    wfDl('fileinfo');
}
/**
 * Implements functions related to mime types such as detection and mapping to
 * file extension.
 *
 * Instances of this class are stateles, there only needs to be one global instance
 * of MimeMagic. Please use MimeMagic::singleton() to get that instance.
 */
class MimeMagic
{
    /**
     * Mapping of media types to arrays of mime types.
     * This is used by findMediaType and getMediaType, respectively
     */
    var $mMediaTypes = null;
开发者ID:GodelDesign,项目名称:Godel,代码行数:31,代码来源:MimeMagic.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP wfDoUpdates函数代码示例发布时间:2022-05-23
下一篇:
PHP wfDie函数代码示例发布时间: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