PHP Classes

How to Generate a PHP Modular Framework Using the PHP MMVC Framework Nibiru: Generate code for rapid application prototyping

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-08-27 (24 days ago) RSS 2.0 feedNot enough user ratingsTotal: 20 This week: 2All time: 11,282 This week: 19Up
Version License PHP version Categories
nibiru 1.0.0Custom (specified...5PHP 5, Libraries, Code Generation, De...
Description 

Author

This package can generate code for rapid application prototyping.

It provides an MMVC framework with a command line console tool to generate several components to develop applications.

Currently, it can generate:

- Run database upgrade migrations

- New controller classes

- Directories and scripts to implement a new module

Picture of Stephan Kasdorf (bittomine)
  Performance   Level  
Name: Stephan Kasdorf ... <contact>
Classes: 1 package by
Country: Germany Germany

Documentation

nibiru framework :rocket:

Welcome to the nibiru framework, a powerful MMVC (Modular Model-View-Controller) PHP Framework designed specifically for rapid prototyping. Whether you're building a quick prototype or a large-scale application, nibiru framework provides the tools and structure you need to get up and running in no time.

What is MMVC PHP Framework for rapid prototyping?

MMVC in the nibiru framework stands for Modular Model-View-Controller. Modules, have the observer pattern, and are comprehensive entities that encompass not just the MVC components but also traits, interfaces, plugins, and settings. These modules are designed for loose coupling, promoting modularity and ease of integration. Each module can be loaded through its namespace, offering a flexible way to add and manage functionalities in your application. The built-in observer ensures seamless communication between these modules.

nibiru Binary Command-Line Tool

  _   _ _ _     _              ______                                           _    
 | \ | (_) |   (_)            |  ____|                                         | |   
 |  \| |_| |__  _ _ __ _   _  | |__ _ __ __ _ _ __ ___   _____      _____  _ __| | __
 | . ` | | '_ \| | '__| | | | |  __| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ /
 | |\  | | |_) | | |  | |_| | | |  | | | (_| | | | | | |  __/\ V  V / (_) | |  |   < 
 |_| \_|_|_.__/|_|_|   \__,_| |_|  |_|  \__,_|_| |_| |_|\___| \_/\_/ \___/|_|  |_|\_
----------------------------------------------------------------------------------------------

Usage: ./nibiru [-m <module_name>] [-c <controller_name>] [-h]

  -m {name}: create a new module with the given name.
  -c {name}: create a new controller with the given name.
  -p {name} -m {name}: create a new plugin with the given name in the given name for the module.
                       add -g switch if a Graylog Server present.
  -cache-clear: will clear the cache of the applications template_c folder.
  -s: check framework folders and permissions, and set them if they are not present.
  -mi {local|staging|production}: run migration files from application/settings/config/database/.
  -mi-reset {local|staging|production}: will reset the migrations table, use only if you know what you are doing.
  -mi-reset-file {filename} {local|staging|production}: will reset the migration entry for a filename e.g. mytable.sql, use only if you know what you are doing.
  -ws {URL} -wp {PORT}: connect to a WebSocket at the given URL and port.
  -h: display this help message.
  -version or -v: display the version of the nibiru binary, and the current framework version.

For a more detailed explanation and additional functionalities, please refer to the official documentation.

Database Migrations

In the nibiru framework, database migrations play a crucial role in managing and versioning your database schema. Migrations allow developers to define sets of changes that modify the database schema, making it easier to track, roll back, or apply updates as needed.

With the nibiru binary tool, managing these migrations becomes even more effortless:

  • `./nibiru -mi {environment}`: This command allows you to run migration files from the `application/settings/config/database/` directory for a specific environment (`local`, `staging`, or `production`).
  • `./nibiru -mi-reset {environment}`: Use this command with caution. It resets the migrations table, effectively allowing you to start fresh with your migrations.
  • `./nibiru -mi-reset-file {filename} {environment}`: If you need to reset a specific migration entry, this command lets you target a particular filename, such as `mytable.sql`, for a given environment.

It's essential to use migrations to ensure that your database schema remains consistent across different environments and stages of your application's lifecycle.

Generating Controllers

Using the nibiru binary tool, developers can effortlessly generate controllers for their applications:

  • `./nibiru -c {controller_name}`: This command will create a new controller with the specified name.

Upon generation, the controller will be located in:

/application/controllers/{controller_name}.php

Additionally, a corresponding view file will be generated and placed in:

/application/views/{controller_name}/

This structure ensures that the logic in the controller and its associated views are neatly organized and easy to manage.

Generating Modules

The nibiru binary tool also facilitates the generation of modules:

  • `./nibiru -m {module_name}`: This command will create a new module with the given name.

The generated module will have its own directory structure, encompassing traits, interfaces, plugins, settings, and a main PHP file. The structure will resemble:

/modules/{module_name}/
    ??? {module_name}.php
    ??? interfaces/
    ??? plugins/
    ??? settings/
    ??? traits/

This modular approach allows for clear separation of concerns and promotes scalability and maintainability of the application.

Credits

Created by Stephan Kasdorf, 2023

Happy Coding! :computer:


  Files folder image Files (136)  
File Role Description
Files folder imageapplication (4 directories)
Files folder imagecore (1 file, 5 directories)
Files folder imagepublic (3 directories)
Accessible without login Plain text file .htaccess Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Image file favicon.ico Data Auxiliary data
Accessible without login Plain text file index.php Aux. Configuration script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file vhost.conf Data Auxiliary data

  Files folder image Files (136)  /  application  
File Role Description
Files folder imagecontroller (3 files)
Files folder imagemodel (1 file)
Files folder imagesettings (2 directories)
Files folder imageview (1 directory)

  Files folder image Files (136)  /  application  /  controller  
File Role Description
  Plain text file controllerController.php Class Class source
  Plain text file formsController.php Class Class source
  Plain text file indexController.php Class Class source

  Files folder image Files (136)  /  application  /  model  
File Role Description
  Plain text file users.php Class Class source

  Files folder image Files (136)  /  application  /  settings  
File Role Description
Files folder imageconfig (3 files)
Files folder imagedb (1 file)

  Files folder image Files (136)  /  application  /  settings  /  config  
File Role Description
  Accessible without login Plain text file navigation.json Data Auxiliary data
  Accessible without login Plain text file settings.cli.ini Data Auxiliary data
  Accessible without login Plain text file settings.development.ini Data Auxiliary data

  Files folder image Files (136)  /  application  /  settings  /  db  
File Role Description
  Plain text file db.class.mask Class Class source

  Files folder image Files (136)  /  application  /  view  
File Role Description
Files folder imagetemplates (5 files, 1 directory)

  Files folder image Files (136)  /  application  /  view  /  templates  
File Role Description
Files folder imageshared (4 files)
  Accessible without login Plain text file controller.tpl Data Auxiliary data
  Accessible without login Plain text file forms.tpl Data Auxiliary data
  Accessible without login Plain text file index.tpl Data Auxiliary data
  Accessible without login Plain text file navigation.tpl Data Auxiliary data
  Accessible without login Plain text file pageination.tpl Data Auxiliary data

  Files folder image Files (136)  /  application  /  view  /  templates  /  shared  
File Role Description
  Accessible without login Plain text file debug.tpl Data Auxiliary data
  Accessible without login Plain text file debugbar.tpl Data Auxiliary data
  Accessible without login Plain text file footer.tpl Data Auxiliary data
  Accessible without login Plain text file header.tpl Data Auxiliary data

  Files folder image Files (136)  /  core  
File Role Description
Files folder imagea (6 files)
Files folder imagec (53 files)
Files folder imagef (2 files)
Files folder imagei (15 files)
Files folder imaget (3 files)
  Accessible without login Plain text file framework.php Example Example script

  Files folder image Files (136)  /  core  /  a  
File Role Description
  Plain text file controller.php Class Class source
  Plain text file module.php Class Class source
  Plain text file mysql.db.php Class Class source
  Plain text file pageination.php Class Class source
  Plain text file postgres.db.php Class Class source
  Plain text file postgresql.db.php Class Class source

  Files folder image Files (136)  /  core  /  c  
File Role Description
  Plain text file auth.php Class Class source
  Plain text file auto.php Class Class source
  Plain text file autoloader.php Class Class source
  Plain text file config.php Class Class source
  Plain text file controller.php Class Class source
  Plain text file debug.php Class Class source
  Plain text file dispatcher.php Class Class source
  Plain text file display.php Class Class source
  Plain text file engine.php Class Class source
  Plain text file form.php Class Class source
  Plain text file formattributes.php Class Class source
  Plain text file jsonnavigation.php Class Class source
  Plain text file model.php Class Class source
  Plain text file module.php Class Class source
  Plain text file mysql.php Class Class source
  Plain text file nibiru.php Class Class source
  Plain text file odbc.php Class Class source
  Plain text file pdo.php Class Class source
  Plain text file postgres.php Class Class source
  Plain text file postgresql.php Class Class source
  Plain text file psql.php Class Class source
  Plain text file registry.php Class Class source
  Plain text file router.php Class Class source
  Plain text file settings.php Class Class source
  Plain text file table.php Class Class source
  Plain text file typebutton.php Class Class source
  Plain text file typecheckbox.php Class Class source
  Plain text file typecloseany.php Class Class source
  Plain text file typeclosediv.php Class Class source
  Plain text file typecolor.php Class Class source
  Plain text file typedate.php Class Class source
  Plain text file typedatetime.php Class Class source
  Plain text file typeemail.php Class Class source
  Plain text file typefileupload.php Class Class source
  Plain text file typehidden.php Class Class source
  Plain text file typeimagesubmit.php Class Class source
  Plain text file typelabel.php Class Class source
  Plain text file typenumber.php Class Class source
  Plain text file typeopenany.php Class Class source
  Plain text file typeopendiv.php Class Class source
  Plain text file typeoption.php Class Class source
  Plain text file typepassword.php Class Class source
  Plain text file typeradio.php Class Class source
  Plain text file typerange.php Class Class source
  Plain text file typereset.php Class Class source
  Plain text file typesearch.php Class Class source
  Plain text file typeselect.php Class Class source
  Plain text file typesubmit.php Class Class source
  Plain text file typetelefon.php Class Class source
  Plain text file typetext.php Class Class source
  Plain text file typetextarea.php Class Class source
  Plain text file typeurl.php Class Class source
  Plain text file view.php Class Class source

  Files folder image Files (136)  /  core  /  f  
File Role Description
  Plain text file db.php Class Class source
  Plain text file form.php Class Class source

  Files folder image Files (136)  /  core  /  i  
File Role Description
  Plain text file IAuth.php Class Class source
  Plain text file IController.php Class Class source
  Plain text file IDb.php Class Class source
  Plain text file IEngine.php Class Class source
  Plain text file IForm.php Class Class source
  Plain text file IModule.php Class Class source
  Plain text file IMysql.php Class Class source
  Plain text file IOdbc.php Class Class source
  Plain text file IPageination.php Class Class source
  Plain text file IPdo.php Class Class source
  Plain text file IPostgres.php Class Class source
  Plain text file IPostgresql.php Class Class source
  Plain text file IPsql.php Class Class source
  Plain text file IVersion.php Class Class source
  Plain text file IView.php Class Class source

  Files folder image Files (136)  /  core  /  t  
File Role Description
  Plain text file form.php Class Class source
  Plain text file messages.php Class Class source
  Plain text file pageination.php Class Class source

  Files folder image Files (136)  /  public  
File Role Description
Files folder imagecss (1 directory)
Files folder imageimg (8 files, 1 directory)
Files folder imagejs (1 directory)

  Files folder image Files (136)  /  public  /  css  
File Role Description
Files folder imagev3 (8 files)

  Files folder image Files (136)  /  public  /  css  /  v3  
File Role Description
  Accessible without login Plain text file application.css Data Auxiliary data
  Accessible without login Plain text file docs.css Data Auxiliary data
  Accessible without login Plain text file jquery-ui.css Data Auxiliary data
  Accessible without login Plain text file nibiru-debug.css Data Auxiliary data
  Accessible without login Plain text file roboto.css Data Auxiliary data
  Accessible without login Plain text file tiamat-form.css Data Auxiliary data
  Accessible without login Plain text file toolkit-inverse.css Data Auxiliary data
  Accessible without login Plain text file toolkit-light.css Data Auxiliary data

  Files folder image Files (136)  /  public  /  img  
File Role Description
Files folder imagelogos (8 files)
  Accessible without login Image file module_table_bottom.png Icon Icon image
  Accessible without login Image file module_table_top.png Icon Icon image
  Accessible without login Image file ui-icons_444444_256x240.png Icon Icon image
  Accessible without login Image file ui-icons_555555_256x240.png Icon Icon image
  Accessible without login Image file ui-icons_777620_256x240.png Icon Icon image
  Accessible without login Image file ui-icons_777777_256x240.png Icon Icon image
  Accessible without login Image file ui-icons_cc0000_256x240.png Icon Icon image
  Accessible without login Image file ui-icons_ffffff_256x240.png Icon Icon image

  Files folder image Files (136)  /  public  /  img  /  logos  
File Role Description
  Accessible without login Image file 400dpiLogo.png Icon Icon image
  Accessible without login Image file 400dpiLogoCropped.png Icon Icon image
  Accessible without login Image file FaviconLogo.png Icon Icon image
  Accessible without login Image file MediumSquareLogo.png Icon Icon image
  Accessible without login Image file nibiru-bar-logo.png Icon Icon image
  Accessible without login Image file nibiru-logo.png Icon Icon image
  Accessible without login Image file SmallLogo.png Icon Icon image
  Accessible without login Image file SmallLogoBW.png Icon Icon image

  Files folder image Files (136)  /  public  /  js  
File Role Description
Files folder imagev3 (8 files)

  Files folder image Files (136)  /  public  /  js  /  v3  
File Role Description
  Accessible without login Plain text file application.js Data Auxiliary data
  Accessible without login Plain text file chart.js Data Auxiliary data
  Accessible without login Plain text file jquery-ui.js Data Auxiliary data
  Accessible without login Plain text file jquery.min.js Data Auxiliary data
  Accessible without login Plain text file nibiru-debug.js Data Auxiliary data
  Accessible without login Plain text file tablesorter.min.js Data Auxiliary data
  Accessible without login Plain text file tether.min.js Data Auxiliary data
  Accessible without login Plain text file toolkit.js Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:20
This week:2
All time:11,282
This week:19Up