Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Commit

Permalink
New Crowdin translations (#1020)
Browse files Browse the repository at this point in the history
* New translations annotations.md (Japanese)

* New translations cache.md (Japanese)

* New translations sidebar.md (Indonesian)

* New translations sidebar.md (Japanese)

* New translations cache.md (Polish)

* New translations annotations.md (Polish)

* New translations introduction.md (Japanese)

* New translations sidebar.md (Greek)

* New translations cache.md (Hungarian)

* New translations annotations.md (Hungarian)

* New translations cache.md (Indonesian)

* New translations annotations.md (Indonesian)

* New translations sidebar.md (Hungarian)

* New translations acl.md (Indonesian)

* New translations annotations.md (Russian)

* New translations cache.md (Russian)

* New translations sidebar.md (Russian)

* New translations annotations.md (Spanish)

* New translations cache.md (Spanish)

* New translations sidebar.md (Polish)

* New translations sidebar.md (Portuguese)

* New translations annotations.md (Portuguese)

* New translations cache.md (Portuguese)

* New translations sidebar.md (Bulgarian)

* New translations annotations.md (Chinese Simplified)

* New translations cache.md (Chinese Simplified)

* New translations cache.md (Czech)

* New translations annotations.md (Czech)

* New translations sidebar.md (Chinese Simplified)

* New translations sidebar.md (Bosnian)

* New translations annotations.md (Bosnian)

* New translations cache.md (Bosnian)

* New translations annotations.md (Bulgarian)

* New translations cache.md (Bulgarian)

* New translations sidebar.md (German)

* New translations cache.md (German)

* New translations cache.md (Greek)

* New translations annotations.md (Greek)

* New translations annotations.md (French)

* New translations cache.md (French)

* New translations sidebar.md (Czech)

* New translations sidebar.md (French)

* New translations annotations.md (German)

* New translations acl.md (Bosnian)

* New translations sidebar.md (Ukrainian)

* New translations cache.md (Vietnamese)

* New translations annotations.md (Vietnamese)

* New translations sidebar.md (Vietnamese)

* New translations cache.md (Turkish)

* New translations annotations.md (Turkish)

* New translations sidebar.md (Spanish)

* New translations annotations.md (Ukrainian)

* New translations cache.md (Ukrainian)

* New translations sidebar.md (Turkish)
  • Loading branch information
niden committed Jun 19, 2017
1 parent 07b4335 commit f016160
Show file tree
Hide file tree
Showing 54 changed files with 1,888 additions and 188 deletions.
38 changes: 38 additions & 0 deletions docs/bg/3.1/annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<ul>
<li>
<a href="#overview">Annotations Parser</a> <ul>
<li>
<a href="#factory">Factory</a>
</li>
<li>
<a href="#reading">Reading Annotations</a>
</li>
Expand Down Expand Up @@ -124,6 +127,41 @@ However, to make the code more maintainable and understandable it is recommended
*/
```

<a name='factory'></a>

## Factory

There are many annotations adapters available (see [Adapters](#adapters)). The one you use will depend on the needs of your application. The traditional way of instantiating such an addapter is as follows:

```php
<?php

use Phalcon\Annotations\Adapter\Memory as MemoryAdapter;

$reader = new MemoryAdapter();

// .....
```

However you can also utilize the factory method to achieve the same thing:

```php
<?php


use Phalcon\Annotations\Factory;

$options = [
'prefix' => 'annotations',
'lifetime' => '3600',
'adapter' => 'memory', // Load the Memory adapter
];

$annotations = Factory::load($options);
```

The Factory loader provides more flexibility when dealing with instantiating annotations adapters from configuration files.

<a name='reading'></a>

## Reading Annotations
Expand Down
62 changes: 62 additions & 0 deletions docs/bg/3.1/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<li>
<a href="#caching-behavior">Caching Behavior</a>
</li>
<li>
<a href="#factory">Factory</a>
</li>
<li>
<a href="#output-fragments">Caching Output Fragments</a>
</li>
Expand Down Expand Up @@ -105,6 +108,65 @@ The caching process is divided into 2 parts:
- **Frontend**: This part is responsible for checking if a key has expired and perform additional transformations to the data before storing and after retrieving them from the backend-
- **Backend**: This part is responsible for communicating, writing/reading the data required by the frontend.

<a name='factory'></a>

## Factory

Instantiating frontend or backend adapters can be achieved by two ways:

- Traditional way

```php
<?php

use Phalcon\Cache\Backend\File as BackFile;
use Phalcon\Cache\Frontend\Data as FrontData;

// Create an Output frontend. Cache the files for 2 days
$frontCache = new FrontData(
[
'lifetime' => 172800,
]
);

// Create the component that will cache from the 'Output' to a 'File' backend
// Set the cache file directory - it's important to keep the '/' at the end of
// the value for the folder
$cache = new BackFile(
$frontCache,
[
'cacheDir' => '../app/cache/',
]
);
```

or using the Factory object as follows:

```php
<?php

use Phalcon\Cache\Frontend\Factory as FFactory;
use Phalcon\Cache\Backend\Factory as BFactory;

$options = [
'lifetime' => 172800,
'adapter' => 'data',
];
$frontendCache = FFactory::load($options);


$options = [
'cacheDir' => '../app/cache/',
'prefix' => 'app-data',
'frontend' => $frontendCache,
'adapter' => 'file',
];

$backendCache = BFactory::load($options);
```

If the options

<a name='output-fragments'></a>

## Caching Output Fragments
Expand Down
2 changes: 1 addition & 1 deletion docs/bg/3.1/sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
- [Metadata](/[[language]]/[[version]]/db-models-metadata)
- [Relationships](/[[language]]/[[version]]/db-models-relationships)
- [Transactions](/[[language]]/[[version]]/db-models-transactions)
- [Validators](/[[language]]/[[version]]/db-models-validators)
- [Validators](/[[language]]/[[version]]/db-models-validation)
- [Migrations](/[[language]]/[[version]]/db-migrations)
- [Pagination](/[[language]]/[[version]]/db-pagination)
- Front End
Expand Down

0 comments on commit f016160

Please sign in to comment.