12-06-2011, 05:26 AM
(12-05-2011, 07:12 PM)steinm Wrote:(12-05-2011, 06:47 PM)itsu Wrote: Hi Uwe
I had to input more than 32000.
So I changed getpath() and getDir() in inc.ClassDocument.php like followings.
This support more than 20000*31998 documents.
but supporting lots of document, I also had to change ViewFolder.php.
// function getPath() { return $this->_document->getID() .'/'. $this->_version . $this->_fileType; }
function getPath() { return $this->_document->getDir() .'/'. $this->_version . $this->_fileType; }
function getDir() { /* {{{ */
if($this->_id > 20000){
$dirid = (int)( $this->_id / 20000 ) + 1;
}else{
$dirid = 1;
}
return $dirid."/".$this->_id."/";
} /* }}} */
That is the approach I had in mind as well. Why do you allow only 20000 documents (dirs) per content subdirectory? You don't need the if() statement because '(int)( $this->_id / 20000 ) + 1' returns 1 for id < 20000 anyway.
Uwe
Hi Uwe
I see. I don't need if.
I use this instead. thanks.
I don't have reason to use 20000 you can change it to 31998 or around 30000.
function getDir() { /* {{{ */
$dirid = (int)( $this->_id / 20000 ) + 1;
return $dirid."/".$this->_id."/";
} /* }}} */