본문 바로가기

php

Symbolic link를 이용한 PHP 소스 배포시 문제점 PHP에서 서버를 올려줄때 우리가 생가하는 것과 다르게 프로젝트가 존재하는 소스코드의 경로를 real path로 참고하고 있는것을 확인 이로 인해 배포시 symbolic link를 교체하여 쉽게 무중단 배포를 수행하려고 하는데 난관이 발생 퍼포먼스 때문에 real path를 사용하고 있다고 하는데, 일단 당장은 해당 기능을 사용하지 않아도 이슈가 없을것 같아, 수정하기로 함. real path를 업데이트 해주는 주기가 있는데 그 설정값은 realpath_cache_ttl. https://www.php.net/manual/en/ini.core.php#ini.realpath-cache-ttl 불러오는 중입니다... 위 링크의 Performance Tuning 탭에 있는것 확인. 해당 설정값을 0으로 설정하니.. 더보기
리눅스에서 PID 로 프로세스 동작 유무 체크 리눅스에서 프로세스가 동작중일 경우해당 정보들이 /proc/[pid] 폴더 내부에 존재하게 됨. 프로그래밍적으로 pid를 이용해서 동일 프로세스가 동작하는지 여부는위 폴더 유무로 체크해 줄 수 있음.$pidFileName = "/tmp/mypid"; if (file_exists($pidFileName)) { $oldPid = file_get_contents($pidFileName); if (file_exists("/proc/$oldPid")) { $this->response("Exists Process"); return false; }} 주 언어가 php인 관계로 간단하게 위와같이 진행해주면해당 스크립트가 다른 프로세스에서 동작중인지 여부를 체크해 줄 수 있음. 물론. 이때 프로세스 진입 단계에 현재 프.. 더보기
Trait As of PHP 5.4.0, PHP implements a method of code reuse called Traits. It is useful in single inheritance languages.Trait is similar class, but only it make to group functionality. For example, you need same functions in two absolutely different class.At that time declare that functions as trait and use it in your class. Like this.. The getRetuntType and getReturnDescription functions not declare.. 더보기