Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 70 | All time: 10,298 This week: 488![]() |
Version | License | PHP version | Categories | |||
objectsize 1.0 | MIT/X Consortium ... | 7.1 | PHP 5, Files and Folders, Text proces... |
Description | Author | |||||||||||||
This package can calculate the size of files and directories. |
|
Converts file or directory to human readable number by taking the number of that unit that the bytes will go into it.
Via Composer:
$ composer require ravjanisz/objectsize
//settings and object instance
use Rav\Size\SizeSettings;
use Rav\ObjectSize\ObjectSize;
//create settings for human readable size
$settings = new SizeSettings();
$settings->setPrecision(2);
//create object instance
$object = new ObjectSize($settings);
//set file/dir path
$object->setPath(__DIR__ . '/files/shark.jpeg');
//get value
echo $object->human();
//get value in bytes
echo $object->inBytes();
//set file/dir path
$object->setPath(__DIR__ . '/files');
//get value
echo $object->human();
//get value in bytes
echo $object->inBytes();
None
Do you like this project? Support it by donating
<a href="https://www.buymeacoffee.com/ravjanisz">
</a>
objectsize is licensed under the MIT License - see the LICENSE file for details
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
![]() |
/ | src | / | ObjectSize |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
/ | tests | / | ObjectSize |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
Class | Class source | ||
![]() |
Class | Class source | ||
![]() |
Class | Class source |
![]() |
/ | tests | / | ObjectSize | / | assets |
![]() |
/ | tests | / | ObjectSize | / | assets | / | dir |
![]() |
/ | tests | / | ObjectSize | / | assets | / | link |
File | Role | Description |
---|---|---|
![]() ![]() |
Data | Auxiliary data |
![]() ![]() |
Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.