PHP Classes

Problem in fetching files

Recommend this page to a friend!

      PHP SVN Client  >  All threads  >  Problem in fetching files  >  (Un) Subscribe thread alerts  
Subject:Problem in fetching files
Summary:Problem in fetching files and listing directory structure
Messages:16
Author:Shekhu
Date:2008-06-26 06:38:48
Update:2010-05-04 13:19:40
 
  1 - 10   11 - 16  

  11. Re: Problem in fetching files   Reply   Report abuse  
Picture of Ondra  Rafaj Ondra Rafaj - 2008-12-16 14:01:20 - In reply to message 10 from Ondra Rafaj
and one last suggestion ... if there will be anything missing in your results ... to to the function getDirectoryFiles in main svn client class and there is "$parser->Parse($body, true);" on the next line place "var_dump($body);" and you'll see the content of the returned XML ... than you can change your configuration file to match the result ...

  12. Re: Problem in fetching files   Reply   Report abuse  
Picture of Cesar D. Rodas Cesar D. Rodas - 2008-12-16 14:21:16 - In reply to message 11 from Ondra Rafaj
Ok, great suggestion...

Right now I am scheduling to rewrite the class, because I am building a project hosting site like github.com or sf.net but using fossil (www.fossil-scm.org) instead of git or other, so I will need an "import" tool.

  13. Re: Problem in fetching files   Reply   Report abuse  
Picture of Ondra  Rafaj Ondra Rafaj - 2008-12-17 10:50:52 - In reply to message 12 from Cesar D. Rodas
the only problem I have that it's not clear if the item in the folder or a file and there is a download file function missing (and maybe download recursively) ... I've made few changes ... I will send them to you ... I want to use this class to be able to fully update new version of my cms (http://www.webgurucms.com/) and if you want to build something like github.com than yes, you need the upload functions as well ... don't know fossil ... but why to use something like that once we have a SVN? :-)

  14. Re: Problem in fetching files   Reply   Report abuse  
Picture of Mikhail Mikhail - 2010-03-12 14:28:26 - In reply to message 9 from Ondra Rafaj
You fixed me :) Thanks! Probably saved me hours or headache

  15. Re: Problem in fetching files   Reply   Report abuse  
Picture of Andy S Andy S - 2010-05-04 10:57:25 - In reply to message 13 from Ondra Rafaj
to implement file type (eg file or directory):

in definitions.php, add this definition:

define("SVN_IS_DIR", "D:collection");


Then in the getDirectoryFiles function in the main class:

1. add the following to the $fileinfo array:
SVN_IS_DIR => "file-type"

2. replace (in the foreach loop):


if ( $last != "") {
$tmp[ $fileinfo[$last] ] = $value;
$last = "";
continue;
}


WITH


if ( $last != "") {
$tmp[ $fileinfo[$last] ] = $value;

if ($last == SVN_IS_DIR) {
$tmp[ $fileinfo[SVN_IS_DIR] ] = 'directory';
}else{
if ( !isset( $tmp[ $fileinfo[SVN_IS_DIR] ] ) )
$tmp[ $fileinfo[SVN_IS_DIR] ] = 'file';
}

$last = "";
continue;
}


This will give you another element "file-type" with content either "directory" or "file".

Hope this helps, and fantastic class!

  16. Re: Problem in fetching files   Reply   Report abuse  
Picture of Mikhail Mikhail - 2010-05-04 13:19:40 - In reply to message 15 from Andy S
Super! I couldn't find the list of web commands. Finally a recursive solution can be implimented! Where did you find the command list?

 
  1 - 10   11 - 16