1 Star 0 Fork 0

wfdaj/custom-php-mvc-framework

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

custom-php-mvc-framework

Model View Controller (MVC) framework based on tutorials I have been following from Freeskills on YT.

Beginning on Friday, June 15, 2024 all updates are driven by me unless other contributors are involved.

Complete documentation including the "Getting Started" guild describe below can be found within the framework after setup.

About

The Model View Controller is a style of programming that allows developers to efficiently manage interactions between users, the user interface, and the database of a web application. The models manages the data, logic and rules of the application. The views are what the user sees and interacts with. Finally, the controller manages interactions between the user, views, and models.

What does this MVC support?

It supports everything described above. This sample application natively comes with support for user login, registration, and sessions associated with each user.

Getting Started

  1. Navigate to where your development projects are located in CMD or Terminal.
  2. Run the command git clone git@github.com:chapmancbVCU/custom-php-mvc-framework.git
  3. Make a copy of .env.sample in project root and name it .env. Fill in the following information:
    • DB_NAME
    • DB_USER
    • DB_PASSWORD
    • DB_HOST
    • CURRENT_USER_SESSION_NAME: should be a long string of upper and lower case characters and numbers.
    • REMEMBER_ME_COOKIE_NAME: should be a long string of upper and lower case characters and numbers.
  4. Database Setup:
    • Create your database and set it to what you entered for DB_NAME
    • Create a table named migrations with an id field and a field called migrations of type varchar and size 100
    • Apache and Nginx, run the following command from project root: php run_migrations.php
    • XAMPP
      • Within the .env file set the RUN_MIGRATIONS_FROM_BROWSER variable to true
      • Run the following command from your browser's address bar: http://localhost/project_name/run_migrations.php
    • Inspect database and make sure the following tables are created:
      • acl
      • contacts
      • users
      • user_sessions
  5. profileImage directory:
    • In CMD or Terminal navigate to public/images from project root and make a directory called "profileImage".
    • In Linux and MacOS set the appropriate permissions by running the command: chmod 777 profileImage
    • In Linux and MacOS you will need to modify the owner and group. sudo chown -R %USERNAME%:%GROUP% profileImage/ Where %USERNAME% is the name of the account you are developing in and %GROUP% is the name of group associated with your server. In XAMPP it would be daemon and in Nginx it maybe nginx or a something else depending on the instructions you followed to setup your server.
  6. Import the database found in mvctutorial.sql.zip into SQL.
  7. Initialize a composer project.
  8. Install phpdotenv for environmental file support by running: composer require vlucas/phpdotenv
  9. Install TinyMCE for WYSIWYG rich text editor support: composer require tinymce/tinymce
  10. Navigate to http://localhost/custom-php-mvc-framework. If you have any issues make sure your database is setup correctly and the .env file is correct.
    • For production servers or remote access the path will be "/". You will need to make sure the ipaddress / hostname / domain name is set in APP_DOMAIN variable in .env file.

Goals

  1. Add additional front-end and back-end form validation (Done)
  2. Resolve issue for warnings about creating of dynamic properties so the framework is fully compatible with PHP 8
  3. Test with nginx (In progress)
  4. Update jQuery and Bootstrap to modern builds and add support to maintain similar look and feel of front end (Done)
  5. Add support for additional form elements in FormHelpers (In progress)
  6. Add user guide (Update as needed)
  7. Add management system for Users model to in include admin so administrators can manage other users, change user type, and perform password reset operations.
  8. Add TinyMCE (Done)
  9. Add file upload support (Done)
  10. Add database migrations. (Done)
  11. Update to match original tutorial project. (Done)
  12. Add user profile (In progress)

Credits

  1. “mvc” icon by iconixar, from thenounproject.com.
  2. Freeskills on YT (https://www.youtube.com/playlist?list=PLFPkAJFH7I0keB1qpWk5qVVUYdNLTEUs3)
MIT License Copyright (c) 2024 Chad Chapman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wfdaj/custom-php-mvc-framework.git
git@gitee.com:wfdaj/custom-php-mvc-framework.git
wfdaj
custom-php-mvc-framework
custom-php-mvc-framework
main

搜索帮助