sThread
[ class tree: sThread ] [ index: sThread ] [ all elements ]

Class: sThread_MYSQL

Source Location: /sThread/sThread/Modules/mysql.php

Class Overview


MYSQL module Class


Author(s):

Copyright:

  • (c) 2015 OOPS.ORG

Variables

Constants

Methods



Class Details

[line 44]
MYSQL module Class

MYSQL 모듈에 사용할 수 있는 모듈 option은 다음과 같다.

  • user: 로그인 유저
  • pass: 로그인 암호
  • database: 질의할 데이터베이스 이름
  • query: 쿼리 문자열
  • charset: 클라이언트 문자셋

예제:

  1.    sThread::execute ('domain.com:3306:mysql|query=>select count(*) FROM test'2'tcp');




Tags:



[ Top ]


Class Variables

static $clearsession =  true

[line 56]

이 변수의 값이 true로 셋팅이 되면, clear_session method를 만들어 줘야 한다. 반대로 false 상태에서는 clear_session method가 존재하지 않아도 상관이 없다.



Tags:

access:  public

Type:   bool


[ Top ]

static $port =  3306

[line 66]

MYSQL 모듈이 사용하는 기본 포트 번호



Tags:

access:  public

Type:   int


[ Top ]

static $protocol =  'tcp'

[line 61]

MYSQL 모듈이 사용하는 protocol



Tags:

access:  public

Type:   string


[ Top ]



Class Methods


constructor __construct [line 113]

sThread_MYSQL __construct( )

Class OOP 형식 초기화 메소드



Tags:

access:  public


[ Top ]

method call_status [line 193]

int|string call_status( int $status, [boolean $call = false])

현재의 status(integer) 또는 현재 status의 handler 이름을 반환한다.



Tags:

access:  public


Parameters:

int   $status   현재 status
boolean   $call   true로 설정했을 경우 현재 status의 handler 이름을 반환한다.

[ Top ]

method change_status [line 234]

void change_status( boolean &$sess, stdClass $key, int 2)

세션의 상태를 단계로 변경한다.



Tags:

access:  public


Parameters:

int   2   세션 키
boolean   &$sess   변경한 상태가 마지막 단계일 경우 false를 반환한다.
stdClass   $key   sThread 세션 변수 reference

[ Top ]

method check_buf_status [line 152]

int check_buf_status( int $status)

현재 상태가 event read 상태인지 event write 상태인지 를 판단한다.



Tags:

access:  public


Parameters:

int   $status   현재 status

[ Top ]

method clear_session [line 268]

void clear_session( int $key)

session에서 사용한 변수(self::$sess)의 값을 정리한다.

self::$clearsession == false 일 경우, clear_session method 는 존재하지 않아도 된다.




Tags:

access:  public


Parameters:

int   $key   세션 키

[ Top ]

method init [line 128]

void init( )

mysql 모듈을 초기화 한다.



Tags:

access:  public


[ Top ]

method mysql_banner [line 323]

bool|null mysql_banner( stdClass &$sess, int $key, mixed $recv)

MySQL banner 확인



Tags:

access:  public


Parameters:

stdClass   &$sess   세션 object
int   $key   세션 키
mixed   $recv   read callback에서 전송받은 누적 데이터

[ Top ]

method mysql_handshake [line 387]

bool|null mysql_handshake( stdClass &$sess, int $key, mixed $recv)

MySQL 인증 결과 확인 및 handshake 확인



Tags:

access:  public


Parameters:

stdClass   &$sess   세션 object
int   $key   세션 키
mixed   $recv   read callback에서 전송받은 누적 데이터

[ Top ]

method mysql_queryres [line 452]

bool|null mysql_queryres( stdClass &$sess, int $key, mixed $recv)

MySQL Query 전송 결과 확인



Tags:

access:  public


Parameters:

stdClass   &$sess   세션 object
int   $key   세션 키
mixed   $recv   read callback에서 전송받은 누적 데이터

[ Top ]

method mysql_quit [line 584]

void mysql_quit( stdClass &$sess, int $key)

전송할 종료 데이터 반환



Tags:

access:  public


Parameters:

stdClass   &$sess   세션 object
int   $key   세션 키

[ Top ]

method mysql_sendauth [line 363]

void mysql_sendauth( stdClass &$sess, int $key)

전송할 인증 데이터 반환



Tags:

access:  public


Parameters:

stdClass   &$sess   세션 object
int   $key   세션 키

[ Top ]

method mysql_sendquery [line 438]

void mysql_sendquery( stdClass &$sess, int $key)

전송할 쿼리 데이터 반환



Tags:

access:  public


Parameters:

stdClass   &$sess   세션 object
int   $key   세션 키

[ Top ]

method set_last_status [line 252]

void set_last_status( stdClass &$sess, int $key)

세션의 상태를 마지막 단계로 변경한다.



Tags:

access:  public


Parameters:

stdClass   &$sess   sThread 세션 변수 reference
int   $key   세션 키

[ Top ]


Class Constants

MYSQL_BANNER =  1

[line 68]



Tags:

access:  public

[ Top ]

MYSQL_CLOSE =  7

[line 79]



Tags:

access:  public

[ Top ]

MYSQL_HANDSHAKE =  3

[line 70]



Tags:

access:  public

[ Top ]

MYSQL_QUERYRES =  5

[line 72]



Tags:

access:  public

[ Top ]

MYSQL_QUIT =  6

[line 78]

에러가 발생했을 경우, MYSQL_QUIT 메소드가 정의가 되어있으면, parent::socketColose에 의해서 자동으로 MYSQL_QUIT이 호출이 된다.



Tags:

access:  public

[ Top ]

MYSQL_SENDAUTH =  2

[line 69]



Tags:

access:  public

[ Top ]

MYSQL_SENDQUERY =  4

[line 71]



Tags:

access:  public

[ Top ]



Documentation generated on Tue, 14 May 2019 02:00:38 +0900 by phpDocumentor 1.4.4