svn: /web/doc-editor/trunk/php/ class.php

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Thu, 12 Nov 2009 17:58:30 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=290616

Log:
Remove getAllFiles's method from class.php. This method is present in RepositoryFetcher.php as getFileByKeyword's method AND getFilesByDirectory's method

Changed paths:
    U   web/doc-editor/trunk/php/class.php

Modified: web/doc-editor/trunk/php/class.php
===================================================================
--- web/doc-editor/trunk/php/class.php	2009-11-12 17:54:01 UTC (rev 290615)
+++ web/doc-editor/trunk/php/class.php	2009-11-12 17:58:30 UTC (rev 290616)
@@ -590,75 +590,4 @@

     }

-    /**
-     * Get all files from the local copy.
-     *
-     * @param $node The start folder to retrieve files/folders from.
-     * @param $search The search value.
-     */
-    function getAllFiles($node, $search='') {
-
-        // Get Files Need Commit
-        $ModifiedFiles = $this->getModifiedFiles();
-
-        if( $search == '' ) {
-
-            // Security
-            $node = str_replace('..', '', $node);
-
-            $d = dir(DOC_EDITOR_CVS_PATH.$node);
-
-            $nodes = array();
-            while($f = $d->read()){
-
-                // We display only 'en' and 'LANG' tree
-                if ($node == '/' && $f != 'en' && $f != $this->cvsLang ) {
-                    continue;
-                }
-
-
-                if ($f == '.'  ||
-                $f == '..' ||
-                substr($f, 0, 1)  == '.' || // skip hidden files
-                substr($f, -4)    == '.new' || // skip pendingCommit files
-                substr($f, -6)    == '.patch' || // skip pendingPatch files
-                $f == 'CVS'
-
-                ) continue;
-
-                if (is_dir(DOC_EDITOR_CVS_PATH . $node . '/' . $f)) {
-                    $nodes[] = array('text' => $f, 'id' => $node . '/' . $f, 'cls' => 'folder', 'type' => 'folder');
-                } else {
-
-                    if (isset($ModifiedFiles[substr($node, 2, (strlen($node)-1)).'/'.$f])) {
-                        $cls = 'file modified';
-                    } else {
-                        $cls = 'file';
-                    }
-
-                    // Get extension
-                    $t       = explode('.',$f);
-                    $ext     = $t[count($t)-1];
-                    $nodes[] = array('text'=>$f, 'id'=>$node.'/'.$f, 'leaf'=>true, 'cls'=>$cls, 'extension'=>$ext, 'type'=>'file');
-
-                }
-            }
-            $d->close();
-
-        } else {
-
-            $s = sprintf('SELECT `lang`, `path`, `name` FROM `files` WHERE (`lang`="%s" OR `lang`=\'en\') AND `name` LIKE \'%%%s%%\' ORDER BY `lang`, `path`, `name`', $this->cvsLang, $search);
-            $r = $this->db->query($s) or die($this->db->error.'|'.$s);
-            while ($a = $r->fetch_object()) {
-
-                $t       = explode('.',$a->name);
-                $ext     = $t[count($t)-1];
-                $nodes[] = array('text'=>$a->lang.$a->path.$a->name, 'id'=>'//'.$a->lang.$a->path.$a->name, 'leaf'=>true, 'cls'=>'file', 'extension'=>$ext, 'type'=>'file', 'from'=>'search');
-
-            }
-
-        }
-        return $nodes;
-    }
-
 } // End of class
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.