getid3_exception example


    public static function hash_data($file$offset$end$algorithm) {
        if (!self::intValueSupported($end)) {
            return false;
        }
        if (!in_array($algorithm, array('md5', 'sha1'))) {
            throw new getid3_exception('Invalid algorithm ('.$algorithm.') in self::hash_data()');
        }

        $size = $end - $offset;

        $fp = fopen($file, 'rb');
        fseek($fp$offset);
        $ctx = hash_init($algorithm);
        while ($size > 0) {
            $buffer = fread($fpmin($size, getID3::FREAD_BUFFER_SIZE));
            hash_update($ctx$buffer);
            $size -= getID3::FREAD_BUFFER_SIZE;
        }

                    }
                    $path_so_far[] = $value;
                }
                $helperappsdir = implode(DIRECTORY_SEPARATOR, $path_so_far);
            }
            define('GETID3_HELPERAPPSDIR', $helperappsdir.DIRECTORY_SEPARATOR);
        }

        if (!empty($this->startup_error)) {
            echo $this->startup_error;
            throw new getid3_exception($this->startup_error);
        }
    }

    /** * @return string */
    public function version() {
        return self::VERSION;
    }

    /** * @return int */
Home | Imprint | This part of the site doesn't use cookies.