All Projects → micropackage → filesystem

micropackage / filesystem

Licence: GPL-3.0 License
Wrapper for WordPress' Filesystem for easier file manipulations

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to filesystem

dochooks
WordPress hooks in method comments. Annotated hooks.
Stars: ✭ 33 (+73.68%)
Mutual labels:  composer-library, micropackage, bracketspace
block-loader
Automatic WordPress Gutenberg block loader based on template files
Stars: ✭ 21 (+10.53%)
Mutual labels:  composer-library, micropackage, bracketspace
requirements
Requirements checker for WordPress plugins
Stars: ✭ 37 (+94.74%)
Mutual labels:  composer-library, micropackage
cache
WordPress cache wrapper
Stars: ✭ 13 (-31.58%)
Mutual labels:  composer-library, micropackage
anyfs
Portable file system for Node
Stars: ✭ 17 (-10.53%)
Mutual labels:  filesystem
ranger-zoxide
Easily jump between common directories in ranger
Stars: ✭ 34 (+78.95%)
Mutual labels:  filesystem
findlargedir
find all "blackhole" directories with a huge amount of filesystem entries in a flat structure
Stars: ✭ 15 (-21.05%)
Mutual labels:  filesystem
gof
Yet another simple Go filesystem wrapper
Stars: ✭ 13 (-31.58%)
Mutual labels:  filesystem
mongoose-gridfs
mongoose gridfs on top of new gridfs api
Stars: ✭ 79 (+315.79%)
Mutual labels:  filesystem
FireFiles
Powerful Android File Manager for everything that runs on Android OS (Android TV, Android Watch, Mobile, etc)
Stars: ✭ 37 (+94.74%)
Mutual labels:  filesystem
docteur
An opiniated file-system for MirageOS
Stars: ✭ 16 (-15.79%)
Mutual labels:  filesystem
ksmbd
ksmbd kernel server(SMB/CIFS server)
Stars: ✭ 98 (+415.79%)
Mutual labels:  filesystem
filesystem picker
FileSystem file or folder picker dialog.
Stars: ✭ 44 (+131.58%)
Mutual labels:  filesystem
replace-in-files
Replace text in one or more files or globs.
Stars: ✭ 21 (+10.53%)
Mutual labels:  filesystem
echfs
The echfs filesystem
Stars: ✭ 150 (+689.47%)
Mutual labels:  filesystem
fs-over-http
A filesystem interface over http, with extras and docker support
Stars: ✭ 14 (-26.32%)
Mutual labels:  filesystem
moodle-tool objectfs
Object file storage system for Moodle
Stars: ✭ 61 (+221.05%)
Mutual labels:  filesystem
TLightFileStream
Implements a lightweight, high-performance, non-allocating advanced-record-based wrapper around the SysUtils file handling routines as an alternative to Classes.TFileStream.
Stars: ✭ 21 (+10.53%)
Mutual labels:  filesystem
ext2py
The slowest ext2fs driver ever! (in Python)
Stars: ✭ 14 (-26.32%)
Mutual labels:  filesystem
SharpPhysFS
Managed wrapper for the PhysFS library
Stars: ✭ 14 (-26.32%)
Mutual labels:  filesystem

Filesystem

BracketSpace Micropackage Latest Stable Version PHP from Packagist Total Downloads License

Micropackage logo

🧬 About Filesystem

This micropackage is a wrapper for WordPress filesystem intended to be used within the wp-content directory.

Supports:

  • plugins
  • must-use plugins
  • themes
  • custom upload directories
  • custom wp-content directories

This package will prefix all the relative paths to full paths giving a convinient way to manipulate files.

💾 Installation

composer require micropackage/filesystem

🕹 Usage

Initializing the Filesystem class from the main plugin/theme file. It just needs a base directory.

use Micropackage\Filesystem\Filesystem;

$filesystem = new Filesystem( __DIR__ );

Using the micropackage to obtain full paths (plugin example).

echo $filesystem->path();
// /var/www/html/wp-content/plugins/my-plugin/

echo $filesystem->path( 'src/templates/full-width.php' );
// /var/www/html/wp-content/plugins/my-plugin/src/templates/full-width.php

Using the micropackage to obtain full URL (plugin example).

echo $filesystem->url();
// https://my.plugin/wp-content/plugins/my-plugin/

echo $filesystem->url( 'assets/images/logo.svg' );
// https://my.plugin/wp-content/plugins/my-plugin/assets/images/logo.svg

Convert image file to base64 URL.

printf( '<img src="%s">', $filesystem->image_to_base64( 'assets/images/logo.svg' ) );
// <img src="data:image/svg+xml;base64,m8q76v7wy4guiev...">

On top of that, you can use any method provided by WP_Filesystem class, which includes:

  • get_contents()
  • exists()
  • is_file(), is_dir()
  • mkdir()
  • delete()
  • ...

See all available methods

📦 About the Micropackage project

Micropackages - as the name suggests - are micro packages with a tiny bit of reusable code, helpful particularly in WordPress development.

The aim is to have multiple packages which can be put together to create something bigger by defining only the structure.

Micropackages are maintained by BracketSpace.

📖 Changelog

See the changelog file.

📃 License

GNU General Public License (GPL) v3.0. See the LICENSE file for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].