本文整理汇总了PHP中wfDl函数的典型用法代码示例。如果您正苦于以下问题:PHP wfDl函数的具体用法?PHP wfDl怎么用?PHP wfDl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wfDl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
parent::setUp();
if (!wfDl('xml')) {
$this->markTestSkipped('Requires libxml to do XMP parsing');
}
}
示例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);
}
示例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.");
}
}
示例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);
}
示例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.");
}
}
示例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;
}
示例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;
}
示例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);
}
示例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));
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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');
}
}
示例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) {
//.........这里部分代码省略.........