wp/wp-admin/includes/class-wp-filesystem-base.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
   127 	 * @see WP_Filesystem_Base::wp_content_dir()
   127 	 * @see WP_Filesystem_Base::wp_content_dir()
   128 	 * @see WP_Filesystem_Base::wp_plugins_dir()
   128 	 * @see WP_Filesystem_Base::wp_plugins_dir()
   129 	 * @see WP_Filesystem_Base::wp_themes_dir()
   129 	 * @see WP_Filesystem_Base::wp_themes_dir()
   130 	 * @see WP_Filesystem_Base::wp_lang_dir()
   130 	 * @see WP_Filesystem_Base::wp_lang_dir()
   131 	 *
   131 	 *
   132 	 * @param string $base The folder to start searching from.
   132 	 * @param string $base    Optional. The folder to start searching from. Default '.'.
   133 	 * @param bool   $echo True to display debug information.
   133 	 * @param bool   $verbose Optional. True to display debug information. Default false.
   134 	 *                     Default false.
       
   135 	 * @return string The location of the remote path.
   134 	 * @return string The location of the remote path.
   136 	 */
   135 	 */
   137 	public function find_base_dir( $base = '.', $echo = false ) {
   136 	public function find_base_dir( $base = '.', $verbose = false ) {
   138 		_deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir()' );
   137 		_deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir()' );
   139 		$this->verbose = $echo;
   138 		$this->verbose = $verbose;
   140 		return $this->abspath();
   139 		return $this->abspath();
   141 	}
   140 	}
   142 
   141 
   143 	/**
   142 	/**
   144 	 * Locates a folder on the remote filesystem.
   143 	 * Locates a folder on the remote filesystem.
   149 	 * @see WP_Filesystem_Base::wp_content_dir()
   148 	 * @see WP_Filesystem_Base::wp_content_dir()
   150 	 * @see WP_Filesystem_Base::wp_plugins_dir()
   149 	 * @see WP_Filesystem_Base::wp_plugins_dir()
   151 	 * @see WP_Filesystem_Base::wp_themes_dir()
   150 	 * @see WP_Filesystem_Base::wp_themes_dir()
   152 	 * @see WP_Filesystem_Base::wp_lang_dir()
   151 	 * @see WP_Filesystem_Base::wp_lang_dir()
   153 	 *
   152 	 *
   154 	 * @param string $base The folder to start searching from.
   153 	 * @param string $base    Optional. The folder to start searching from. Default '.'.
   155 	 * @param bool   $echo True to display debug information.
   154 	 * @param bool   $verbose Optional. True to display debug information. Default false.
   156 	 * @return string The location of the remote path.
   155 	 * @return string The location of the remote path.
   157 	 */
   156 	 */
   158 	public function get_base_dir( $base = '.', $echo = false ) {
   157 	public function get_base_dir( $base = '.', $verbose = false ) {
   159 		_deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir()' );
   158 		_deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir()' );
   160 		$this->verbose = $echo;
   159 		$this->verbose = $verbose;
   161 		return $this->abspath();
   160 		return $this->abspath();
   162 	}
   161 	}
   163 
   162 
   164 	/**
   163 	/**
   165 	 * Locates a folder on the remote filesystem.
   164 	 * Locates a folder on the remote filesystem.
   405 	 *
   404 	 *
   406 	 * @link https://www.php.net/manual/en/function.chmod.php#49614
   405 	 * @link https://www.php.net/manual/en/function.chmod.php#49614
   407 	 *
   406 	 *
   408 	 * @since 2.5.0
   407 	 * @since 2.5.0
   409 	 *
   408 	 *
   410 	 * @param string $mode string The *nix-style file permission.
   409 	 * @param string $mode string The *nix-style file permissions.
   411 	 * @return int octal representation
   410 	 * @return string Octal representation of permissions.
   412 	 */
   411 	 */
   413 	public function getnumchmodfromh( $mode ) {
   412 	public function getnumchmodfromh( $mode ) {
   414 		$realmode = '';
   413 		$realmode = '';
   415 		$legal    = array( '', 'w', 'r', 'x', '-' );
   414 		$legal    = array( '', 'w', 'r', 'x', '-' );
   416 		$attarray = preg_split( '//', $mode );
   415 		$attarray = preg_split( '//', $mode );
   829 	 * @return array|false {
   828 	 * @return array|false {
   830 	 *     Array of files. False if unable to list directory contents.
   829 	 *     Array of files. False if unable to list directory contents.
   831 	 *
   830 	 *
   832 	 *     @type string $name        Name of the file or directory.
   831 	 *     @type string $name        Name of the file or directory.
   833 	 *     @type string $perms       *nix representation of permissions.
   832 	 *     @type string $perms       *nix representation of permissions.
   834 	 *     @type int    $permsn      Octal representation of permissions.
   833 	 *     @type string $permsn      Octal representation of permissions.
   835 	 *     @type string $owner       Owner name or ID.
   834 	 *     @type string $owner       Owner name or ID.
   836 	 *     @type int    $size        Size of file in bytes.
   835 	 *     @type int    $size        Size of file in bytes.
   837 	 *     @type int    $lastmodunix Last modified unix timestamp.
   836 	 *     @type int    $lastmodunix Last modified unix timestamp.
   838 	 *     @type mixed  $lastmod     Last modified month (3 letter) and day (without leading 0).
   837 	 *     @type mixed  $lastmod     Last modified month (3 letter) and day (without leading 0).
   839 	 *     @type int    $time        Last modified time.
   838 	 *     @type int    $time        Last modified time.
   840 	 *     @type string $type        Type of resource. 'f' for file, 'd' for directory.
   839 	 *     @type string $type        Type of resource. 'f' for file, 'd' for directory.
   841 	 *     @type mixed  $files       If a directory and $recursive is true, contains another array of files.
   840 	 *     @type mixed  $files       If a directory and `$recursive` is true, contains another array of files.
   842 	 * }
   841 	 * }
   843 	 */
   842 	 */
   844 	public function dirlist( $path, $include_hidden = true, $recursive = false ) {
   843 	public function dirlist( $path, $include_hidden = true, $recursive = false ) {
   845 		return false;
   844 		return false;
   846 	}
   845 	}