Author: kn Date: Tue Dec 4 13:07:48 2007 New Revision: 6913 Log: - Use ezcBaseFeatures
Modified: trunk/Webdav/src/backends/file.php trunk/Webdav/tests/backend_file_test.php Modified: trunk/Webdav/src/backends/file.php ============================================================================== --- trunk/Webdav/src/backends/file.php [iso-8859-1] (original) +++ trunk/Webdav/src/backends/file.php [iso-8859-1] Tue Dec 4 13:07:48 2007 @@ -209,7 +209,7 @@ protected function getMimeType( $resource ) { // Check if extension pecl/fileinfo is usable. - if ( $this->options->useMimeExts && function_exists( 'finfo_file' ) ) + if ( $this->options->useMimeExts && ezcBaseFeatures::hasExtensionSupport( 'fileinfo' ) ) { $fInfo = new fInfo( FILEINFO_MIME ); $mimeType = $fInfo->file( $this->root . $resource ); @@ -222,7 +222,7 @@ } // Check if extension ext/mime-magic is usable. - if ( $this->options->useMimeExts && function_exists( 'mime_content_type' ) ) + if ( $this->options->useMimeExts && ezcBaseFeatures::hasExtensionSupport( 'mime_magic' ) ) { return mime_content_type( $this->root . $resource ); } Modified: trunk/Webdav/tests/backend_file_test.php ============================================================================== --- trunk/Webdav/tests/backend_file_test.php [iso-8859-1] (original) +++ trunk/Webdav/tests/backend_file_test.php [iso-8859-1] Tue Dec 4 13:07:48 2007 @@ -1304,8 +1304,8 @@ public function testPropMimeTypeOnResourceNoExt() { - if ( function_exists( 'finfo_file' ) || - function_exists( 'mime_content_type' ) ) + if ( ezcBaseFeatures::hasExtensionSupport( 'fileinfo' ) || + ezcBaseFeatures::hasExtensionSupport( 'mime_magic' ) ) { $this->markTestSkipped( 'Test is run only, when no mime type detection is available.' ); } @@ -1359,8 +1359,8 @@ public function testPropMimeTypeOnResourceMimeMagicExt() { - if ( function_exists( 'finfo_file' ) || - !function_exists( 'mime_content_type' ) ) + if ( ezcBaseFeatures::hasExtensionSupport( 'fileinfo' ) || + !ezcBaseFeatures::hasExtensionSupport( 'mime_magic' ) ) { $this->markTestSkipped( 'Test is run only, when only mime magic extenstion is available.' ); } @@ -1414,7 +1414,7 @@ public function testPropMimeTypeOnResourcePeclFileInfo() { - if ( !function_exists( 'finfo_file' ) ) + if ( !ezcBaseFeatures::hasExtensionSupport( 'fileinfo' ) ) { $this->markTestSkipped( 'Test is run only, when pecl/fileinfo extenstion is available.' ); } -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components