getProxyName() public method

동적으로 생성할 프록시 파일의 이름을 조회한다.
public getProxyName ( ) : string
return string
Exemplo n.º 1
0
 /**
  * 주어진 프록시설정에 해당하는 클래스파일이 존재하는지 확인한다.
  * checkFileTime가 설정돼 있으면 파일시간을 체크하여 판단한다.
  *
  * @param ProxyConfig $config 프록시 설정
  *
  * @return bool 클래스파일이 존재할 경우 true를 반환한다.
  */
 public function existProxyFile(ProxyConfig $config)
 {
     if ($this->hasProxyFile($config->getProxyName()) === false) {
         return false;
     }
     if ($this->checkFileTime === false) {
         return true;
     }
     $targetPath = $config->getTargetPath();
     $proxyPath = $this->getProxyPath($config->getProxyName());
     if (filemtime($targetPath) < filemtime($proxyPath)) {
         return true;
     }
 }
Exemplo n.º 2
0
 /**
  * 주어진 프록시 클래스 템플릿 코드의 클래스 선언부를 변환한다.
  *
  * @param string      $code   프록시 클래스 탬플릿 코드
  * @param ProxyConfig $config 동적으로 생성하려는 프록시 클래스 정보
  *
  * @return string
  */
 public function apply($code, ProxyConfig $config)
 {
     $code = str_replace('class Proxy', 'class ' . $config->getProxyName() . ' extends ' . $config->getTargetName(), $code);
     return $code;
 }
 public function testGetProxyName()
 {
     $config = new ProxyConfig('\\Xpressengine\\Tests\\ProxyConfigTest\\TestTargetClass');
     $name = $config->getProxyName();
     $this->assertEquals('Proxy_Xpressengine_Tests_ProxyConfigTest_TestTargetClass', $name);
 }