Download the PHP package godfreybwaira/shani without Composer

On this page you can find all versions of the php package godfreybwaira/shani. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package shani

# Shani Web Application Framework

Shani is an open source web framework designed to enable fast application development with minimal efforts while performance, security, creativity and modern web application development practices coexists.

Use Cases

Use Shani to build cilent-side or server-side application. You can also use your favorite front-end framework while Shani stands on back-end, or vice versa.

Main Features

  1. Scalability
  2. Robust (Error torelancy)
  3. Secure (CSRF, Session Mgt, Authentication & Authorization)
  4. Fast
  5. Multiprosess
  6. Multithreaded
  7. Event driven
  8. Non-blocking
  9. HMVC
  10. Zero dependency
  11. Dynamic Routing
  12. Built-in web server
  13. Web socket supports
  14. State Management
  15. Third-party library support
  16. Best practices API supports
  17. Supports JSON, XML, YAML, CSV and HTML
  18. Load balancing (Round robin, preemptive, fixed)
  19. Memory Management
  20. Asynchronous

System requirements

Shani runs well on Linux and Mac OS, However for Windows users they can use Windows Subsystem for Linux (WSL).

Installation

No installation is required.

Usage

To start Shani application web server, run the following command on terminal:

1.0 Project Structure

Shani Application has the following project structure

/root
    apps/ (Contains user applications. Create your applications here)
    config/ (Contains important server and hosts configurations)
        hosts/ (Contains host configurations files (hostname.yml). Register your application here)
            localhost.yml (can be customized)
        ssl/ (Contains server ssl certificate files for)
        mime.yml
        server.yml (Server configuration are written here, and can be customized.)
    gui/ (Contains support for GUI building)
        assets/ (Contains static files e.g: .css, .js,fonts etc shared by all applications)
        html/ (Contains html templates comes with framework)
    library/ (Contains files comes with framework that can be used directly by user application)
    shani/ (Contains core framework files)
    index.php (The entry point of a Shani application)

1.0.1 User Application Structure

All folders below can be renamed. A typical user application folder structure may appear as the following:

apps/
    demo/
        modules/
            module1_name/ (Can be any desired module name)
                data (Data layer)
                    dto (Data transfer object)
                    models (Application models)
                logic (Business logic layer)
                    services
                    controllers/
                        get/ (This is the request method as directory)
                            Resource.php (Can be any resource file)
                presentation (Presentation layer)
                    views/
                        resource/ (All lowercase, must match resource file name)
                    lang/
                        resource/ (All lowercase, must match resource file name)
                    breadcrumb/
                        resource/ (All lowercase, must match resource file name)
                            functions/
                                function-name.php (Must match function name in resource file class)
                            resource.php (must match module name)
                        module1_name.php (must match module name)

Let's assume we want to create an application called demo, our application has one module called school and one resource file called Hello.php.

Now, look at the following example of a resource file:

Creating a view file: (apps/demo/modules/schools/presentation/views/hello/world.php)

Considering our example above, our application folder structure will be like this:

apps/
    demo/
        modules/
            schools/
                data
                    dto
                    models
                logic/
                    controllers/
                        get/
                            Hello.php
                presentation
                    views/
                        hello/
                            world.php

1.0.2 Registering Application

The next step is to register our application so that it can be available on the web. You can do this by going to /config/hosts/ and create a configuration file called localhost.yml. You can choose any name.

Remember! Each application MUST have it's own configuration file

The following is the default application configuration that comes with Shani

Let us customize this file to fit our application needs:

The next step is to create these configuration class files. We will create them under apps/demo/config/. Some content can be like so:

1.0.2.1 Aliases

Let us assume our application is available through http://localhost:8008, we also want our application to be available via http://127.0.0.1:8008, and http://example.local, or more...

There comes the concept of aliases, it is when the application is available via more than one host name. Just like we created localhost.yml file, we're going to create 127.0.0.1.alias file and example.local.alias file.

Remember The file localhost.yml must be available before creating .alias file, otherwise your server will crush

127.0.0.1.alias file contents

example.local.alias file contents

As we have seen, all .alias files must contains a host name they point to. This is how you create alias(es) in Shani application.

1.0.3 Running The Application

Again, let's assume our application is available via localhost:8008. The default ports for our web server is 8008 for HTTP and port 44380 for HTTPS. We can use the following URL to call our function world.

Congratulation! You have completed the first step to become a Shani developer.

2.0 URL structure

Shani application follows the following URL pattern

Breaking down the pattern above, we can see that

Example:

Shani application uses kebab to camel case conversion to convert URL into valid names.

  1. module-name in URL represents a module-name directory in project structure.
  2. resource-name in URL represents a ResourceName class in module-name directory, and resource-name directory in a view directory
  3. function-name in URL represents a functionName in a ResourceName class file, and a function-name.php view in a view directory

Other URL parts remain unchanged.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GPL-3.0


All versions of shani with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
swoole Version >=5.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package godfreybwaira/shani contains the following files

Loading the files please wait ...