-
php의 Composer 활용하기php 2023. 8. 9. 17:03
1. composer가 다운받아져 있는지 확인할 수 있다.
2. composer가 다운로드 되어있다면, composer를 생성하고싶은 폴더에서 다음의 명령어를 실행한다.
- 이용하고자 하는 확장 프로그램 (라이브러리)을 입력하고 버전 및 사용자 이름, 도메인 주소를 입력하면
composer.json 파일을 얻을 수 있고
- 이어서 설정된 dependencies를 설치하면
dependencies를 활용할 수 있게 설치된 composer.lock 파일이 생성된다.
- 설치한 symfony의 var-dumper를 사용하면 다음과 같이 객체가 저장되어있는 변수를 편하게 볼 수 있다
** 라이브러리를 활용하려면 파일의 최 상단에 다음과 같이 require을 선언해야한다.
__DIR__는 현재 경로를 뜻함
'php' 카테고리의 다른 글
Xdebug를 활용해서 자동으로 버그를 잡아보자 (0) 2023.08.09 codeigniter 프로젝트 생성 (0) 2023.08.09 php 기본 문법 2 (0) 2023.08.09 php 기본 문법 (0) 2023.08.09 php 백엔드 개발환경 설정 (windows) (0) 2023.08.08