Skip to content

Commit

Permalink
Merge pull request #8 from WebFiori/dev
Browse files Browse the repository at this point in the history
v3.0.0-RC4
  • Loading branch information
usernane authored Apr 29, 2023
2 parents bb3de34 + e263738 commit 4fa2fe0
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 431 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
app/storage/*
vendor/*
app/sto
.idea/*
45 changes: 21 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

<p align="center">
<a href="https://github.com/WebFiori/framework/actions"><img src="https://github.com/WebFiori/framework/workflows/Build%20PHP%208.1/badge.svg?branch=master"></a>
<a href="https://github.com/WebFiori/framework/actions"><img src="https://github.com/WebFiori/framework/workflows/Build%20PHP%208.2/badge.svg?branch=master"></a>
<a href="https://codecov.io/gh/WebFiori/framework">
<img src="https://codecov.io/gh/WebFiori/framework/branch/master/graph/badge.svg" />
</a>
Expand All @@ -22,7 +22,7 @@

## What is WebFiori Framework?

WebFiori Framework is a mini web development framework which is built using PHP language. The framework is fully object oriented (OOP). It uses semi-MVC model but it does not force it. The framework comes with many features which can help in making your website or web application up and running in no time.
WebFiori Framework is a mini web development framework which is built using PHP language. The framework is fully object-oriented (OOP). It uses semi-MVC model, but it does not force it. The framework comes with many features which can help in making your website or web application up and running in no time.

## Supported PHP Versions
| Build Status |
Expand All @@ -39,7 +39,7 @@ WebFiori Framework is a mini web development framework which is built using PHP

## Key Features

* Provide minimum utilities to setup a small web application.
* Provide minimum utilities to setup a small/medium web application.
* Theming and the ability to create multiple UIs for the same web app using any CSS or JavaScript framework.
* Building and manipulating the DOM of a web page inside PHP.
* Basic template engine.
Expand All @@ -51,70 +51,67 @@ WebFiori Framework is a mini web development framework which is built using PHP
* Access management by assigning system user a set of privileges.
* Customized sessions manager.
* Support for creating and sending nice-looking HTML emails.
* Autoloading of user defined classes (loading composer packages also supported).
* Autoload of user defined classes (loading composer packages also supported).
* Ability to create background tasks and let them run in specific time using CRON.
* Well-defined file upload and file handling sub-system.
* Basic support for running the framework throgh CLI.
* Ability to implement custom CLI commands.
* Basic support for creating CLI Applications.

## Standard Libraries

Following table shows build status of the standard libraries that the framework is composed of. The build is based on the latest stable PHP release.

| Library | Build | Latest |
|----|----|----|
| [HTTP](https://github.com/WebFiori/http) | <a href="https://github.com/WebFiori/http/actions"><img src="https://github.com/WebFiori/http/workflows/Build%20PHP%208.1/badge.svg?branch=master"></a> | <a href="https://github.com/WebFiori/http/releases"><img src="https://img.shields.io/github/release/WebFiori/http.svg" /></a> |
| [File](https://github.com/WebFiori/file) | <a href="https://github.com/WebFiori/file/actions"><img src="https://github.com/WebFiori/file/workflows/Build%20PHP%208.1/badge.svg?branch=main"></a> | <a href="https://github.com/WebFiori/file/releases"><img src="https://img.shields.io/github/release/WebFiori/file.svg" /></a> |
| [Json](https://github.com/WebFiori/json) | <a href="https://github.com/WebFiori/json/actions"><img src="https://github.com/WebFiori/json/workflows/Build%20PHP%208.1/badge.svg?branch=master"></a> | <a href="https://github.com/WebFiori/json/releases"><img src="https://img.shields.io/github/release/WebFiori/json.svg" /></a> |
| [UI](https://github.com/WebFiori/ui) | <a href="https://github.com/WebFiori/ui/actions"><img src="https://github.com/WebFiori/ui/workflows/Build%20PHP%208.1/badge.svg?branch=master"></a> | <a href="https://github.com/WebFiori/ui/releases"><img src="https://img.shields.io/github/release/WebFiori/ui.svg" /></a> |
| [Collections](https://github.com/WebFiori/collections) | <a href="https://github.com/WebFiori/collections/actions"><img src="https://github.com/WebFiori/collections/workflows/Build%20PHP%208.1/badge.svg?branch=master"></a> | <a href="https://github.com/WebFiori/collections/releases"><img src="https://img.shields.io/github/release/WebFiori/collections.svg" /></a> |
| [Database](https://github.com/WebFiori/database) | <a href="https://github.com/WebFiori/database/actions"><img src="https://github.com/WebFiori/database/workflows/Build%20PHP%208.1/badge.svg?branch=main"></a> | <a href="https://github.com/WebFiori/database/releases"><img src="https://img.shields.io/github/release/WebFiori/database.svg" /></a> |
| [CLI](https://github.com/WebFiori/cli) | <a href="https://github.com/WebFiori/cli/actions"><img src="https://github.com/WebFiori/cli/workflows/Build%20PHP%208.1/badge.svg?branch=main"></a> | <a href="https://github.com/WebFiori/cli/releases"><img src="https://img.shields.io/github/release/WebFiori/cli.svg" /></a> |
| [Mailer](https://github.com/WebFiori/mail) | <a href="https://github.com/WebFiori/mail/actions"><img src="https://github.com/WebFiori/err/workflows/Build%20PHP%208.1/badge.svg?branch=main"></a> | <a href="https://github.com/WebFiori/mail/releases"><img src="https://img.shields.io/github/release/WebFiori/mail.svg" /></a> |
| [Errors and Exceptions Handler](https://github.com/WebFiori/err) | <a href="https://github.com/WebFiori/err/actions"><img src="https://github.com/WebFiori/err/workflows/Build%20PHP%208.1/badge.svg?branch=main"></a> | <a href="https://github.com/WebFiori/err/releases"><img src="https://img.shields.io/github/release/WebFiori/err.svg" /></a> |
| [HTTP](https://github.com/WebFiori/http) | <a href="https://github.com/WebFiori/http/actions"><img src="https://github.com/WebFiori/http/workflows/Build%20PHP%208.2/badge.svg?branch=master"></a> | <a href="https://github.com/WebFiori/http/releases"><img src="https://img.shields.io/github/release/WebFiori/http.svg" /></a> |
| [File](https://github.com/WebFiori/file) | <a href="https://github.com/WebFiori/file/actions"><img src="https://github.com/WebFiori/file/workflows/Build%20PHP%208.2/badge.svg?branch=main"></a> | <a href="https://github.com/WebFiori/file/releases"><img src="https://img.shields.io/github/release/WebFiori/file.svg" /></a> |
| [Json](https://github.com/WebFiori/json) | <a href="https://github.com/WebFiori/json/actions"><img src="https://github.com/WebFiori/json/workflows/Build%20PHP%208.2/badge.svg?branch=master"></a> | <a href="https://github.com/WebFiori/json/releases"><img src="https://img.shields.io/github/release/WebFiori/json.svg" /></a> |
| [UI](https://github.com/WebFiori/ui) | <a href="https://github.com/WebFiori/ui/actions"><img src="https://github.com/WebFiori/ui/workflows/Build%20PHP%208.2/badge.svg?branch=master"></a> | <a href="https://github.com/WebFiori/ui/releases"><img src="https://img.shields.io/github/release/WebFiori/ui.svg" /></a> |
| [Collections](https://github.com/WebFiori/collections) | <a href="https://github.com/WebFiori/collections/actions"><img src="https://github.com/WebFiori/collections/workflows/Build%20PHP%208.2/badge.svg?branch=master"></a> | <a href="https://github.com/WebFiori/collections/releases"><img src="https://img.shields.io/github/release/WebFiori/collections.svg" /></a> |
| [Database](https://github.com/WebFiori/database) | <a href="https://github.com/WebFiori/database/actions"><img src="https://github.com/WebFiori/database/workflows/Build%20PHP%208.2/badge.svg?branch=main"></a> | <a href="https://github.com/WebFiori/database/releases"><img src="https://img.shields.io/github/release/WebFiori/database.svg" /></a> |
| [CLI](https://github.com/WebFiori/cli) | <a href="https://github.com/WebFiori/cli/actions"><img src="https://github.com/WebFiori/cli/workflows/Build%20PHP%208.2/badge.svg?branch=main"></a> | <a href="https://github.com/WebFiori/cli/releases"><img src="https://img.shields.io/github/release/WebFiori/cli.svg" /></a> |
| [Mailer](https://github.com/WebFiori/mail) | <a href="https://github.com/WebFiori/mail/actions"><img src="https://github.com/WebFiori/err/workflows/Build%20PHP%208.2/badge.svg?branch=main"></a> | <a href="https://github.com/WebFiori/mail/releases"><img src="https://img.shields.io/github/release/WebFiori/mail.svg" /></a> |
| [Errors and Exceptions Handler](https://github.com/WebFiori/err) | <a href="https://github.com/WebFiori/err/actions"><img src="https://github.com/WebFiori/err/workflows/Build%20PHP%208.2/badge.svg?branch=main"></a> | <a href="https://github.com/WebFiori/err/releases"><img src="https://img.shields.io/github/release/WebFiori/err.svg" /></a> |

## Problems Solved

One of the things that any developer cares about any software project is the problem or problems it solves. As for WebFiori framework, It can help in solving the following problems:
* The ability to create a customized links to web pages as needed by using [Routing](https://webfiori.com/learn/routing).
* No need for touching HTML to play with the DOM by using [UI Library](https://webfiori.com/learn/ui-package) of the framework.
* Run PHP code as a CRON task through HTTP protocol or through terminal as a [Background Job](https://webfiori.com/learn/background-tasks).
* Changing whole user interface by changing one line of code throgh [Theming](https://webfiori.com/learn/themes).
* Changing whole user interface by changing one line of code through [Theming](https://webfiori.com/learn/themes).
* Ability to move the source code of the web application without having to do a lot of re-configuration.
* [Sending HTML email](https://webfiori.com/learn/sending-emails) messages with attachments without having to write a lot of code.
* Solved the issues which are found in default PHP session management implementation by implementing a custom [Sessions Management System](https://webfiori.com/learn/sessions-management).
* Reduce the number of dependencies at which a developer need to setup a web application.
* Reduce the number of dependencies at which a developer need to set up a web application.

## Getting Started

To learn the basics of how to use the framework, please head on to https://webfiori.com/learn. You can also read samedocs docs which can be found in [docs repo](https://github.com/usernane/wf-docs). In addition to that, you can read the API docs of the framework at [the official website](https://webfiori.com/docs).
To learn the basics of how to use the framework, please head on to https://webfiori.com/learn. You can also read same docs which can be found in [docs repo](https://github.com/usernane/wf-docs). In addition to that, you can read the API docs of the framework at [the official website](https://webfiori.com/docs).


## Setup

### Local Development Environment

If you plan to test the framework on your local machine, the recomended way is to have AMP stack (Apache, MySQL and PHP). There are many available online. We suggest to use the ones that are offered by Bitnami. You can go to https://bitnami.com/stacks/infrastructure to check the available options.
If you plan to test the framework on your local machine, the recommended way is to have AMP stack (Apache, MySQL and PHP). There are many available online. We suggest to use the ones that are offered by Bitnami. You can go to https://bitnami.com/stacks/infrastructure to check the available options.

After installing AMP stack, you can ethier use composer to install the framework or install it manually by download it throgh https://webfiori.com/download. If you plan to use composer, then you must first download composer from their website: https://getcomposer.org/download/. Once downloaded, place the `.phar` file in the folder `htdocs` or your server root. Once you do that, run the terminal in `htdocs` and run the following command:
After installing AMP stack, you can either use composer to install the framework or install it manually by download it through https://webfiori.com/download. If you plan to use composer, then you must first download composer from their website: https://getcomposer.org/download/. Once downloaded, place the `.phar` file in the folder `htdocs` or your server root. Once you do that, run the terminal in `htdocs` and run the following command:

```
php composer.phar create-project --prefer-dist webfiori/app my-site
```
This command will create new folder with the name `my-site` and install the framework inside it.

For more information about how to setup the framework, [check here](https://webfiori.com/learn/installation).
For more information about how to set up the framework, [check here](https://webfiori.com/learn/installation).


## Contribution

For information on how to contribute to the project, [check here](https://webfiori.com/contribute).

## Notes
* This project is started as a hoppy project.
* The main aim of this project is learning.
* If you think that there is a better way of doing things or wants new feature, feel free to [drop an issue](https://github.com/WebFiori/framework/issues/new).
* To report security vulnerabilities, please send an email to [[email protected]](mailto:[email protected]).
* To report security vulnerabilities, please email [[email protected]](mailto:[email protected]).

## License

Expand Down
30 changes: 15 additions & 15 deletions app/config/AppConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AppConfig implements Config {
*
* @since 1.0
*/
private $appVestion;
private $appVersion;
/**
* The name of base website UI Theme.
*
Expand All @@ -57,7 +57,7 @@ class AppConfig implements Config {
*/
private $baseThemeName;
/**
* The base URL that is used by all web site pages to fetch resource files.
* The base URL that is used by all website pages to fetch resource files.
*
* @var string
*
Expand All @@ -73,13 +73,13 @@ class AppConfig implements Config {
*/
private $configVision;
/**
* Password hash of CRON sub-system.
* Password hash of scheduler sub-system.
*
* @var string
*
* @since 1.0
*/
private $cronPass;
private $schedulerPass;
/**
* An associative array that will contain database connections.
*
Expand Down Expand Up @@ -129,7 +129,7 @@ class AppConfig implements Config {
*/
private $primaryLang;
/**
* The character which is used to saperate site name from page title.
* The character which is used to separate site name from page title.
*
* @var string
*
Expand All @@ -155,7 +155,7 @@ public function __construct() {
$this->initSiteInfo();
$this->initDbConnections();
$this->initSmtpConnections();
$this->cronPass = 'NO_PASSWORD';
$this->schedulerPass = 'NO_PASSWORD';
}
/**
* Adds SMTP account.
Expand Down Expand Up @@ -217,7 +217,7 @@ public function getAdminThemeName() : string {
/**
* Returns the name of base theme that is used in website pages.
*
* Usually, this theme is used for the normally visitors of the web site.
* Usually, this theme is used for the normally visitors of the website.
*
* @return string The name of base theme that is used in website pages.
*/
Expand All @@ -228,7 +228,7 @@ public function getBaseThemeName() : string {
* Returns the base URL that is used to fetch resources.
*
* The return value of this method is usually used by the tag 'base'
* of web site pages.
* of website pages.
*
* @return string The base URL.
*/
Expand All @@ -246,12 +246,12 @@ public function getConfigVersion() : string {
return $this->configVision;
}
/**
* Returns sha256 hash of the password which is used to prevent unauthorized access to run the jobs or access CRON web interface.
* Returns sha256 hash of the password which is used to prevent unauthorized access to run the tasks or access scheduler web interface.
*
* @return string Password hash or the string 'NO_PASSWORD' if there is no password.
*/
public function getCRONPassword() : string {
return $this->cronPass;
public function getSchedulerPassword() : string {
return $this->schedulerPass;
}
/**
* Returns database connection information given connection name.
Expand Down Expand Up @@ -282,7 +282,7 @@ public function getDBConnections() : array {
return $this->dbConnections;
}
/**
* Returns the global title of the web site that will be used as default page title.
* Returns the global title of the website that will be used as default page title.
*
* @param string $langCode Language code such as 'AR' or 'EN'.
*
Expand All @@ -299,7 +299,7 @@ public function getDefaultTitle(string $langCode) {
}
}
/**
* Returns the global description of the web site that will be used as default page description.
* Returns the global description of the website that will be used as default page description.
*
* @param string $langCode Language code such as 'AR' or 'EN'.
*
Expand Down Expand Up @@ -376,7 +376,7 @@ public function getTitleSep() : string {
* form 'x.x.x.x'.
*/
public function getVersion() : string {
return $this->appVestion;
return $this->appVersion;
}
/**
* Returns a string that represents application release type.
Expand Down Expand Up @@ -465,7 +465,7 @@ private function initSmtpConnections() {
* @since 1.0
*/
private function initVersionInfo() {
$this->appVestion = '1.0';
$this->appVersion = '1.0';
$this->appVersionType = 'Stable';
$this->appReleaseDate = '2021-01-10';
}
Expand Down
14 changes: 7 additions & 7 deletions app/config/Env.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static function defineEnvVars() {
* The value of this constant is passed to the function 'date_default_timezone_set()'.
* This one is used to fix some date and time related issues when the
* application is deployed in multiple servers.
* See http://php.net/manual/en/timezones.php for supported time zones.
* See https://php.net/manual/en/timezones.php for supported time zones.
* Change this as needed.
*
* @var string
Expand Down Expand Up @@ -103,20 +103,20 @@ public static function defineEnvVars() {
*/
define('LOAD_COMPOSER_PACKAGES', true);
}
if (!defined('CRON_THROUGH_HTTP')){
if (!defined('SCHEDULER_THROUGH_HTTP')){
/**
* A constant which is used to enable or disable HTTP access to cron.
* A constant which is used to enable or disable HTTP access to background tasks control panel.
*
* If the constant value is set to true, the framework will add routes to the
* components which is used to allow access to cron control panel. The control
* panel is used to execute jobs and check execution status. Default value is false.
* components which is used to allow access to tasks control panel. The control
* panel is used to execute tasks and check execution status. Default value is false.
*
* @var boolean
*
* @since 1.0
*
*/
define('CRON_THROUGH_HTTP', false);
define('SCHEDULER_THROUGH_HTTP', false);
}
if (!defined('WF_VERBOSE')){
/**
Expand Down Expand Up @@ -160,7 +160,7 @@ public static function defineEnvVars() {
/**
* Host name to use in case the system is executed through CLI.
*
* When the application is running throgh CLI, there is no actual
* When the application is running through CLI, there is no actual
* host name. For this reason, the host is set to 127.0.0.1 by default.
* If this constant is defined, the host will be changed to the value of
* the constant. Default value of the constant is 'example.com'.
Expand Down
4 changes: 2 additions & 2 deletions app/ini/InitCron.php → app/ini/InitTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace app\ini;

class InitCron {
class InitTasks {
/**
* A method that can be used to initialize cron jobs.
* A method that can be used to register background tasks.
*
* @since 1.0
*/
Expand Down
Loading

0 comments on commit 4fa2fe0

Please sign in to comment.