2017 © Pedro Pelรกez
 

project jframe

php framework

image

javamon/jframe

php framework

  • Saturday, July 22, 2017
  • by javamon1174
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

JFramework by Javamon

์ œ์ดํ”„๋ ˆ์ž„์›Œํฌ๋Š” PHP COMPOSER ๊ธฐ๋ฐ˜ ํ”„๋ ˆ์ž„ ์›Œํฌ์ž…๋‹ˆ๋‹ค. MVCํŒจํ„ด์„ ์ ์šฉํ•˜๊ณ  ์•ž์œผ๋กœ์˜ ์œ ์—ฐํ•จ๊ณผ ํ™•์žฅ์„ฑ์„ ๊ณ ๋ คํ•˜์—ฌ ๊ตฌํ˜„ํ•˜์˜€์Šต๋‹ˆ๋‹ค., (*1)

๊ฐœ๋ฐœํ™˜๊ฒฝ

์„œ๋ฒ„ ์šด์˜์ฒด์ œ ํ”„๋กœ์ ํŠธ ์„ค๋ช… ๊ฐœ๋ฐœ๊ธฐ๊ฐ„ ๊ฐœ๋ฐœ์ธ์› ์ž‘์—…ํ™˜๊ฒฝ ๊ฐœ๋ฐœํ™˜๊ฒฝ
AWS Ubuntu 16.04 MVCํŒจํ„ด ๊ธฐ๋ฐ˜์˜ ์‹ฌํ”Œ ํ”„๋ ˆ์ž„์›Œํฌ 17.5.1~3 ๋‹จ๋… MAC OS PHP 7.0.* APACHE2 MariaDB 10.*

github link : github sample link : demo, (*2)

๋™๊ธฐ

๊ฐœ์ธ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด์„œ ๊ณตํ†ต๋œ ์ž‘์—…๋“ค์„ ๋ฐ˜๋ณต์ ์œผ๋กœ ํ•˜๋Š”๋ฐ์— ๋งŽ์€ ์‹œ๊ฐ„์ด ์†Œ์š”๋˜๋ฉด์„œ ์ด์— ๋”ฐ๋ฅธ "ํ‹€"์˜ ํ•„์š”์„ฑ์„ ๋Š๊ผˆ์œผ๋ฉฐ, CI์™€ ๋ผ๋ผ๋ฒจ์„ ์‚ฌ์šฉํ•˜๋ฉด์„œ ๋Š๊ผˆ๋˜ ํ•„์ˆ˜์ ์ธ ๋ถ€๋ถ„์— ๋Œ€ํ•œ ์ง‘ํ•ฉ์„ ๊ณ ๋ คํ•˜์—ฌ ํ•ด๋‹น ํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค., (*3)

์ œ์ดํ”„๋ ˆ์ž„์›Œํฌ ์ค€๋น„๋ฌผ

  • PHP 7.0.* ์ด์ƒ
  • PHP COMPOSER
  • PHP MODULE - PDO
  • MriaDB 10.0.* ์ด์ƒ
  • APACHE - Rewrite, Override ON

์ œ์ดํ”„๋ ˆ์ž„์›Œํฌ ๊ด€ํ•ด

์ œ์ด ํ”„๋ ˆ์ž„์›Œํฌ๋Š” ๊ต‰์ž‘ํžˆ ์ž‘์Šต๋‹ˆ๋‹ค. ๋‹จ์ˆœํžˆ, http ์š”์ฒญ์„ ๋ฐ›๊ณ  ๊ทธ์— ๋”ฐ๋ฅธ MVCํ˜•ํƒœ๋งŒ ๊ฐ€์ง€๊ณ  ์žˆ์ง€๋งŒ, ์ถ”ํ›„์— ๋ฆฌํŒฉํ† ๋ง์„ ํ†ตํ•ด "๊ฐ€์žฅ ํ•„์š”ํ•จ"์— ์ค‘์ ์„ ๋‘๊ณ  ํ™•์žฅ์‹œํ‚ฌ ์˜ˆ์ •์ž…๋‹ˆ๋‹ค. ๋˜ํ•œ, ์ž‘์€ ๋งŒํผ ๋”์šฑ ๋” ๋‹ค์–‘ํ•œ ํ˜•ํƒœ๋กœ ํ™•์žฅ์ด ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ๋ถ€๋ถ„๋„ ์žฅ์ ์ด๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค., (*4)

์ œ์ดํ”„๋ ˆ์ž„์›Œํฌ๋Š”..

  • ๋””๋ ‰ํ„ฐ๋ฆฌ์˜ ๊ตฌ์กฐ๋Š” ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ํ•˜์œ„์— ์ฝ”์–ด๊ฐ€ ์žˆ๋Š” ๊ตฌ์กฐ์ธ ๋ผ๋ผ๋ฒจ๊ณผ ์œ ์‚ฌํ•ฉ๋‹ˆ๋‹ค.
  • ๋ผ์šฐํŠธ๋Š” ๋งค์šฐ ์‹ฌํ”Œํ•˜๋ฉฐ, ์•„ํŒŒ์น˜์˜ rewrite์™€ GET์š”์ฒญ๋งŒ์„ ํ™œ์šฉํ•˜์—ฌ ๊ตฌ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
  • ๋ผ๋ผ๋ฒจ์˜ ์—˜๋กœํ€ธ๋“œ ORM ๋ฐฉ์‹๊ณผ ์œ ์‚ฌํ•œ ORM์„ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
  • ๋ชจ๋ธ๊ณผ ORM์€ PHP ๋ชจ๋“ˆ์ธ PDO๋กœ ๊ตฌํ˜„๋˜์—ˆ์œผ๋ฉฐ, ํŠธ๋žœ์žญ์…˜์„ ํ™œ์šฉํ•œ commit, rollback์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
  • ๋ˆ„๊ตฌ๋“ ์ง€ ์‰ฝ๊ฒŒ, ๋˜๋Š” ๋ฐ”๋กœ ์ฝ”์–ด ํด๋ž˜์Šค๋“ค์„ ์ˆ˜์ •/๋ณด์™„ํ•˜์—ฌ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
  • ๋‚ด์žฅ๋œ ํ•จ์ˆ˜๋ฅผ ํ†ตํ•ด, ๋ช‡์ค„ ์•ˆ๋˜๋Š” ์†Œ์Šค๋กœ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ํ…Œ์ด๋ธ”๊ณผ์˜ ์ž…์ถœ๋ ฅ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

์ œ์ดํ”„๋ ˆ์ž„์›Œํฌ์˜ ๋ฐœ์ „๋ฐฉํ–ฅ

  • HTTP์˜ ์š”์ฒญ(POST, GET ๋“ฑ) ์ฒ˜๋ฆฌ๋ฅผ ์œ„ํ•œ ํด๋ž˜์Šค.
  • ์ฟ ํ‚ค, ์„ธ์…˜ ๋“ฑ์„ ์œ„ํ•œ, ํ™œ์šฉํ•˜๊ธฐ ์‰ฌ์šด ํด๋ž˜์Šค.
  • ๋ฐฑ๊ทธ๋ผ์šด๋“œ ํ”„๋กœ์„ธ์‹ฑ
  • ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์Šคํ‚ค๋งˆ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜
  • ๋ผ๋ผ๋ฒจ์˜ artisan๊ณผ ๊ฐ™์€ ์Šคํฌ๋ฆฝํŠธ ๊ธฐ๋ฐ˜์˜ ํ”„๋กœ์„ธ์Šค
  • ๋‹ค์–‘ํ•œ ๊ณต๊ฒฉ(์ธ์ ์…˜ ๋“ฑ)์— ๋Œ€์‘ํ•  ์ˆ˜ ์žˆ๋Š” ๋ณด์•ˆ.

์ œ์ดํ”„๋ ˆ์ž„์›Œํฌ ์‚ฌ์šฉ๋ฒ•

์ƒ˜ํ”Œ ์ปจํŠธ๋กค๋Ÿฌ(ํ”„๋กœ์„ธ์„œ) ๊ธฐ๋ณธ ๊ตฌ์กฐ
    namespace Javamon\Jframe\Processor;
    use \Javamon\Jframe\Core\Processor as Processor;
    class Sample extends Processor {
    public function Sample($arg) {}
    }
Route ๊ทœ์น™ ์˜ˆ์ œ

URL ROUTE๋Š” CodeIgniter์™€ ๋™์ผํ•ฉ๋‹ˆ๋‹ค. ์„ธ๊ทธ๋จผํŠธ์ด๋ฉฐ, ๊ธฐ๋ณธ ๊ทœ์น™์€ example.com/class/function/id/ ์ž…๋‹ˆ๋‹ค., (*5)

    $route['product/(:num)'] = 'catalog/product_lookup';
    $route['product/(:any)'] = 'catalog/product_lookup';

์œ„์™€ ๊ฐ™์€ ๊ทœ์น™์€ ์•„๋ž˜ ์ฃผ์†Œ๋กœ ๋งคํ•‘๋ฉ๋‹ˆ๋‹ค., (*6)

    example.com/product/1/
    .
    .
    example.com/product/4/
    example.com/product/sample/

์ฝ”๋“œ์ด๊ทธ๋‚˜์ดํ„ฐ ๋ผ์šฐํŠธ ๊ทœ์น™ : Route ๊ทœ์น™ ์ •์˜, (*7)

๋ชจ๋ธ(์ฟผ๋ฆฌ๋นŒ๋”) ์‚ฌ์šฉ ์˜ˆ์ œ
    $this->model->select(ํ…Œ์ด๋ธ”, ์กฐํšŒ์กฐ๊ฑด, ์กฐ๊ฑด ํ•„๋“œ, ์กฐ๊ฑด ๊ฐ’);
    $this->model->select('user', 'user_name','user_index', 6);
    $this->model->update(ํ…Œ์ด๋ธ”, ์ˆ˜์ • ํ•„๋“œ, ์ˆ˜์ • ๊ฐ’, ์กฐ๊ฑดํ•„๋“œ, ์กฐ๊ฑด ๊ฐ’);
    $this->model->update('user', 'user_name','power','user_index', 5);
    $this->model->delete(ํ…Œ์ด๋ธ”, ์‚ญ์ œ์กฐ๊ฑด ํ•„๋“œ, ์‚ญ์ œ ์กฐ๊ฑด๊ฐ’);
    $this->model->delete('user', 'user_index', 5);
์—˜๋กœํ€ธํŠธ ORM ์‚ฌ์šฉ ์˜ˆ์ œ
    User::ORM()->select(์กฐํšŒ์กฐ๊ฑด, ์กฐ๊ฑด ํ•„๋“œ, ์กฐ๊ฑด ๊ฐ’);
    User::ORM()->update(์ˆ˜์ • ํ•„๋“œ,์ˆ˜์ • ๊ฐ’, ์กฐ๊ฑด ํ•„๋“œ, ์กฐ๊ฑด ๊ฐ’);
    User::ORM()->delete(์‚ญ์ œ์กฐ๊ฑด ํ•„๋“œ, ์‚ญ์ œ ์กฐ๊ฑด๊ฐ’);
๋ทฐ ์‚ฌ์šฉ ์˜ˆ์ œ
    $this->view->load(๋ทฐ ํŽ˜์ด์ง€(๋ฐฐ์—ด), ๋ทฐ ์ „๋‹ฌ ๋ฐ์ดํ„ฐ(๋ฐฐ์—ด));
    $layout[] = "header";
    $layout[] = "table";
    $layout[] = "footer";
    $this->view->load($layout, $data);

๊ณตํ—Œ

ํ•ด๋‹น ๊นƒํ—™์— ํ’€ ๋ฆฌํ€˜์ŠคํŠธ ์š”์ฒญ., (*8)

The Versions

22/07 2017

dev-master

9999999-dev

php framework

  Sources   Download

MIT

The Requires

 

by javamon

framework jframe javamon