File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
vendor /
2
- composer.lock
2
+ composer.lock
3
+ ** /cache /**
Original file line number Diff line number Diff line change 1
1
<?php
2
+ require __DIR__ .'/../vendor/autoload.php ' ;
3
+
2
4
use \RapidWeb \Search \Search ;
5
+ use League \Flysystem \Adapter \Local ;
6
+ use League \Flysystem \Filesystem ;
7
+ use Cache \Adapter \Filesystem \FilesystemCachePool ;
8
+
9
+ if (!class_exists ('Cache\Adapter\Filesystem\FilesystemCachePool ' )) {
10
+ die ('This example requires the `FilesystemCachePool` class. Install it with `composer require cache/filesystem-adapter`. ' .PHP_EOL );
11
+ }
12
+
13
+ $ filesystemAdapter = new Local (__DIR__ .'/ ' );
14
+ $ filesystem = new Filesystem ($ filesystemAdapter );
15
+ $ cacheItemPool = new FilesystemCachePool ($ filesystem );
3
16
4
17
$ pdo = new PDO ('mysql:dbname=database_name;host=127.0.0.1 ' , 'username ' , 'password ' );
5
18
6
19
$ search = new Search ;
7
20
8
21
$ search ->setDatabaseConnection ($ pdo )
9
- // ->setCache($cacheItemPool, 60*60*24)
22
+ ->setCache ($ cacheItemPool , 60 *60 *24 )
10
23
->setTable ('products ' )
11
24
->setPrimaryKey ('product_groupid ' )
12
25
->setFieldsToSearch (['product_name ' , 'product_description ' , 'product_seokeywords ' ])
You can’t perform that action at this time.
0 commit comments