Giter Site home page Giter Site logo

kytschi / kytschbasic Goto Github PK

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

kytschBASIC is a PHP module written in Zephir-lang that will allow you to write BASIC code to render flat html. kytschBASIC is heavily inspired by Amiga BASIC a language I loved on a machine that is still amazing. https://kytschbasic.org

Home Page: https://kytschbasic.org

PHP 0.02% CSS 1.16% Zephir 98.58% Shell 0.24%
basic php zephir zephir-language

kytschbasic's Introduction

kytschBASIC

A PHP module written in Zephir that will allow you to run a version of BASIC language called kytschBASIC.

Installation

First thing you will need is to install Zephir

Now open your favourite terminal/console and clone the repo.

git clone https://github.com/kytschi/kytschBASIC.git

OR

git clone [email protected]:kytschi/kytschBASIC.git

Building the kytschBASIC PHP module.

cd kytschBASIC/kytschbasic
zephir build

Enable the kytschBASIC module. You can copy the sample ini file from the php folder in this repo. Remember to do this as root or a user with administrator permissions.

cp kytschBASIC/php/kytschBASIC.ini /etc/php/7.4/mods-available/

And don't forget to restart the PHP service.

Next setup an index.php on your webserver of choice and tell it to load the kytschBASIC compiler.

<?php
use KytschBASIC\Compiler;

(new Compiler(__DIR__ . '/../kytschbasic-config.json'))->run();

NOTICE we are loading in the configuration file. See configuration for more information on how to setup the configuration file.

For example website checkout the example folder in this repo.

Configuration

kytschBASIC configuration is handled via a JSON config file. From there you can define the database connection, the routes, etc. kytschBASIC example config

Database

The configuration for the database connection if needed. You can define more than one.

"db":[
	{
		"name":"kytschBASIC", 		<-- Name of the connection
		"type": "mysql", 		<-- Connection type
		"host": "127.0.0.1",		<-- Host IP
		"port": 3306,			<-- Host port
		"dbname": "kytschBASIC",	<-- Name of the database
		"user": "user",			<-- Username that has access
		"password": "password"		<-- Password of the user
	}
]

Routes

The routes allow you to define what kytschBASIC template is to be loaded for a specific URL or route.

"router":[
	{
		"url": "/",			<-- The URL/route that corresponds to the template.
		"template": "project/index.kb"	<-- The kytschBASIC template. Be sure to include its folder if its in one.
	},
	{
		"url": "/about",
		"template": "project/about.kb"
	},
	{
		"url": "/installation",
		"template": "project/installation.kb"
	},
	{
		"url": "/news",
		"template": "project/news.kb"
	}
]

More information

For more information and a to view the available command set please visit https://kytschbasic.org

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.