示例#1
0
 /**
  * Join dir name and file name and return full path
  *
  * @param  string  $dir
  * @param  string  $name
  * @return string
  * @author Dmitry (dio) Levashov
  **/
 protected function _joinPath($dir, $name)
 {
     $sql = 'SELECT `file_id` FROM ' . $this->tbf . ' WHERE parent_id="' . $dir . '" AND name=' . $this->db->quoteString($name);
     if (($res = $this->query($sql)) && $this->db->getRowsNum($res) > 0) {
         $r = $this->db->fetchRow($res);
         return $r[0];
     }
     return -1;
 }
示例#2
0
	/**
	 * Join dir name and file name and return full path
	 *
	 * @param  string  $dir
	 * @param  string  $name
	 * @return string
	 * @author Dmitry (dio) Levashov
	 **/
	protected function _joinPath($dir, $name) {
		$sql = 'SELECT `file_id` FROM '.$this->tbf.' WHERE parent_id="'.$dir.'" AND name="'.mysql_escape_string($name).'"';
		if (($res = $this->query($sql)) && $this->db->getRowsNum($res) > 0) {
			$r = $this->db->fetchArray($res);
			//$this->updateCache($r['file_id'], $this->_stat($r['file_id']));
			return $r['file_id'];
		}
		return -1;
	}