* Revert revert r39662 of my parser changes.
[lhc/web/wiklou.git] / includes / Exif.php
index ab2e209..bd93eb7 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 /**
- * @addtogroup Metadata
- *
+ * @ingroup Media
  * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
  * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
- * @link http://exif.org/Exif2-2.PDF The Exif 2.2 specification
+ * @see http://exif.org/Exif2-2.PDF The Exif 2.2 specification
  */
 
 /**
  * @todo document (e.g. one-sentence class-overview description)
- * @addtogroup Metadata
+ * @ingroup Media
  */
 class Exif {
        //@{
@@ -93,9 +92,9 @@ class Exif {
        var $basename;
 
        /**
-        * The private log to log to
+        * The private log to log to, e.g. 'exif'
         */
-       var $log = 'exif';
+       var $log = false;
 
        //@}
 
@@ -405,7 +404,7 @@ class Exif {
         *
         * @return int
         */
-       function version() {
+       public static function version() {
                return 1; // We don't need no bloddy constants!
        }
 
@@ -431,7 +430,7 @@ class Exif {
                if ( is_array( $in ) ) {
                        return false;
                }
-               
+
                if ( preg_match( "/[^\x0a\x20-\x7e]/", $in ) ) {
                        $this->debug( $in, __FUNCTION__, 'found a character not in our whitelist' );
                        return false;
@@ -557,11 +556,14 @@ class Exif {
         *
         * @private
         *
-        * @param $in Mixed: 
-        * @param $fname String: 
+        * @param $in Mixed:
+        * @param $fname String:
         * @param $action Mixed: , default NULL.
         */
-        function debug( $in, $fname, $action = NULL ) {
+       function debug( $in, $fname, $action = NULL ) {
+               if ( !$this->log ) {
+                       return;
+               }
                $type = gettype( $in );
                $class = ucfirst( __CLASS__ );
                if ( $type === 'array' )
@@ -586,6 +588,9 @@ class Exif {
         * @param $io Boolean: Specify whether we're beginning or ending
         */
        function debugFile( $fname, $io ) {
+               if ( !$this->log ) {
+                       return;
+               }
                $class = ucfirst( __CLASS__ );
                if ( $io ) {
                        wfDebugLog( $this->log, "$class::$fname: begin processing: '{$this->basename}'\n" );
@@ -598,7 +603,7 @@ class Exif {
 
 /**
  * @todo document (e.g. one-sentence class-overview description)
- * @addtogroup Metadata
+ * @ingroup Media
  */
 class FormatExif {
        /**
@@ -1124,5 +1129,3 @@ define( 'MW_EXIF_RATIONAL', Exif::RATIONAL );
 define( 'MW_EXIF_UNDEFINED', Exif::UNDEFINED );
 define( 'MW_EXIF_SLONG', Exif::SLONG );
 define( 'MW_EXIF_SRATIONAL', Exif::SRATIONAL );
-
-?>