"Illuminate\Session\Store.php"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 4개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;
;framework/src/Illuminate/Session/Store.php
<source lang='php'>
;Illuminate\Session\Store.php
 
<syntaxhighlight lang='php'>
namespace Illuminate\Session;
namespace Illuminate\Session;


63번째 줄: 65번째 줄:
... (생략)
... (생략)
}
}
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
73번째 줄: 75번째 줄:


[[분류: Laravel]]
[[분류: Laravel]]
[[분류:Illuminate\Session]]

2020년 11월 2일 (월) 02:57 기준 최신판

1 개요[ | ]

framework/src/Illuminate/Session/Store.php
Illuminate\Session\Store.php
namespace Illuminate\Session;

use Closure;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use SessionHandlerInterface;
use Illuminate\Contracts\Session\Session;

class Store implements Session
{
    protected $id;
    protected $name;
    protected $attributes = [];
    protected $handler;
    protected $started = false;

    public function __construct($name, SessionHandlerInterface $handler, $id = null)
    {
        $this->setId($id);
        $this->name = $name;
        $this->handler = $handler;
    }

    public function start()
    {
        $this->loadSession();
        if (! $this->has('_token')) {
            $this->regenerateToken();
        }
        return $this->started = true;
    }

    protected function loadSession()
    {
        $this->attributes = array_merge($this->attributes, $this->readFromHandler());
    }

... (생략)
    protected function generateSessionId()
    {
        return Str::random(40);
    }

    public function setExists($value)
    {
        if ($this->handler instanceof ExistenceAwareInterface) {
            $this->handler->setExists($value);
        }
    }

    public function token()
    {
        return $this->get('_token');
    }

    public function regenerateToken()
    {
        $this->put('_token', Str::random(40));
    }
... (생략)
}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}