Skip to content

Commit

Permalink
Merge pull request #39 from infocyph/feature/new-beginning
Browse files Browse the repository at this point in the history
updated some typo
  • Loading branch information
abmmhasan authored Apr 18, 2024
2 parents 6ff21d9 + 13d8f9a commit c174308
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# InterMix

[![Security & Standards](https://github.com/infocyph/InterMix/actions/workflows/build.yml/badge.svg)](https://github.com/infocyph/InterMix/actions/workflows/build.yml)
[![Documentation Status](https://readthedocs.org/projects/intermix/badge/?version=latest)](https://intermix.readthedocs.io/en/latest/?badge=latest)
[![Documentation Status](https://readthedocs.org/projects/intermix/badge/?version=latest)](https://intermix.readthedocs.io)
![Packagist Downloads (custom server)](https://img.shields.io/packagist/dt/infocyph/intermix?color=green&link=https%3A%2F%2Fpackagist.org%2Fpackages%2Finfocyph%2Fintermix)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
![Packagist Version](https://img.shields.io/packagist/v/infocyph/intermix)
Expand Down
12 changes: 6 additions & 6 deletions docs/di/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Definition Caching
==================

Everytime you execute the library it will compile the definition on-demand basis & In many cases it may consume execution
time & CPU. To mitigate this, InterMix supports definition caching.
Everytime you execute the library it will compile the definition on-demand basis & In many cases it may/will consume execution
time & memory. To mitigate this, InterMix supports definition caching.

For this our library uses `Symphony Cache Library <https://symfony.com/doc/current/components/cache.html>`__. Check the link
for more details.

InterMix have 2 methods dedicated this cache mechanism.
InterMix have 2 methods dedicated to this caching mechanism.

enableDefinitionCache(CacheInterface $cache)
--------------------------------------------
Expand All @@ -20,16 +20,16 @@ you can pass any Adapter from this library.

.. code:: php
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Adapter\FilesystemAdapter; // we used FilesystemAdapter
$cache = new FilesystemAdapter();
$container->enableDefinitionCache($cache);
cacheAllDefinitions(bool $forceClearFirst = false)
--------------------------------------------------

Set this in a command to pre cache all the definitions. Pass `true` as parameter to force the re-cache. Must be executed
after setting `enableDefinitionCache()`
Set this in a command to pre cache all the definitions. Pass `true` as parameter to force the re-cache. Can only be
used after setting `enableDefinitionCache()`

.. code:: php
Expand Down
2 changes: 1 addition & 1 deletion src/DI/Resolver/DefinitionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private function getFromCacheOrResolve(string $name): mixed
if (!array_key_exists($name, $this->repository->resolvedDefinition)) {
$this->repository->resolvedDefinition[$name] = match (true) {
isset($this->repository->cacheAdapter) => $this->repository->cacheAdapter->get(
$this->repository->alias . '-' . base64_encode($name),
$this->repository->alias . '-def' . base64_encode($name),
fn () => $this->resolveDefinition($name)
),
default => $this->resolveDefinition($name)
Expand Down

0 comments on commit c174308

Please sign in to comment.