Download the PHP package mulertech/file-manipulation without Composer
On this page you can find all versions of the php package mulertech/file-manipulation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mulertech/file-manipulation
More information about mulertech/file-manipulation
Files in mulertech/file-manipulation
Package file-manipulation
Short Description This package manipulates and organizes files and path
License MIT
Informations about the package file-manipulation
FileManipulation
This package manipulates files and paths
Requirements
- PHP
^8.4 symfony/yaml^8.1
Installation
Two methods to install FileManipulation package with composer :
1. Add to your "composer.json" file into require section :
and run the command :
2. Run the command :
Usage
Open env file : (return content of file)
// key1=value1
Parse env file : (return parsed content of file)
// ['key' => 'value', 'key2' => 'value2']
Load env file : (load env file in environment variables)
Open json file : (return content of file)
// ['key' => 'value', 'key2' => 'value2']
Open php file : (return content of file)
// ['key' => 'value', 'key2' => 'value2']
Open yaml file : (return content of file)
// ['key' => 'value', 'key2' => 'value2']
Open other file : (return content of file)
// ['key' => 'value', 'key2' => 'value2']
Save env/json/php/yaml file :
Save other file :
Php file class name :
// ClassName
Php get class names :
// ['ClassName', 'ClassName2']
Php get class attribute named "Attribute::class" :
// return ReflectionAttribute of Attribute::class
Php get instance of class attribute named "Attribute::class" :
// return instance of Attribute::class
Php get properties attributes :
// return array of ReflectionProperty of properties
Php get instance of properties attributes named "Attribute::class" :
// return array of property name => instances of Attribute::class
Php get methods attributes :
// return array of ReflectionMethod of methods
Php get instance of methods attributes named "Attribute::class" :
// return array of method name => instances of Attribute::class
Get first occurrence of a string in a file :
// return line of first occurrence (int)
Get last occurrence of a string in a file :
// return line of last occurrence (int)
Get line number :
// return content of line (string)
Convert file :
// convert json file to yaml file
Count lines :
// return number of lines of file (int)
Insert content at line number :
// insert content (one or more lines) at line number 2 and move other lines after
Date path :
// return path of path/year/month (example : path/2022/02)
Date filename :
// return filename with date (example : 20220201-suffix)
Date time filename :
// return filename with date and time (example : 20220201-1200-suffix)