| @@ -1,10 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | defined( 'ABSPATH' ) || exit; |
| 3 | 3 | |
| 4 | -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler; | |
| 5 | -use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; | |
| 6 | 4 | use WPIDE\App\Services\Storage\LocalFileSystem; |
| 5 | +use WPIDE\App\Classes\Freemius; | |
| 7 | 6 | |
| 8 | 7 | use const WPIDE\Constants\DIR; |
| 9 | 8 | use const WPIDE\Constants\SLUG; |
| 10 | 9 | use const WPIDE\Constants\TMP_DIR; |
| @@ -22,24 +21,8 @@ | ||
| 22 | 21 | }, |
| 23 | 22 | ], |
| 24 | 23 | ], |
| 25 | 24 | ], |
| 26 | - 'WPIDE\App\Services\Session\SessionStorageInterface' => [ | |
| 27 | - 'handler' => '\WPIDE\App\Services\Session\Adapters\SessionStorage', | |
| 28 | - 'config' => [ | |
| 29 | - 'name' => SLUG, | |
| 30 | - 'handler' => function () { | |
| 31 | - $save_path = null; // use default system path | |
| 32 | - $handler = new NativeFileSessionHandler($save_path); | |
| 33 | - | |
| 34 | - return new NativeSessionStorage([ | |
| 35 | - "cookie_samesite" => "Lax", | |
| 36 | - "cookie_secure" => null, | |
| 37 | - "cookie_httponly" => true, | |
| 38 | - ], $handler); | |
| 39 | - }, | |
| 40 | - ], | |
| 41 | - ], | |
| 42 | 25 | 'WPIDE\App\Services\Cors\Cors' => [ |
| 43 | 26 | 'handler' => '\WPIDE\App\Services\Cors\Cors', |
| 44 | 27 | 'config' => [ |
| 45 | 28 | 'enabled' => defined('WP_DEBUG') && WP_DEBUG, |
| @@ -73,41 +56,12 @@ | ||
| 73 | 56 | 'files' => LocalFileSystem::excludedFiles() |
| 74 | 57 | ] |
| 75 | 58 | ), |
| 76 | 59 | ], |
| 77 | -// 'WPIDE\App\Services\Storage\Filesystem' => [ | |
| 78 | -// 'handler' => '\WPIDE\App\Services\Storage\Filesystem', | |
| 79 | -// 'config' => [ | |
| 80 | -// 'separator' => '/', | |
| 81 | -// 'config' => [], | |
| 82 | -// 'adapter' => function () { | |
| 83 | -// $client = new \Aws\S3\S3Client([ | |
| 84 | -// 'credentials' => [ | |
| 85 | -// 'key' => AWS_ACCESS_KEY, | |
| 86 | -// 'secret' => AWS_SECRET_KEY | |
| 87 | -// ], | |
| 88 | -// 'region' => 'us-east-1', | |
| 89 | -// 'version' => 'latest', | |
| 90 | -// ]); | |
| 91 | -// | |
| 92 | -// return new \League\Flysystem\AwsS3v3\AwsS3Adapter($client, 'bervana'); | |
| 93 | -// }, | |
| 94 | -// ], | |
| 95 | -// ], | |
| 96 | 60 | 'WPIDE\App\Services\Database\Database' => [ |
| 97 | - 'handler' => '\WPIDE\App\Services\Database\Database', | |
| 61 | + 'handler' => Freemius::sdk()->can_use_premium_code__premium_only() ? '\WPIDE\App\Services\Database\Database' : null, | |
| 98 | 62 | 'config' => [], |
| 99 | 63 | ], |
| 100 | -// 'WPIDE\App\Services\Database\DatabaseApi' => [ | |
| 101 | -// 'handler' => '\WPIDE\App\Services\Database\DatabaseApi', | |
| 102 | -// 'config' => [ | |
| 103 | -// 'username' => DB_USER, | |
| 104 | -// 'password' => DB_PASSWORD, | |
| 105 | -// 'database' => DB_NAME, | |
| 106 | -// 'address' => DB_HOST | |
| 107 | -// ] | |
| 108 | -// ], | |
| 109 | - | |
| 110 | 64 | 'WPIDE\App\Services\Cache\Cache' => [ |
| 111 | 65 | 'handler' => '\WPIDE\App\Services\Cache\Cache', |
| 112 | 66 | 'config' => [ |
| 113 | 67 | 'group' => SLUG |