Close
0%
0%

PETA

Stands for phpmeta, should be a base for a plugin-oriented sys. Read more on gitub

Similar projects worth following
The name Peta came out of PHPMeta. It’s basicly written in PHP with the use of smarty (template/.tpl-files) and dojo (Javascript). The idea behind this project is to avoid redundant rewrites. A maingoal is a good structure, where the administrator of a system could change things as he need. It's target is a base for everything.

Internal Plugintypes

This classes are stored in "class/plugin.php" There are 3 types used by the pluginsys:

plugins

What is a plugin? How we write a plugin? These questions are answered here. Since "plugin" is the class, which a plugin has to extend, it is also the class, which predefine them. This is the plugin which is stored on filesystem.

rawPlugins

The rawPlugin is basicly needed to scan the filesystem/folders for new avaible plugins. It just contains two informations: className and classPath (with php-file). This is the only thing we need to do a instance of "plugin". But first read "instancedPlugins" ! rawPlugin is stored in RAM only!

instancedPlugins

The instancedPlugin represent a database-stored object which get the information to instance from a rawPlugin. It contains more stuff too, as example the individual name and description. And finally, here we also have a "getInstance"-method to get our "plugin".

Conclusion

With this three models, we are able to construct a very lite system which could do nearly everything. The plugins don't get loaded, except when they get called (getInstance). This works great in proof of concept. Because it's limmited this moments to one pluginInstance per site, there is the idea to create global widgets, which are provided by a plugin then.

  • 1 × Dojo a mighty js-framework
  • 1 × Smarty template-framework, used for MVC
  • 1 × Partialy jQuery Map- and Markdown-plugin

  • 1
    Step 1

    Installation

    Installation should work, when you try it a little.
    First of all, go into folder
    js/dojo and follow the README. Download the toolkit and extract it into js/dojo/
    You have to look that templates_c + admin/templates_c are writeable for apache. Those are temporary smarty-files.
    Next step you need to setup config.php.sample with the same information of your db. Also change the default-role to admin for your first user. Save the file as config.php
    The project create the tables by itself - setup should be done.

    Security

    There are some important points when you like to setup the project online. One is the initial role for users. You should have this role static in your db! Change
    $GLOBALS["defaultRole"] = "admin";
    in config.php
    to $GLOBALS["defaultRole"] = "default";
    ("normal" also works)
    This could be practical for installation, cause you're able to do a own admin. Maybe protect the login in this time via .htaccess.
    Of course just use localhost for db and using a random generated password. You're also able to change lenght of minimum password-chars to increase security there and also you could disable registration as you may want to create your users by hand.

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates