Giter VIP home page Giter VIP logo

silverengine / framework Goto Github PK

View Code? Open in Web Editor NEW
22.0 14.0 18.0 5.73 MB

SilverEngine is a powerful PHP Dynamical MVC framework with self-updating features, built for developers who need a simple and elegant toolkit to create powerfull full-featured web applications. discord: https://discord.gg/cwMygSP

Home Page: https://silverengine.net

License: MIT License

PHP 95.02% Smarty 1.66% CSS 0.84% Hack 2.48% Shell 0.01%

framework's Introduction

SILVER ENGINE FRAMEWORK

SilverEngine is a powerful PHP Dynamical MVC framework built for developers who need a simple and elegant toolkit to create powerfull full-featured web applications.

Licence PHP5.6 version Alpha

Check Demo portfolio

Download zip demo file Download here

Documentation

The Documentation of the framework is still work in progress (WIP). The WIKI WIKI Documentation of the framework is still work in progress (WIP).

install

Webpage silverengine.net

Documentation Documentation

Download and setup

  1. Download master version 1.0.3 Download now
  2. Setup host configuration for webserver apache2 or nginix and point to public/ directory
  3. Run composer update

Tutorial how to create a blog

We prepare simple tutorial how to work with SilverEngine How to create a blog

Tutorial how to use ReflectORM (SilverEngine ORM)

We prepare simple tutorial how to work with SilverEngine ReflectORM

Tutorial how to use Ghost TE (Ghost template engine)

Our brand new Template engine - tutorials still WIP How to work with Ghost template engine

Contributing

Thank you for considering contributing to the framework!

Special thanks

Rules to follow

  1. Same tree structure
  2. PSR-4 and PSR-2
  3. Namespace need to start with an Alias \Silver\
  4. Follow manual for pagkagist Packagist docs
  5. (Optional) join us on Discord server Join here
  6. Make docs with .MD
  7. Code need to be unit tested - php v5.6 | PHPUnit

Tree

For easy use please Src/ file direct the namespace to alias

\Silver\<name of your project>\<classes>
<project root>
├─ config/
├─ docs/
├─ node_modules/
├─ public/
......└── index.php
├─ src/
......├── Controllers/
............└── DefaultController.php
......├── Facades/
......├── Helpers/
......├── Templates/
......└── Services/
├─ tests/
├─ translations/
├─ var/
......├─ cache/
......├─ log/
......└─ session/
├─ vendor/
└─ composer.json

Security & Vulnerabilities

If you discover a security vulnerability within our engine, please send us email at [email protected]

License

The Silver Engine framework is open-sourced software licensed under the MIT license.

framework's People

Contributors

evilfreelancer avatar kingsiller avatar lotfio avatar nejcc avatar nejcdev avatar nmarulo avatar oversoul avatar schemeza avatar silverengineteam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

framework's Issues

Migration problems

Quick fix solution

<?php

namespace App\Middlewares;

use App\Facades\Api;
use Firebase\JWT\JWT;
use Silver\Core\Blueprints\MiddlewareInterface;
use Silver\Core\Env;
use Silver\Http\Request;
use Silver\Http\Response;
use Closure;
use Silver\Http\Session;
use Silver\Http\Redirect;
class Migration implements MiddlewareInterface
{
    // put the name to make it public
    private $unguard = [
        'unguard',
    ];
    public function execute(Request $req, Response $res, Closure $next)
    {
        if ($req->route() == null) {
            return $next();
        }
        if (!array_search($req->route()->middleware(), $this->unguard) !== false) {
if(ENV::get('local') == 'local')
return $next();
            //Change here if you want to check if someone is loggin in owherwise use Error 404;
            return \Silver\Http\View::error('404');
        }
        return $next();
    }
}```

Model - problem with parameters

We need to fix problem with ReflectORM and model to filter the methods from App/Models/* $hidden, $selectable, $fiterable, $includable, $editable,...

Issue when i ran php silver g controller news command

I received this notice when i ran php silver g controller news as per documents. Is this issue related to my php version.

PHP Notice: Use of undefined constant DS - assumed 'DS' in /var/www/html/projects/silverEngine/System/Engine/CLI/index.php on line 227
PHP Notice: Use of undefined constant DS - assumed 'DS' in /var/www/html/projects/silverEngine/System/Engine/CLI/index.php on line 230
PHP Notice: Use of undefined constant DS - assumed 'DS' in /var/www/html/projects/silverEngine/System/Engine/CLI/index.php on line 230
PHP Warning: file(/var/www/html/projects/silverEngine/AppDSRoutesDSWeb.php): failed to open stream: No such file or directory in /var/www/html/projects/silverEngine/System/Engine/CLI/index.php on line 232
PHP Warning: Invalid argument supplied for foreach() in /var/www/html/projects/silverEngine/System/Engine/CLI/index.php on line 236
Route created!
controller news successfully created.

Ghost template - url

When the url has a port, for example 8080, using {{url('/mypage')}} returns http://localhost/mypage and not http://localhost:8080/mypage

creating new controller : php silver g controller Logger

PHP Notice: Use of undefined constant DS - assumed 'DS' in /root/Framework/System/Engine/CLI/index.php on line 227
PHP Stack trace:
PHP 1. {main}() /root/Framework/silver:0
PHP 2. Silver\Engine\CLI->__construct() /root/Framework/silver:54
PHP 3. Silver\Engine\CLI->run() /root/Framework/System/Engine/CLI/index.php:35
PHP 4. Silver\Engine\CLI->make() /root/Framework/System/Engine/CLI/index.php:42
PHP 5. Silver\Engine\CLI->generate() /root/Framework/System/Engine/CLI/index.php:96
PHP 6. Silver\Engine\CLI->generateFile() /root/Framework/System/Engine/CLI/index.php:182
PHP 7. Silver\Engine\CLI->fix_routes() /root/Framework/System/Engine/CLI/index.php:196

Notice: Use of undefined constant DS - assumed 'DS' in /root/Framework/System/Engine/CLI/index.php on line 227

Call Stack:
0.0002 357872 1. {main}() /root/Framework/silver:0
0.0016 520488 2. Silver\Engine\CLI->__construct() /root/Framework/silver:54
0.0016 520488 3. Silver\Engine\CLI->run() /root/Framework/System/Engine/CLI/index.php:35
0.0016 520488 4. Silver\Engine\CLI->make() /root/Framework/System/Engine/CLI/index.php:42
0.0017 520488 5. Silver\Engine\CLI->generate() /root/Framework/System/Engine/CLI/index.php:96
0.0017 520648 6. Silver\Engine\CLI->generateFile() /root/Framework/System/Engine/CLI/index.php:182
0.0142 523568 7. Silver\Engine\CLI->fix_routes() /root/Framework/System/Engine/CLI/index.php:196

PHP Notice: Use of undefined constant DS - assumed 'DS' in /root/Framework/System/Engine/CLI/index.php on line 230
PHP Stack trace:
PHP 1. {main}() /root/Framework/silver:0
PHP 2. Silver\Engine\CLI->__construct() /root/Framework/silver:54
PHP 3. Silver\Engine\CLI->run() /root/Framework/System/Engine/CLI/index.php:35
PHP 4. Silver\Engine\CLI->make() /root/Framework/System/Engine/CLI/index.php:42
PHP 5. Silver\Engine\CLI->generate() /root/Framework/System/Engine/CLI/index.php:96
PHP 6. Silver\Engine\CLI->generateFile() /root/Framework/System/Engine/CLI/index.php:182
PHP 7. Silver\Engine\CLI->fix_routes() /root/Framework/System/Engine/CLI/index.php:196

Notice: Use of undefined constant DS - assumed 'DS' in /root/Framework/System/Engine/CLI/index.php on line 230

Call Stack:
0.0002 357872 1. {main}() /root/Framework/silver:0
0.0016 520488 2. Silver\Engine\CLI->__construct() /root/Framework/silver:54
0.0016 520488 3. Silver\Engine\CLI->run() /root/Framework/System/Engine/CLI/index.php:35
0.0016 520488 4. Silver\Engine\CLI->make() /root/Framework/System/Engine/CLI/index.php:42
0.0017 520488 5. Silver\Engine\CLI->generate() /root/Framework/System/Engine/CLI/index.php:96
0.0017 520648 6. Silver\Engine\CLI->generateFile() /root/Framework/System/Engine/CLI/index.php:182
0.0142 523568 7. Silver\Engine\CLI->fix_routes() /root/Framework/System/Engine/CLI/index.php:196

PHP Notice: Use of undefined constant DS - assumed 'DS' in /root/Framework/System/Engine/CLI/index.php on line 230
PHP Stack trace:
PHP 1. {main}() /root/Framework/silver:0
PHP 2. Silver\Engine\CLI->__construct() /root/Framework/silver:54
PHP 3. Silver\Engine\CLI->run() /root/Framework/System/Engine/CLI/index.php:35
PHP 4. Silver\Engine\CLI->make() /root/Framework/System/Engine/CLI/index.php:42
PHP 5. Silver\Engine\CLI->generate() /root/Framework/System/Engine/CLI/index.php:96
PHP 6. Silver\Engine\CLI->generateFile() /root/Framework/System/Engine/CLI/index.php:182
PHP 7. Silver\Engine\CLI->fix_routes() /root/Framework/System/Engine/CLI/index.php:196

Notice: Use of undefined constant DS - assumed 'DS' in /root/Framework/System/Engine/CLI/index.php on line 230

Call Stack:
0.0002 357872 1. {main}() /root/Framework/silver:0
0.0016 520488 2. Silver\Engine\CLI->__construct() /root/Framework/silver:54
0.0016 520488 3. Silver\Engine\CLI->run() /root/Framework/System/Engine/CLI/index.php:35
0.0016 520488 4. Silver\Engine\CLI->make() /root/Framework/System/Engine/CLI/index.php:42
0.0017 520488 5. Silver\Engine\CLI->generate() /root/Framework/System/Engine/CLI/index.php:96
0.0017 520648 6. Silver\Engine\CLI->generateFile() /root/Framework/System/Engine/CLI/index.php:182
0.0142 523568 7. Silver\Engine\CLI->fix_routes() /root/Framework/System/Engine/CLI/index.php:196

PHP Warning: file(/root/Framework/AppDSRoutesDSWeb.php): failed to open stream: No such file or directory in /root/Framework/System/Engine/CLI/index.php on line 232
PHP Stack trace:
PHP 1. {main}() /root/Framework/silver:0
PHP 2. Silver\Engine\CLI->__construct() /root/Framework/silver:54
PHP 3. Silver\Engine\CLI->run() /root/Framework/System/Engine/CLI/index.php:35
PHP 4. Silver\Engine\CLI->make() /root/Framework/System/Engine/CLI/index.php:42
PHP 5. Silver\Engine\CLI->generate() /root/Framework/System/Engine/CLI/index.php:96
PHP 6. Silver\Engine\CLI->generateFile() /root/Framework/System/Engine/CLI/index.php:182
PHP 7. Silver\Engine\CLI->fix_routes() /root/Framework/System/Engine/CLI/index.php:196
PHP 8. file() /root/Framework/System/Engine/CLI/index.php:232

Warning: file(/root/Framework/AppDSRoutesDSWeb.php): failed to open stream: No such file or directory in /root/Framework/System/Engine/CLI/index.php on line 232

Call Stack:
0.0002 357872 1. {main}() /root/Framework/silver:0
0.0016 520488 2. Silver\Engine\CLI->__construct() /root/Framework/silver:54
0.0016 520488 3. Silver\Engine\CLI->run() /root/Framework/System/Engine/CLI/index.php:35
0.0016 520488 4. Silver\Engine\CLI->make() /root/Framework/System/Engine/CLI/index.php:42
0.0017 520488 5. Silver\Engine\CLI->generate() /root/Framework/System/Engine/CLI/index.php:96
0.0017 520648 6. Silver\Engine\CLI->generateFile() /root/Framework/System/Engine/CLI/index.php:182
0.0142 523568 7. Silver\Engine\CLI->fix_routes() /root/Framework/System/Engine/CLI/index.php:196
0.0145 523696 8. file() /root/Framework/System/Engine/CLI/index.php:232

PHP Warning: Invalid argument supplied for foreach() in /root/Framework/System/Engine/CLI/index.php on line 236
PHP Stack trace:
PHP 1. {main}() /root/Framework/silver:0
PHP 2. Silver\Engine\CLI->__construct() /root/Framework/silver:54
PHP 3. Silver\Engine\CLI->run() /root/Framework/System/Engine/CLI/index.php:35
PHP 4. Silver\Engine\CLI->make() /root/Framework/System/Engine/CLI/index.php:42
PHP 5. Silver\Engine\CLI->generate() /root/Framework/System/Engine/CLI/index.php:96
PHP 6. Silver\Engine\CLI->generateFile() /root/Framework/System/Engine/CLI/index.php:182
PHP 7. Silver\Engine\CLI->fix_routes() /root/Framework/System/Engine/CLI/index.php:196

Warning: Invalid argument supplied for foreach() in /root/Framework/System/Engine/CLI/index.php on line 236

Call Stack:
0.0002 357872 1. {main}() /root/Framework/silver:0
0.0016 520488 2. Silver\Engine\CLI->__construct() /root/Framework/silver:54
0.0016 520488 3. Silver\Engine\CLI->run() /root/Framework/System/Engine/CLI/index.php:35
0.0016 520488 4. Silver\Engine\CLI->make() /root/Framework/System/Engine/CLI/index.php:42
0.0017 520488 5. Silver\Engine\CLI->generate() /root/Framework/System/Engine/CLI/index.php:96
0.0017 520648 6. Silver\Engine\CLI->generateFile() /root/Framework/System/Engine/CLI/index.php:182
0.0142 523568 7. Silver\Engine\CLI->fix_routes() /root/Framework/System/Engine/CLI/index.php:196

Route created!
controller Logger successfully created. (/root/Framework/App/Controllers/LoggerController.php)

Port problem with routing

When you run php -S 127.0.0.1:3000 -t public and try to ger not root url you get the same payload and always response http code 200 Fix ?

View not render second "with" method

public function index() {
        return View::make('clients.index')
                   ->with('clients', Clients::query()
                                            ->orderBy('id', 'desc')
                                            ->all())
                   ->with('messagesModal', [
                       'type'    => 'info',
                       'message' => 'test',
                   ]);
    }

messagesModal not show in View ?

Validator - refactoring

Class validator need suport from model and ReflectORM

  private static function checkExist($value, $model) 
    {
        //TODO: check
        return false;
    }

    private static function checkUnique($value) 
    {
        // TODO
        return false;
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.