芝麻web文件管理V1.00
编辑当前文件:/home/dcqnetm/icbs-recup/wp-content/plugins/cookie-law-info/lite/includes/class-filesystem.php
is_ssl() ) { $wp_info['baseurl'] = str_ireplace( 'http://', 'https://', $wp_info['baseurl'] ); } // Build the paths. $dir_info = array( 'path' => $wp_info['basedir'] . '/' . $assets_dir . '/', 'url' => $wp_info['baseurl'] . '/' . $assets_dir . '/', ); return apply_filters( 'cli__get_assets_uploads_dir', $dir_info ); } /** * Delete file from the filesystem. * * @since 3.0.0 * @param String $file Path to the file or directory. * @param boolean $recursive If set to true, changes file group recursively. * @param boolean $type Type of resource. 'f' for file, 'd' for directory. * @return void */ public function delete( $file, $recursive = false, $type = false ) { $this->get_filesystem()->delete( $file, $recursive, $type ); } /** * Adds contents to the file. * * @param string $file_path Gets the assets path info. * @param string $style_data Gets the CSS data. * @since 3.0.0 * @return bool $put_content returns false if file write is not successful. */ public function put_contents( $file_path, $style_data ) { return $this->get_filesystem()->put_contents( $file_path, $style_data ); } /** * Get contents of the file. * * @param string $file_path Gets the assets path info. * @since 3.0.0 * @return bool $get_contents Gets te file contents. */ public function get_contents( $file_path ) { $file_system = $this->get_filesystem(); if ( isset( $file_system ) && ! isset( $file_system->errors ) ) { $file_path = str_replace( ABSPATH, $this->abspath(), $file_path ); if ( $this->get_filesystem()->exists( $file_path ) && $this->get_filesystem()->is_readable( $file_path ) ) { return $this->get_filesystem()->get_contents( $file_path ); } } else { if ( file_exists( $file_path ) && is_file( $file_path ) ) { return @file_get_contents( $file_path ); } } return false; } /** * Return absolute file path * * @since 3.0.0 * @return string */ public function abspath() { $file_system = $this->get_filesystem(); if ( $file_system->errors ) { return ABSPATH; } return $file_system->abspath(); } }