GithubHelp home page GithubHelp logo

lasyard / lasys Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.1 MB

This is a simple PHP framework.

License: MIT License

JavaScript 3.54% TypeScript 28.06% SCSS 5.28% PHP 62.93% Dockerfile 0.19%

lasys's Introduction

lasys

PHP Composer NodeJS with Webpack

Lasys is a simple PHP framework.

Usage

Put lasys in your project:

cd "dir_of_your_project"
git clone "[email protected]:lasyard/lasys.git"

or as a submodule if your project is also managed by git:

git submodule add "[email protected]:lasyard/lasys.git"

Build the public resources:

npm install
npm run release-build

Create a directory to put the public resources:

mkdir "pub"

then make a symlink from lasys/pub to pub/sys:

ln -snf "lasys/pub" "pub/sys"

Create app entry entry.php. The contents of the file is like:

<?php
define('ROOT_PATH', __DIR__);
require_once 'lasys/src/sys.php';
Sys::app()->run();

It is crucial to put the file at the root of project, so that ROOT_PATH can be defined properly.

Rewrite all to entry.php except /pub. for example, in .htaccess:

DirectoryIndex disabled
Options -Indexes -Multiviews
RewriteEngine On

RewriteRule !^pub index.php [L,NS]

Config

Constants can be defined in entry.php. If one is not defined, it will be set to a default value.

date_default_timezone_set('Asia/Shanghai');
define('APP_TITLE', 'Lasys');     // The title of app.
define('CONFIG_DIR', 'configs');  // The dir of config files.
define('DATA_DIR', 'data');       // The root dir of website contents.
define('PUB_DIR', 'pub');         // The dir of public assets.
define('VIEW_DIR', 'views');      // The dir of view files.
define('ACTIONS_DIR', 'actions'); // The dir of actions.
define('SITE', 'unknown');        // For multi-site deployment.

The values defined above are default values.

There must be a directory named configs in the root of your project to put your config files. Config files are .php files.

lasys's People

Contributors

lasyard avatar

Stargazers

 avatar

Watchers

 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.