* @return string
*/
public function sharedGet(string $path)
{
$contents = '';
$handle = fopen($path, 'rb');
if ($handle) {
// try {
if (flock($handle, LOCK_SH)) {
clearstatcache(true, $path);
$contents = fread($handle, $this->size($path) ?: 1);
//ini_set('error_log' , '/home/solomono/web/solomono.net/sites/dev/php.log');
error_reporting(E_ALL);
set_error_handler(function ($level, $message, $file = '', $line = 0) {
$this->handleError($level, $message, $file, $line);
});
set_exception_handler(function ($e) {
$this->handleException($e);
});
* @return string
*/
public function sharedGet(string $path)
{
$contents = '';
$handle = fopen($path, 'rb');
if ($handle) {
// try {
if (flock($handle, LOCK_SH)) {
clearstatcache(true, $path);
$contents = fread($handle, $this->size($path) ?: 1);
* @throws Exception
*/
public function get(string $path, bool $lock = false)
{
if ($this->isFile($path) && file_exists($path)) {
return $lock ? $this->sharedGet($path) : file_get_contents($path);
}
throw new Exception("File does not exist at path {$path}");
}
/**
// If the file doesn't exist, we obviously cannot return the cache so we will
// just return null. Otherwise, we'll get the contents of the file and get
// the expiration UNIX timestamps from the start of the file's contents.
try {
$expire = substr(
$contents = $this->files->get($path, true),
0,
10
);
} catch (Exception $e) {
return $this->emptyPayload();
* Retrieve an item from the cache by key.
* @param string|array $key
*/
public function get($key)
{
return $this->getPayload($key)['data'] ?? null;
}
/**
* Store an item in the cache for a given number of seconds.
* @param string $key
{
if (is_array($key)) {
return $this->many($key);
}
$value = $this->store->get($this->itemKey($key));
// If we could not find the cache value, we will fire the missed event and get
// the default value for this cache value. This default could be a callback
// so we will execute the value function which will resolve it if needed.
if (is_null($value)) {
* @param Closure $callback
* @return mixed
*/
public function remember($key, $ttl, Closure $callback)
{
$value = $this->get($key);
// If the item exists in the cache we will just return this immediately and if
// not we will execute the given Closure and cache the result of that for a
// given number of seconds so it's available for all subsequent requests.
if (!is_null($value)) {
$key = "active_products_categories_language({$languagesId})_";
$data = Cache::store(Store::FILE)->remember($key, 1200, function () {
return prodToCatData();
});
$prodToCatAll = $data['prodToCatAll'];
$catToProd = $data['catToProd'];
$catProductCounter = $data['catProductCounter'];
$cat_tree = setTree(); //new function setTree
getCatSeoUrl();
$manufacturersToProductsId = [];
$prodToManufacturers = countProdToManufacturers();
//$prodToCat = prodToCat();
$prodToCat = prodToCatWithCache();
$manufacturers_array = tep_get_manufacturers();
$taxRatesArray = getTaxRates();
getAllSales();
$cPathTree = null;
tep_get_cpath_global($cat_tree); // generate cPaths array
use JsonLd\Container;
use JsonLd\Product;
use JsonLd\ProductReview;
require('includes/application_top.php');
includeLanguages(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
// define current template constants:
$productAvailable = false;
$productReviewsArr = [];
ErrorException
|
---|
ErrorException: fopen(/mnt/test_sites/sites_new/newagriservices.com/storage/cache/1c/54/1c5481012addff101da76f97bb7ee169c98bc55b): failed to open stream: No such file or directory at /home/solomono/web/solomono.net/sites/demo/app/Classes/Filesystem/Filesystem.php:50 at Bootstrap\HandleExceptions->handleError() (/home/solomono/web/solomono.net/sites/demo/bootstrap/HandleExceptions.php:32) at Bootstrap\HandleExceptions->Bootstrap\{closure}() at fopen() (/home/solomono/web/solomono.net/sites/demo/app/Classes/Filesystem/Filesystem.php:50) at App\Classes\Filesystem\Filesystem->sharedGet() (/home/solomono/web/solomono.net/sites/demo/app/Classes/Filesystem/Filesystem.php:38) at App\Classes\Filesystem\Filesystem->get() (/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Store/FileStore.php:200) at App\Classes\Cache\Store\FileStore->getPayload() (/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Store/FileStore.php:46) at App\Classes\Cache\Store\FileStore->get() (/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Repository.php:65) at App\Classes\Cache\Repository->get() (/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Repository.php:319) at App\Classes\Cache\Repository->remember() (/mnt/test_sites/sites_new/newagriservices.com/includes/functions/general.php:2102) at prodToCatWithCache() (/mnt/test_sites/sites_new/newagriservices.com/includes/application_top.php:796) at require('/mnt/test_sites/sites_new/newagriservices.com/includes/application_top.php') (/mnt/test_sites/sites_new/newagriservices.com/product_info.php:8) |