GithubHelp home page GithubHelp logo

discontinued-framework's Introduction

#Sambhuti

##Requirements

  • php5.4
  • SPL library

##Setting up:

  • After moving the sample app out it has become a little tricky to set it up. I will upload the sample app as soon as I find some time to finish it.

discontinued-framework's People

Contributors

gmaybrun avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

discontinued-framework's Issues

Views

Default views in Sambhuti are supposed to have content generation capabilities.

There wont be any templating language like twig or smarty, just plain old variables with helper methods (accessible via $this)

They are supposed to have 3 levels of caching/generation capabilities.

  1. No caching, direct php variables (for development version)
  2. Complete code generation like jekyll for example
  3. Semi-cached, where most unchanging stuff is cached with generated php variables for the rest.

Option 3 necessitates a different implementation at controller level as the cached variables are not supposed to be generated on each request saving time.

Eg: in a page, nav bar remains consistent while other elements like "welcome $user" are dynamic.

Nav bar changes slower than those elements, this calls for the need to have separate implementation for both to get maximum performance.

Usually this is solved at controller level by making a cache of generated content and making a check like

class controller {
    function index() {
        $cache = new cache('navstring');
        if(!$cache->usable()) {
            //lot of processing
            $cache->save($data);
        }
        $this->response->add('nav',$cache->get());
        //Add  other variables which need to be processed on every request
    }
}

With sambhuti you can have a separate method which is only called in the first run to let you set the caching variables which get cached directly into the template instead of having you write a separate caching mechanism.

We're yet to work out the details of this mechanism. Feel free to post ideas below :)

┆Issue is synchronized with this Asana task

Move to php 5.4

With the way templates were finally planned to work, we could really use callable typehint and traits can help make some modules unnecessary.

┆Issue is synchronized with this Asana task

Complete CLI support

Basic commands like

$ cd /var/www/
$ sambhuti app my_site
$ cd my_site/
$ sambhuti configure database host=localhost user=dbuser pass=dbpass name=mysite_db
$ sambhuti generate models

And similar commands to generate controllers and views etc.

┆Issue is synchronized with this Asana task

Model Generators

Basic DAO models should be auto generated from the db schema.

Initially we can go with simple get by primary and unique keys of a table one giant save option and updates for all singular fields.

We have to find a middle ground between queries generated on the fly and php-generated classes.

The general structure of models right now is that every table has one class. We generate methods for basic CRUD with primary and unique keys.
Every generated model is saved as a base class and an empty class is made for the user to be able to edit to override/add new methods of their own.

TODO: add a pseudo code example here

┆Issue is synchronized with this Asana task

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.