PHP code example of aubes / shadow-logger-bundle
1. Go to this page and download the library: Download aubes/shadow-logger-bundle library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aubes / shadow-logger-bundle example snippets
'user' => [
'id' => /* ... */,
'name' => [
'first' => /* ... */,
'last' => /* ... */,
],
]
// src/Encryptor/EncryptorAdapter.php
namespace App\Encryptor;
use Aubes\ShadowLoggerBundle\Encryptor\EncryptorInterface;
class EncryptorAdapter implements EncryptorInterface
{
// [...]
public function encrypt(string $data, string $iv): string
{
// [...]
return $encryptedValue;
}
public function generateIv(): string
{
// [...]
return $iv;
}
}
[
'iv' => , // Random IV used to encrypt the value
'value' => , // Encrypted value
]
// src/Transformer/CustomTransformer.php
namespace App\Transformer;
class CustomTransformer implements TransformerInterface
{
public function transform($data)
{
// [...]
return $value;
}
}
yaml
# config/packages/shadow-logger.yaml
shadow_logger:
# [...]
encoder:
algo: 'sha256' # cf: https://www.php.net/manual/fr/function.hash-algos.php
salt: '%env(SHADOW_LOGGER_ENCODER_SALT)%'
binary: false