Lines Matching defs:path

744      * Enable path canonicalization
753 * Disable path canonicalization
755 * If this is enabled then $sftp->pwd() will not return the canonicalized absolute path
821 * the absolute (canonicalized) path.
823 * If canonicalize_paths has been disabled using disablePathCanonicalization(), $path is returned as-is.
827 * @param string $path
831 public function realpath($path)
841 if (!strlen($path) || $path[0] != '/') {
842 $path = $this->pwd . '/' . $path;
844 $parts = explode('/', $path);
868 $this->send_sftp_packet(NET_SFTP_REALPATH, Strings::packSSH2('s', $path));
887 if (!strlen($path) || $path[0] != '/') {
888 $path = $this->pwd . '/' . $path;
891 $path = explode('/', $path);
893 foreach ($path as $dir) {
1281 * @param string $path
1284 private function update_stat_cache($path, $value)
1290 // preg_replace('#^/|/(?=/)|/$#', '', $dir) == str_replace('//', '/', trim($path, '/'))
1291 $dirs = explode('/', preg_replace('#^/|/(?=/)|/$#', '', $path));
1324 * @param string $path
1327 private function remove_from_stat_cache($path)
1329 $dirs = explode('/', preg_replace('#^/|/(?=/)|/$#', '', $path));
1349 * Checks cache for path
1353 * @param string $path
1356 private function query_stat_cache($path)
1358 $dirs = explode('/', preg_replace('#^/|/(?=/)|/$#', '', $path));
1775 * @param string $path
1780 private function setstat_recursive($path, $attr, &$i)
1786 $entries = $this->readlist($path, true);
1789 return $this->setstat($path, $attr, false);
1804 $temp = $path . '/' . $filename;
1827 $packet = Strings::packSSH2('s', $path);
2512 * @param string $path
2517 public function delete($path, $recursive = true)
2523 if (is_object($path)) {
2525 $path = (string) $path;
2528 if (!is_string($path) || $path == '') {
2532 $path = $this->realpath($path);
2533 if ($path === false) {
2538 $this->send_sftp_packet(NET_SFTP_REMOVE, pack('Na*', strlen($path), $path));
2555 $result = $this->delete_recursive($path, $i);
2560 $this->remove_from_stat_cache($path);
2570 * @param string $path
2574 private function delete_recursive($path, &$i)
2580 $entries = $this->readlist($path, true);
2599 $temp = $path . '/' . $filename;
2619 $this->send_sftp_packet(NET_SFTP_RMDIR, Strings::packSSH2('s', $path));
2620 $this->remove_from_stat_cache($path);
2637 * @param string $path
2640 public function file_exists($path)
2647 $path = $this->realpath($path);
2649 $result = $this->query_stat_cache($path);
2657 return $this->stat($path) !== false;
2663 * @param string $path
2666 public function is_dir($path)
2668 $result = $this->get_stat_cache_prop($path, 'type');
2678 * @param string $path
2681 public function is_file($path)
2683 $result = $this->get_stat_cache_prop($path, 'type');
2693 * @param string $path
2696 public function is_link($path)
2698 $result = $this->get_lstat_cache_prop($path, 'type');
2708 * @param string $path
2711 public function is_readable($path)
2717 $packet = Strings::packSSH2('sNN', $this->realpath($path), NET_SFTP_OPEN_READ, 0);
2735 * @param string $path
2738 public function is_writable($path)
2744 $packet = Strings::packSSH2('sNN', $this->realpath($path), NET_SFTP_OPEN_WRITE, 0);
2764 * @param string $path
2767 public function is_writeable($path)
2769 return $this->is_writable($path);
2775 * @param string $path
2778 public function fileatime($path)
2780 return $this->get_stat_cache_prop($path, 'atime');
2786 * @param string $path
2789 public function filemtime($path)
2791 return $this->get_stat_cache_prop($path, 'mtime');
2797 * @param string $path
2800 public function fileperms($path)
2802 return $this->get_stat_cache_prop($path, 'mode');
2808 * @param string $path
2811 public function fileowner($path)
2813 return $this->get_stat_cache_prop($path, 'uid');
2819 * @param string $path
2822 public function filegroup($path)
2824 return $this->get_stat_cache_prop($path, 'gid');
2849 * @param string $path
2853 public function filesize($path, $recursive = false)
2855 return !$recursive || $this->filetype($path) != 'dir' ?
2856 $this->get_stat_cache_prop($path, 'size') :
2857 self::recursiveFilesize($this->rawlist($path, true));
2863 * @param string $path
2866 public function filetype($path)
2868 $type = $this->get_stat_cache_prop($path, 'type');
2896 * @param string $path
2900 private function get_stat_cache_prop($path, $prop)
2902 return $this->get_xstat_cache_prop($path, $prop, 'stat');
2910 * @param string $path
2914 private function get_lstat_cache_prop($path, $prop)
2916 return $this->get_xstat_cache_prop($path, $prop, 'lstat');
2924 * @param string $path
2929 private function get_xstat_cache_prop($path, $prop, $type)
2936 $path = $this->realpath($path);
2938 $result = $this->query_stat_cache($path);
2945 $result = $this->$type($path);