Giter Site home page Giter Site logo

hamlet-legacy's Introduction

Foundation

Very simple PHP framework that is modelled as closely to HTTP specification as possible

Introduction

The list of core abstractions is quite short

  • Request - Data that either identifies the user (for example cookie, session, IP) or the data entered by the user (for example POST, GET variables). See it as an ugly object that is required to make the rest of the application code free from site effects
  • Resource - Pretty much what the REST specification has in mind when talking about resources.
  • Response - HTTP response including headers, session objects, and the payload
  • Entity - Sometimes optional payload of the response
  • Template - The wrapper objects that connects the template data with the template markup
  • Application - Main object that finds the requested resource given user's request

The additional helpful abstractions are

  • Locale - Localization object
  • Environment - Server environment where the application is deployed right now

The framework requires Memcached PHP extension to work.

Directory structure

  • library/{scope}/application - Application code
  • library/{scope}/core - Core of the framework that is required during runtime
  • library/{scope}/vendors - Vendors code that that is required during runtime
  • public - Public directory which is DocumentRoot in apache
  • utils - Scripts that are used during development, deployment or integration
  • library/build - Code that us used during development, deployment or integration
  • library/runtime - Runtime code
  • library/test - Test code

The number of scopes (library/{scope}) is not limited.

Class loader

The framework doesn't use any conventions for namespace to file mapping. Instead you have to generate the class loader by executing php utils/create-library-loader/run.php

Example application

The master branch contains a simple application for documentation purposes. The application is a simple todo list, with localizations, smarty templates, restful services and different environments.

Typescript

Debugging in PHPStorm

Install the PHPStorm LiveEdit extension Preferences -> Plugins -> Install JetBrains Plugin. Search for LiveEdit.

Setup the remote mapping using a deployment configuration Tools -> Deployment -> Configurations Create a new 'In place' configuration and enter your webserver url. Go to the 'Mappings' tab and map your local filesystem public directory to your webserver root. IMPORTANT - make sure you make it your default configuration by clicking teh server with teh green tick. Create a new javascript debug configuration. Run -> Edit Configurations Set the url to your server url

DOMinatrix

  • The usual initialization sequence is bottom to top (toward the root of the tree) through constructors and than back from the root to the top of the tree through init methods
  • The constructor signatures in the template and TypeScript files should match otherwise the container will compliant.

ToDo

  • Fix the TypeScript compilation so that the map & js files are not commited
  • Add watchers for Vagrant box
  • Remove js / css files after they have been merged on the preview task (see that it's not working on dev)

hamlet-legacy's People

Contributors

vasily-kartashov avatar dmarsland-etecture avatar

Stargazers

Mohammed Irfan avatar

Watchers

M. Nowak avatar James Cloos avatar  avatar Vinicius Cadore avatar

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.