* @param string $path
* @return int
*/
public function size($path)
{
return filesize($path);
}
public function humanFilesize($bytes, $decimals = 2)
{
$sz = 'BKMGTP';
//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);
});
* @param string $path
* @return int
*/
public function size($path)
{
return filesize($path);
}
public function humanFilesize($bytes, $decimals = 2)
{
$sz = 'BKMGTP';
$handle = fopen($path, 'rb');
if ($handle) {
// try {
if (flock($handle, LOCK_SH)) {
clearstatcache(true, $path);
$contents = fread($handle, $this->size($path) ?: 1);
flock($handle, LOCK_UN);
}
// } finally {
// fclose($handle);
// }
* @throws Exception
*/
public function get(string $path, bool $lock = false)
{
if ($this->isFile($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
{
$this->ensureCacheDirectoryExists($path = $this->path($key));
//save list of keys to paths
if ($key !== 'ALL_KEYS' && empty($seconds)) {
$allKeys = $this->get('ALL_KEYS') ?: [];
if (!isset($allKeys[$key])) {
$allKeys[$key] = 1;
$this->put('ALL_KEYS', $allKeys, 0);
}
}
* @param mixed $value
* @return bool
*/
public function forever($key, $value): bool
{
return $this->put($key, $value, 0);
}
/**
* Remove an item from the cache.
* @param string $key
* @param mixed $value
* @return bool
*/
public function forever($key, $value)
{
$result = $this->store->forever($this->itemKey($key), $value);
if ($result) {
event(new CacheWritten($key, $value));
}
if (is_array($key)) {
return $this->putMany($key, $value);
}
if ($ttl === null) {
return $this->forever($key, $value);
}
$seconds = $this->getSeconds($ttl);
if ($seconds <= 0) {
// given number of seconds so it's available for all subsequent requests.
if (!is_null($value)) {
return $value;
}
$this->put($key, $value = $callback(), $ttl);
return $value;
}
/**
public static function remember(string $key, \Closure $closure, $ttl = 60 * 5)
{
try {
return self::getRepository()
->remember(
$key,
$ttl,
$closure
);
} catch (\Exception $exception) {
Log::critical($exception->getMessage(), [
while ($raw_listing = tep_db_fetch_array($module_products_first)) {
$all_pids[] = $raw_listing['products_id'];
}
return $all_pids;
},
null
);
}
return $all_pids;
}
}
function tep_get_all_pids_price_exclude($listing_sql, $excluded_statement)
{
$cleared_listing_sql = str_replace($excluded_statement, '', $listing_sql);
return tep_get_all_pids($cleared_listing_sql);
}
/**
* get count of comments
*/
$listing_sql .= " limit 0, " . $lastProductNumberForPagination;
$listing_sql_raw = $listing_sql;
// debug($listing_sql);
// split query to 2 small queries: 1) find all products ids, 2) get info for each product
$pids_price_filter_excluded = tep_get_all_pids_price_exclude($listing_sql, $price_filter_statement);
$pids_filter_excluded = tep_get_all_pids_price_exclude($listing_sql, str_replace($price_filter_statement, '', $where_filters));
$pids_filter_excluded = $pids_filter_excluded ?: [0];
$where_attr = str_replace($manFilter, '', $where_filters);
ErrorException
|
---|
ErrorException: filesize(): stat failed for /home/ltscreen/web/ltscreen.com/public_html/storage/cache/bd/a5/bda5fcbf671782aad500a5f6cf52179bc99ebd7b at /home/ltscreen/web/ltscreen.com/public_html/app/Classes/Filesystem/Filesystem.php:339 at Bootstrap\HandleExceptions->handleError() (/home/ltscreen/web/ltscreen.com/public_html/bootstrap/HandleExceptions.php:32) at Bootstrap\HandleExceptions->Bootstrap\{closure}() at filesize() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Filesystem/Filesystem.php:339) at App\Classes\Filesystem\Filesystem->size() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Filesystem/Filesystem.php:55) at App\Classes\Filesystem\Filesystem->sharedGet() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Filesystem/Filesystem.php:38) at App\Classes\Filesystem\Filesystem->get() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Cache/Store/FileStore.php:195) at App\Classes\Cache\Store\FileStore->getPayload() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Cache/Store/FileStore.php:46) at App\Classes\Cache\Store\FileStore->get() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Cache/Store/FileStore.php:61) at App\Classes\Cache\Store\FileStore->put() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Cache/Store/FileStore.php:138) at App\Classes\Cache\Store\FileStore->forever() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Cache/Repository.php:301) at App\Classes\Cache\Repository->forever() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Cache/Repository.php:160) at App\Classes\Cache\Repository->put() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Cache/Repository.php:328) at App\Classes\Cache\Repository->remember() (/home/ltscreen/web/ltscreen.com/public_html/app/Classes/Cache/Helpers/FileCacheHelper.php:282) at App\Classes\Cache\Helpers\FileCacheHelper::remember() (/home/ltscreen/web/ltscreen.com/public_html/includes/functions/general.php:121) at tep_get_all_pids() (/home/ltscreen/web/ltscreen.com/public_html/includes/functions/general.php:130) at tep_get_all_pids_price_exclude() (/home/ltscreen/web/ltscreen.com/public_html/index.php:326) |