PHP code example of loilo / storage-paths
1. Go to this page and download the library: Download loilo/storage-paths library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
loilo / storage-paths example snippets
use Loilo\StoragePaths\StoragePaths;
$paths = StoragePaths::for('MyApp');
$paths->data() === '/Users/loilo/Library/Application Support/MyApp-php';
$paths->config() === '/Users/loilo/Library/Preferences/MyApp-php';
$paths->cache() === '/Users/loilo/Library/Caches/MyApp-php';
$paths->log() === '/Users/loilo/Library/Logs/MyApp-php';
$paths->temp() === '/var/folders/qh/z_hny67s57sfm_sxy1zynnkr0000gn/T/MyApp-php';
StoragePaths::for(string $name, array $options): StoragePathsInterface;