mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-24 20:06:09 +08:00
26 lines
424 B
PHP
26 lines
424 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Phalcon\Crypt as PhalconCrypt;
|
|
|
|
class Crypt extends Provider
|
|
{
|
|
|
|
protected $serviceName = 'crypt';
|
|
|
|
public function register()
|
|
{
|
|
$this->di->setShared($this->serviceName, function () {
|
|
|
|
$config = $this->getShared('config');
|
|
|
|
$crypt = new PhalconCrypt();
|
|
|
|
$crypt->setKey($config->key);
|
|
|
|
return $crypt;
|
|
});
|
|
}
|
|
|
|
} |