728x90

분류 전체보기 106

autoloader 사용법 (PSR-4)

autoloader는 include 또는 require 중복을 없애고 class 폴더를 쉽게 가져오기 위함여기서 경로만 수정해주면 된다. /src/autoloader.php  index.php require_once './../Classes/ZipStream/src/autoloader.php';try { // 객체 생성 테스트 $test = new \ZipStream\src\TestClass(); echo $test->sayHello(); // 메서드 호출} catch (Throwable $e) { // 오류 발생 시 echo "Error: " . $e->getMessage();}  ZipStream/src/TestClass.php

PHP 2024.12.04

Java : Scheduler(스케쥴러), Quartz 사용법

1.  최상단 pom.xml에 의존성 추가                             org.quartz-scheduler         quartz         2.3.2      -------Schedule.javapackage iot5.safe.schedule;import org.quartz.*;import org.quartz.impl.StdSchedulerFactory;public class Schedule { public void startScheduler() {        try {            // 스케줄러 생성            Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();            sche..

Java 2024.11.14

1.개인 프로젝트 / PHP 버전 업그레이드

PHP 버전 업그레이드가상서버 호스팅 생성했을때(APM이 설치된),현재까지는 제공 버전은 php7.x버전이다.따라서 Laravel 9~10버전을 사용하기 위해 php버전을 8버전으로 업그레이드 해본다.php 설치sudo 대신 su 로 들어가서 해도 된다.-remi 저장소 설치$ sudo dnf install -y epel-release$ sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm-php 모듈 리셋 및 활성화$ sudo dnf module reset php -y$ sudo dnf module enable php:remi-8.2 -y-php8.2설치$ sudo dnf install -y php php-cli php-..

개인 프로젝트 2024.11.04

바닐라 JS : XMLHttpRequest(ajax) - Fetch API

1. index.php DOCTYPE html>html lang="ko">head>meta charset="UTF-8">title>동적 검색 예제title>head>body>    input type="text" id="vl" name="vl"/>    button onclick="submit()">전송button>    div id="response">div>    script>        const submit = () => {            const value = document.getElementById('vl').value;            fetch('test1.php', {                method: 'PUT', // POST 메소드를 사용              ..

JavaScript 2024.06.11

바닐라 JS : XMLHttpRequest(ajax) - 모듈화

1. index.php에서는 POST, GET, URL을 자신이 원하는 것에맞게 사용2. ajax.js에서 HTML, JSON, XML에 맞게 사용 3번도 같이 수정 ex) json_encode index.phpDOCTYPE html>html lang="ko">head>meta charset="UTF-8">title>동적 검색 예제title>script src="/js/ajax.js">script>head>body>    input type="text" id="vl" name="vl"/>    button onclick="submit()"> 전송 button>      script>        const submit = () => {            const sender = new DataSend..

JavaScript 2024.06.11

tar 압축 및 해제 (또는 압축 시 제외폴더 선정)

압축tar -cvf [압축폴더 파일명.tar] [압축할 폴더명]ex) tar -cvf backup.tar thisfolder 만약에 특정 디렉토리 제외 압축할 경우 (여기선 /etc/file/을 제거 후 압축)ex) tar -cvf backup.tar --exclude=' etc/file/' foldername/절대경로는 절대 안되며상대경로로 작성해야한다./www/include/file/일때 file을 삭제하고 싶으면/폴더까지 들어가서 tar -cvf backup.tar --exclude='include/file/' www을 하면된다 tar -cvf backup.tar --exclude=www/wms/include/file www만약 현재 내가 있는 위치가 www와 같아야하며, www/wms/includ..

Linux 2024.05.08
728x90