1. Go to this page and download the library: Download morrelinko/simple-photo 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/ */
morrelinko / simple-photo example snippets
$photoId = $simplePhoto->uploadFromPhpFileUpload($_FILES["image"]);
// Or
$photoId = $simplePhoto->uploadFromFilePath("/path/to/photo.png");
use SimplePhoto\Storage\LocalStorage;
use SimplePhoto\StorageManager;
use SimplePhoto\DataStore\SqliteDataStore;
use SimplePhoto\SimplePhoto;
// Create a local storage adapter
$localStorage = new LocalStorage('/path/to/project/root/', 'photos');
// Create a storage manager
$storageManager = new StorageManager();
// Adds one or more registered storage adapters
$storageManager->add('local', $localStorage);
// Create Data Store
$dataStore = new SqliteDataStore(['database' => 'photo_app.db']);
// Create Our Simple Photo Object
$simplePhoto = new SimplePhoto($storageManager, $dataStore);