Beispiel #1
0
    function readAllDirs2($dirName, &$readCtr)
    {
        global $audio_types, $video_types, $word_files_analyzed;
        // Let's up the max_execution_time
        ini_set('max_execution_time', '6000');
        // Let's look at the directory we are in
        if (is_dir($dirName)) {
            $d = dir($dirName);
            if (is_object($d)) {
                while ($entry = $d->read()) {
                    // Let's make sure we are seeing real directories
                    if ($entry == "." || $entry == "..") {
                        continue;
                    }
                    if ($readCtr % 100 == 0) {
                        ?>
							<script language="javascript">
								p.innerHTML = '<b><?php 
                        echo $readCtr . " " . $word_files_analyzed;
                        ?>
</b>';									
								-->
							</SCRIPT>
							<?php 
                        @flush();
                        @ob_flush();
                    }
                    // Now let's see if we are looking at a directory or not
                    if (@filetype($dirName . "/" . $entry) != "file") {
                        // Ok, that was a dir, so let's move to the next directory down
                        readAllDirs2($dirName . "/" . $entry, $readCtr);
                    } else {
                        if (preg_match("/\\.({$audio_types}|{$video_types})\$/i", $entry)) {
                            $readCtr++;
                            $_SESSION['jz_full_counter']++;
                        }
                    }
                }
                // Now let's close the directory
                $d->close();
            }
        }
    }
Beispiel #2
0
                // First let's get a listing of ALL files so we'll be able to estimate how long this will take
                // Was this set from the popup?
                if ($_POST['edit_media_length'] != "") {
                    $len = $_POST['edit_media_length'];
                } else {
                    //echo "<br><strong>". $word_analyzing_import. '</strong>';
                    echo '<div id="filecount"></div>';
                    ?>
							<script language="javascript">
								fc = document.getElementById("filecount");							
								-->
							</SCRIPT>
							<?php 
                    $readCtr = 0;
                    $_SESSION['jz_full_counter'] = 0;
                    readAllDirs2($media_dir, $readCtr);
                    // Now let's see how long we think it will take
                    $len = $_SESSION['jz_full_counter'];
                }
                if ($len == 0) {
                    $len = 1;
                }
                $_SESSION['jz_import_full_ammount'] = $len;
                $_SESSION['jz_import_start_time'] = time();
                $_SESSION['jz_install_timeLeft'] = 0;
                ?>
						<script language="javascript">
							fc.innerHTML = '&nbsp;';									
							-->
						</SCRIPT>
						<?php