/** * Return a list of all files in the CVS repository * * This function is like {@link parent::dirList()} except * that instead of retrieving a regular filelist, it first * retrieves a listing of all the CVS/Entries files in * $directory and all of the subdirectories. Then, it * reads the Entries file, and creates a listing of files * that are a part of the CVS repository. No check is * made to see if they have been modified, but newly * added or removed files are ignored. * * @param string $directory full path to the directory you want the list of * * @return array list of files in a directory * @uses _recurDirList() * @uses _readCVSEntries() */ function dirList($directory) { static $in_recursion = false; if ($in_recursion) { return parent::dirList($directory); } // include only CVS/Entries files $this->_setupIgnore(array('*/CVS/Entries'), 0); $this->_setupIgnore(array(), 1); $in_recursion = true; $entries = parent::dirList($directory); $in_recursion = false; if (!$entries || !is_array($entries)) { $code = PEAR_PACKAGEFILEMANAGER_PLUGINS_NOCVSENTRIES; return parent::raiseError($code, $directory); } return $this->_readCVSEntries($entries); }
/** * Build a list of files based on the output of the 'p4 have' command. * * @param string $directory The directory in which to list the files. * * @return mixed An array of full filenames or a PEAR_Error value if * $directory does not exist. */ function dirList($directory) { /* Return an error if the directory does not exist. */ if (@is_dir($directory) === false) { return parent::raiseError(PEAR_PACKAGEFILEMANAGER_PLUGINS_DIR_DOESNT_EXIST, $directory); } /* List the files below $directory that are under Perforce control. */ exec("p4 have {$directory}/...", $output); /* Strip off everything except the filename from each line of output. */ $files = preg_replace('/^.* \\- /', '', $output); /* If we have a list of files to include, remove all other entries. */ if ($this->ignore[0]) { $files = array_filter($files, array($this, '_includeFilter')); } /* If we have a list of files to ignore, remove them from the array. */ if ($this->ignore[1]) { $files = array_filter($files, array($this, '_ignoreFilter')); } return $files; }
/** * Return a list of all files in the SVN repository * * This function is like {@link parent::dirList()} except * that instead of retrieving a regular filelist, it first * retrieves a listing of all the .svn/entries files in * $directory and all of the subdirectories. Then, it * reads the entries file, and creates a listing of files * that are a part of the Subversion checkout. No check is * made to see if they have been modified, but removed files * are ignored. * * @param string $directory full path to the directory you want the list of * * @access protected * @return array list of files in a directory * @uses _recurDirList() * @uses _readSVNEntries() */ function dirList($directory) { static $in_recursion = false; if ($in_recursion) { return parent::dirList($directory); } // include only .svn/entries files // since subversion keeps its data in a hidden // directory we must force PackageFileManager to // consider hidden directories. $this->_options['addhiddenfiles'] = true; $this->_setupIgnore(array('*/.svn/entries'), 0); $this->_setupIgnore(array(), 1); $in_recursion = true; $entries = parent::dirList($directory); $in_recursion = false; if (!$entries || !is_array($entries)) { $code = PEAR_PACKAGEFILEMANAGER_PLUGINS_NOSVNENTRIES; return parent::raiseError($code, $directory); } return $this->_readSVNEntries($entries); }