/**
* @access public
*
* @param string $file
* @return bool
*/
public function exists($file) {
//return file_exists( $this->sftp_path( $file ) );
if(version_compare(PHP_VERSION,'7.0.0','ge')){
$stat = @ssh2_sftp_stat( $this->sftp_link, $file );
if ( false === $stat ) {
return false;
}
return (true);
}else{
return file_exists( $this->sftp_path( $file ) );
}
}
/**
* @access public
*
* @param string $file
* @return bool
*/
public function is_file($file) {
//return is_file( $this->sftp_path( $file ) );
if(version_compare(PHP_VERSION,'7.0.0','ge')){
$stat = @ssh2_sftp_stat( $this->sftp_link, $file );
if( false === $stat ){
return false;
}
$mode = $stat['mode'];
$type = $mode & 0xf000;
return ($type == 0x8000);
}else{
return is_file( $this->sftp_path( $file ) );
}
}
/**
* @access public
*
* @param string $path
* @return bool
*/
public function is_dir($path) {
//return is_dir( $this->sftp_path( $path ) );
if(version_compare(PHP_VERSION,'7.0.0','ge')){
$stat = @ssh2_sftp_stat( $this->sftp_link, $path );
if ( false === $stat ) {
return false;
}
$mode = $stat['mode'];
$type = $mode & 0xf000;
return ($type == 0x4000);
}else{
return is_dir( $this->sftp_path( $path ) );
}
}
/**
* @access public
*
* @param string $file
* @return bool
*/
public function is_readable($file) {
//return is_readable( $this->sftp_path( $file ) );
if(version_compare(PHP_VERSION,'7.0.0','ge')){
$stat = @ssh2_sftp_stat( $this->sftp_link, $file );
if ( false === $stat ) {
return false;
}
$mode = $stat['mode'];
return ($mode & 0x0004);
}else{
return is_readable( $this->sftp_path( $file ) );
}
}
/**
* @access public
*
* @param string $file
* @return int
*/
public function atime($file) {
//return fileatime( $this->sftp_path( $file ) );
if(version_compare(PHP_VERSION,'7.0.0','ge')){
$stat = @ssh2_sftp_stat( $this->sftp_link, $file );
if ( false === $stat ) {
return false;
}
return $stat['atime'];
}else{
return fileatime( $this->sftp_path( $file ) );
}
}
/**
* @access public
*
* @param string $file
* @return int
*/
public function mtime($file) {
//return filemtime( $this->sftp_path( $file ) );
if(version_compare(PHP_VERSION,'7.0.0','ge')){
$stat = @ssh2_sftp_stat( $this->sftp_link, $file );
if ( false === $stat ) {
return false;
}
return $stat['mtime'];
}else{
return filemtime( $this->sftp_path( $file ) );
}
}
/**
* @access public
*
* @param string $file
* @return int
*/
public function size($file) {
//return filesize( $this->sftp_path( $file ) );
if(version_compare(PHP_VERSION,'7.0.0','ge')){
$stat = @ssh2_sftp_stat( $this->sftp_link, $file );
if ( false === $stat ) {
return false;
}
return $stat['size'];
}else{
return filesize( $this->sftp_path( $file ) );
}
}