Skip to content

Commit

Permalink
Merge pull request #11 from bombkiml/3-new-beech-2
Browse files Browse the repository at this point in the history
3 new beech 2
  • Loading branch information
bombkiml authored Aug 7, 2018
2 parents 645e94b + 85a3b47 commit f4e80cd
Show file tree
Hide file tree
Showing 110 changed files with 143 additions and 110 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.git/
config/
vendor/
node_modules/
node_modules/
composer.lock
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![N|Solid](https://image.ibb.co/gfbtQe/beech_LTSx1.png)](https://github.com/bombkiml/phpbeech)
[![N|Solid](https://image.flaticon.com/icons/png/128/294/294567.png)](https://nodesource.com/products/nsolid)
# PHP Beech framework
##### #Make it by yourself
#
Expand All @@ -11,7 +11,7 @@
> Beech use Composer to manage its dependencies. So, before using Beech, make sure you have [Composer](https://getcomposer.org/) installed on your machine.
> Download the Beech installer using Composer.
$ composer create-project bombkiml/phpbeech:1.0-alpha "yourProjectName"
$ composer create-project bombkiml/phpbeech {yourProjectName}
#
## # Development
> Want to contribute or join for Great Job!. You can contact to me via
Expand Down
6 changes: 6 additions & 0 deletions beech
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env php
<?php

if(file_exists(__DIR__.'.\vendor')) {
require __DIR__.'.\vendor\autoload.php';
}
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions beech/Database.php → beech-framework/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class Database {
private $_sql = null;

public function __construct(){
$conn = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die('Connect failed.');
mysql_select_db(DB_NAME, $conn);
mysql_query("SET NAMES UTF8");
#$conn = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_PORT) or die('Connect failed.');
#mysqli_select_db(DB_NAME, $conn);
#mysqli_query("SET NAMES UTF8");
}

private function sql_command($sql){
Expand Down
29 changes: 29 additions & 0 deletions beech-framework/Error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

class Error extends Controller {

public function __construct() {
parent::__construct();
}

function beech_error(){
$this->view->title = 'Beech Error !';
$this->view->error('error/beech_error');
}

function class_error($class) {
$this->view->title = 'Class not found !';
$this->view->class = ucfirst($class);
$this->view->file = $class;
$this->view->error('error/class_error');
}

function method_error($class, $method, $param) {
$this->view->title = 'Method not found !';
$this->view->class = ucfirst($class);
$this->view->method = $method;
$this->view->param = $param;
$this->view->error('error/method_error');
}

}
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion beech/System.php → beech-framework/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class System {

public function __construct() {
$this->get_url();
print_r($this->_url);
if (empty($this->_url[0])) {
$this->default_crl();
} else {
Expand All @@ -16,7 +17,7 @@ public function __construct() {
}

private function get_url() {
@$url = $_GET['url'];
@$url = $_SERVER['REQUEST_URI']; // == PJ_NAME . 'Controller') ? $_GET['url'] : $_SERVER['REQUEST_URI'];
$url = trim($url, '/');
$url = explode('/', $url);
$url[0] .= ($url[0]) ? 'Controller' : DEFAULT_CRL .'Controller';
Expand Down
6 changes: 3 additions & 3 deletions beech/View.php → beech-framework/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

class View {

// for system only. This function pointer view to leaves/error path.
// for system only. This function pointer view to .\error path.
public function error($src) {
$this->path = $src;
require('leaves/'.$src.EXT);
require($src.EXT);
}

// for class view only
private function view_error($src, $from = NULL) {
$this->title = 'View not found !';
$this->path = $src;
$this->from = $from;
require('leaves/error/view_error'.EXT);
require('error/view_error'.EXT);
exit;
}

Expand Down
2 changes: 1 addition & 1 deletion beech/_beech.conf.php → beech-framework/_beech.conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* beech file patern config
*
*/
define('INC', 'beech/');
define('INC', 'beech-framework/');
define('PATH_M', 'modules/models/');
define('PATH_V', 'views/');
define('PATH_C', 'modules/controllers/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset='utf-8'/>
<link href='<?php echo BASE_URL; ?>public/images/beech_16.png' rel='shortcut icon'/>
<link href='https://image.ibb.co/iqeBBK/beech_16.png' rel='shortcut icon'/>
<title><?php echo @$this->title; ?></title>
</head>
<body>
Expand All @@ -26,8 +26,8 @@
h3{height:6px;}
</style>
<div id='content'>
<h1><a href='http://www.facebook.com/bombkiml' target='_blank' title='Contact to Owner of PHP Beech Framework'><img src='<?php echo BASE_URL; ?>/public/images/beech_64.png' width='64px' /> <label style='position:absolute;top:44px;margin-left:5px;'>PHP Beech framework</label></a></h1>
<div style='margin-left: 35px'><img src='<?php echo BASE_URL; ?>/public/images/stop_64.png' width='64px' /></div>
<h1><a href='https://github.com/bombkiml/phpbeech/issues' target='_blank' title='Contact to Owner of PHP Beech Framework'><img src='https://image.ibb.co/gTcRdz/beech_64.png' width='64px' /> <label style='position:absolute;top:44px;margin-left:5px;'>PHP Beech framework</label></a></h1>
<div style='margin-left: 35px'><img src='https://image.ibb.co/b4jWdz/warning_32.png' width='64px' /></div>
<h2>Access Denied !</h2>
<?php $base = trim(BASE_URL, '/'); $base = explode('/', $base); $my_site = end($base); ?>

Expand Down
41 changes: 41 additions & 0 deletions beech-framework/error/beech_error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!doctype html>
<html>
<head>
<meta charset='utf-8'/>
<link href='https://image.ibb.co/iqeBBK/beech_16.png' rel='shortcut icon'/>
<title><?php echo @$this->title; ?></title>
</head>
<body>
<style type='text/css'>
body{font-family: Courier New;font-size: 12pt;}
#content{
box-sizing: border-box;
padding: 0 0 20px 20px;
border: 1px solid #d7d7d7;
box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.08);
-webkit-transition: all 0.3s;
transition: all 0.3s;
margin: 0;
}
a{text-decoration:none}
ol{height: 6px;}
#red{color:#D50000}
#green{font-style: italic;color:#148414}
.blue{color:blue;}
.b{font-weight:bold}
h3{height:6px;}
</style>
<div id='content'>
<h1><a href='https://github.com/bombkiml/phpbeech' target='_blank' title='PHP Beech Framework'><img src='https://image.ibb.co/gTcRdz/beech_64.png' width='64px' /> <label style='position:absolute;top:44px;margin-left:5px;'>PHP Beech framework</label></a></h1>
<div style='margin-left: 35px'><img src='https://image.ibb.co/b4jWdz/warning_32.png' width='55px' /></div>
<h2 id='red'>Oops! PHP Beech Framework is not supported !</h2>
<h4>Please contact PHP beech framework support via </h4>
<ul>
<li>GitHub issues: <label class='blue'><a href='https://github.com/bombkiml/phpbeech/issues' class='blue' target='_blank'>bombkiml/phpbeech - issues</a></label></li>
<li>E-mail: [email protected]</li>
<li>Facebook: <label class='blue'><a href='http://www.facebook.com/bombkiml' class='blue' target='_blank'>https://www.facebook.com/bombkiml</a></label></li>
</ul>


</div>

Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,7 @@
<html>
<head>
<meta charset='utf-8'/>
<link href='<?php echo BASE_URL; ?>public/images/beech_16.png' rel='shortcut icon'/>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<script type='text/javascript'>
/**
* generater event
*
*/
$(document).ready(function(){
$('#generate-class').click(function(){
var className = $(this).data('class');
$.post('', {className:className}, function(result){

});
});
});
</script>
<link href='https://image.ibb.co/iqeBBK/beech_16.png' rel='shortcut icon'/>
<title><?php echo @$this->title; ?></title>
</head>
<body>
Expand All @@ -41,9 +26,9 @@
h3{height:6px;}
</style>
<div id='content'>
<h1><a href='http://www.facebook.com/bombkiml' target='_blank' title='Contact to Owner of PHP Beech Framework'><img src='<?php echo BASE_URL; ?>/public/images/beech_64.png' width='64px' /> <label style='position:absolute;top:44px;margin-left:5px;'>PHP Beech framework</label></a></h1>
<h2><img src='<?php echo BASE_URL; ?>/public/images/warning_32.png' width='24px' /> Class not found !</h2>
<h3 id='red'>*** NOTE ***</h3>
<h1><a href='https://github.com/bombkiml/phpbeech/issues' target='_blank' title='PHP Beech Framework'><img src='https://image.ibb.co/gTcRdz/beech_64.png' width='64px' /> <label style='position:absolute;top:44px;margin-left:5px;'>PHP Beech framework</label></a></h1>
<h2><img src='https://image.ibb.co/b4jWdz/warning_32.png' width='24px' /> Fatal: Class not found !</h2>
<h3 id='red'>*** Notice ***</h3>
<?php $base = trim(BASE_URL, '/'); $base = explode('/', $base); $my_site = end($base); ?>
<h3 id='green'>1. Check path :: <?php echo $my_site; ?>/modules/controllers/<label id='red'><?php echo $this->file.'.php'; ?></label></h3>
<h3 id='green'>2. Check your code :: Do you have the class ? <label id='red'>"<?php echo $this->class; ?>"</label></h3>
Expand All @@ -61,8 +46,4 @@

<h3>}</h3>
</div>
<br/>
<h4 id='green'>// You can generate this class by click button below</h4>
<div class="bgenerate"><button id='generate-class' data-class='<?php echo $this->class; ?>'>Generate Class</button></div>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset='utf-8'/>
<link href='<?php echo BASE_URL; ?>public/images/beech_16.png' rel='shortcut icon'/>
<link href='https://image.ibb.co/iqeBBK/beech_16.png' rel='shortcut icon'/>
<title><?php echo @$this->title; ?></title>
</head>
<body>
Expand All @@ -28,9 +28,9 @@
</style>
<div id='content'>

<h1><a href='http://www.facebook.com/bombkiml' target='_blank' title='Contact to Owner of PHP Beech Framework'><img src='<?php echo BASE_URL; ?>/public/images/beech_64.png' width='64px' /> <label style='position:absolute;top:44px;margin-left:5px;'>PHP Beech framework</label></a></h1>
<h2><img src='<?php echo BASE_URL; ?>/public/images/warning_32.png' width='24px' /> Method not found !</h2>
<h3 id='red'>*** NOTE ***</h3>
<h1><a href='https://github.com/bombkiml/phpbeech/issues' target='_blank' title='PHP Beech Framework'><img src='https://image.ibb.co/gTcRdz/beech_64.png' width='64px' /> <label style='position:absolute;top:44px;margin-left:5px;'>PHP Beech framework</label></a></h1>
<h2><img src='https://image.ibb.co/b4jWdz/warning_32.png' width='24px' /> Fatal: Method not found !</h2>
<h3 id='red'>*** Notice ***</h3>
<h3 id='green'>Check your method name <label id='red'><?php echo $this->method.'()'; ?></label> inside of the class "<?php echo $this->class; ?>"</h3>
<br/><hr/>
<div class='code'>
Expand All @@ -41,17 +41,17 @@
<ol>}</ol>
<?php
for($i=1;$i<=count($this->param);$i++){
$pars .= ', $param'.$i;
@$pars .= ', $param'.$i;
}
$pa = trim($pars, ' ,');
$pa = trim(@$pars, ' ,');
?>
<label id='red'>
<ol id='green'>// Not found following of the method "<strong><?php echo $this->method.'()'; ?></strong>"</ol>
<ol id='green'>// Following method is not found. "<strong><?php echo $this->method.'()'; ?></strong>"</ol>
<ol><strong>functoin</strong> <?php echo $this->method."(<label class='gray'>".$pa."</label>)"; ?> {</ol>
<ol><ol><label id='green'>// code to be executed</label></ol></ol>
<ol>}</ol>
</label>

<h3>}</h3>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset='utf-8'/>
<link href='<?php echo BASE_URL; ?>public/images/beech_16.png' rel='shortcut icon'/>
<link href='https://image.ibb.co/iqeBBK/beech_16.png' rel='shortcut icon'/>
<title><?php echo @$this->title; ?></title>
</head>
<body>
Expand All @@ -26,9 +26,9 @@
h3{height:6px;}
</style>
<div id='content'>
<h1><a href='http://www.facebook.com/bombkiml' target='_blank' title='Contact to Owner of PHP Beech Framework'><img src='<?php echo BASE_URL; ?>/public/images/beech_64.png' width='64px' /> <label style='position:absolute;top:44px;margin-left:5px;'>PHP Beech framework</label></a></h1>
<h2><img src='<?php echo BASE_URL; ?>/public/images/warning_32.png' width='24px' /> View not found !</h2>
<h3 id='red'>*** NOTE ***</h3>
<h1><a href='https://github.com/bombkiml/phpbeech/issues' target='_blank' title='PHP Beech Framework'><img src='https://image.ibb.co/gTcRdz/beech_64.png' width='64px' /> <label style='position:absolute;top:44px;margin-left:5px;'>PHP Beech framework</label></a></h1>
<h2><img src='https://image.ibb.co/b4jWdz/warning_32.png' width='24px' /> Fatal: View not found !</h2>
<h3 id='red'>*** Notice ***</h3>
<?php $base = trim(BASE_URL, '/'); $base = explode('/', $base); $my_site = end($base); ?>
<h3 id='green'>Check path :: <?php echo $my_site; ?>/views/<lable id='red'><?php echo $this->path.'.php'; ?></label></h3>
<br/><hr/>
Expand Down
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@
"email": "[email protected]"
}
],
"scripts": {
"post-create-project-cmd": [
"@php beech init"
]
},
"minimum-stability": "dev",
"require": {
"php": ">=5.3.0",
"bombkiml/beech-cli": "dev-2-new-feature-beech-framework",
"twbs/bootstrap": "4.0.0-beta.2"
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
}
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Host name config ** default "http://localhost"
*
*/
define("HOST_NAME", "http://localhost");
define("HOST_NAME", "http://localhost:8071");

/**
* BASE URL
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
*/
require 'config/config.php';
require 'beech/_beech.conf.php';
require 'beech-framework/_beech.conf.php';
function __autoload($class){
require INC.$class.EXT;
}
Expand Down
36 changes: 0 additions & 36 deletions leaves/error/beech_error.php

This file was deleted.

7 changes: 0 additions & 7 deletions leaves/js/generate.js

This file was deleted.

2 changes: 1 addition & 1 deletion modules/controllers/examController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public function __construct() {

public function index() {
$this->view->title = '';
$this->view->template('file/page');
$this->view->template('src/file');

/**
* more method
Expand Down
Loading

0 comments on commit f4e80cd

Please sign in to comment.