├── .htaccess ├── README.md ├── application ├── config │ └── config.php ├── controllers │ ├── error.php │ └── main.php ├── helpers │ ├── session_helper.php │ └── url_helper.php ├── models │ └── example_model.php ├── plugins │ └── .gitignore └── views │ ├── footer.php │ ├── header.php │ └── main_view.php ├── index.php ├── license.txt ├── static ├── .gitignore ├── css │ └── style.css ├── images │ └── .gitignore └── js │ └── .gitignore └── system ├── controller.php ├── model.php ├── pip.php └── view.php /.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteCond %{REQUEST_FILENAME} !-d 5 | RewriteRule . index.php [L] 6 | 7 | 8 | # Prevent file browsing 9 | Options -Indexes 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### I have created new version of PIP from my extended project of BABAERON Framework. I called it Lavalust Framework. I used Codeigniter styles and some of its keywords but different classes content. I will soon make it public so that others could use it and contribute for its development. By the way, it was not intended for large industry projects for I made it simple as possible as part of my teaching methods especially in OOP MVC pattern. 2 | 3 | [LavaLust Framework](https://github.com/ronmarasigan/LavaLust) 4 | 5 | # PIP 6 | 7 | PIP is a tiny application framework built for people who use a LAMP stack. PIP aims to be as simple as possible to set up and use. 8 | 9 | Visit [http://gilbitron.github.com/PIP](http://gilbitron.github.com/PIP/) for more information and documentation. 10 | 11 | ## Requirements 12 | 13 | * PHP 5.1 or greater 14 | * MySQL 4.1.2 or greater 15 | * The mod_rewrite Apache module 16 | 17 | ## Installation 18 | 19 | * Download PIP and extract 20 | * Navigate to `application/config/config.php` and fill in your `base_url` 21 | * You are ready to rock! Point your browser to your `base_url` and hopefully see a welcome message. 22 | 23 | ## Documentation 24 | 25 | Visit [http://gilbitron.github.com/PIP](http://gilbitron.github.com/PIP/) to see the documentation. 26 | 27 | ## License 28 | 29 | PIP is released under the MIT license. 30 | -------------------------------------------------------------------------------- /application/config/config.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/controllers/error.php: -------------------------------------------------------------------------------- 1 | error404(); 8 | } 9 | 10 | function error404() 11 | { 12 | echo '

404 Error

'; 13 | echo '

Looks like this page doesn\'t exist

'; 14 | } 15 | 16 | } 17 | 18 | ?> 19 | -------------------------------------------------------------------------------- /application/controllers/main.php: -------------------------------------------------------------------------------- 1 | loadView('main_view'); 8 | $template->render(); 9 | } 10 | 11 | } 12 | 13 | ?> 14 | -------------------------------------------------------------------------------- /application/helpers/session_helper.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/helpers/url_helper.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/models/example_model.php: -------------------------------------------------------------------------------- 1 | escapeString($id); 8 | $result = $this->query('SELECT * FROM something WHERE id="'. $id .'"'); 9 | return $result; 10 | } 11 | 12 | } 13 | 14 | ?> 15 | -------------------------------------------------------------------------------- /application/plugins/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ronmarasigan/PIP/f3771dfe4c86b0e0c57d438cac18ae4a84fc4ee0/application/plugins/.gitignore -------------------------------------------------------------------------------- /application/views/footer.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /application/views/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Welcome to PIP 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /application/views/main_view.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |

Welcome to PIP

6 |

To get started please read the documentation at http://pip.dev7studios.com.

7 | 8 |
9 | 10 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Gilbert Pellegrom, Dev7studios 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /static/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ronmarasigan/PIP/f3771dfe4c86b0e0c57d438cac18ae4a84fc4ee0/static/.gitignore -------------------------------------------------------------------------------- /static/css/style.css: -------------------------------------------------------------------------------- 1 | /* CSS Styles */ -------------------------------------------------------------------------------- /static/images/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ronmarasigan/PIP/f3771dfe4c86b0e0c57d438cac18ae4a84fc4ee0/static/images/.gitignore -------------------------------------------------------------------------------- /static/js/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ronmarasigan/PIP/f3771dfe4c86b0e0c57d438cac18ae4a84fc4ee0/static/js/.gitignore -------------------------------------------------------------------------------- /system/controller.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /system/model.php: -------------------------------------------------------------------------------- 1 | connection = mysql_pconnect($config['db_host'], $config['db_username'], $config['db_password']) or die('MySQL Error: '. mysql_error()); 12 | mysql_select_db($config['db_name'], $this->connection); 13 | } 14 | 15 | public function escapeString($string) 16 | { 17 | return mysql_real_escape_string($string); 18 | } 19 | 20 | public function escapeArray($array) 21 | { 22 | array_walk_recursive($array, create_function('&$v', '$v = mysql_real_escape_string($v);')); 23 | return $array; 24 | } 25 | 26 | public function to_bool($val) 27 | { 28 | return !!$val; 29 | } 30 | 31 | public function to_date($val) 32 | { 33 | return date('Y-m-d', $val); 34 | } 35 | 36 | public function to_time($val) 37 | { 38 | return date('H:i:s', $val); 39 | } 40 | 41 | public function to_datetime($val) 42 | { 43 | return date('Y-m-d H:i:s', $val); 44 | } 45 | 46 | public function query($qry) 47 | { 48 | $result = mysql_query($qry) or die('MySQL Error: '. mysql_error()); 49 | $resultObjects = array(); 50 | 51 | while($row = mysql_fetch_object($result)) $resultObjects[] = $row; 52 | 53 | return $resultObjects; 54 | } 55 | 56 | public function execute($qry) 57 | { 58 | $exec = mysql_query($qry) or die('MySQL Error: '. mysql_error()); 59 | return $exec; 60 | } 61 | 62 | } 63 | ?> 64 | -------------------------------------------------------------------------------- /system/pip.php: -------------------------------------------------------------------------------- 1 | 48 | -------------------------------------------------------------------------------- /system/view.php: -------------------------------------------------------------------------------- 1 | template = APP_DIR .'views/'. $template .'.php'; 11 | } 12 | 13 | public function set($var, $val) 14 | { 15 | $this->pageVars[$var] = $val; 16 | } 17 | 18 | public function render() 19 | { 20 | extract($this->pageVars); 21 | 22 | ob_start(); 23 | require($this->template); 24 | echo ob_get_clean(); 25 | } 26 | 27 | } 28 | 29 | ?> --------------------------------------------------------------------------------