User Tools

Site Tools


getting_started

Getting started with Platform

Background

Platform is a fullstack PHP framework designed for database-dependent applications, with a closely tie between PHP objects and objects in databases. The frontend part is based on JQuery, but can be skipped entirely or integrated with other more complex frameworks.

The framework is intended to make development of PHP applications very fast, and making it easy to implement new ideas. At the same time the framework is intended to be very easy to understand and adapt and does not introduce any complex topics on top of the programming languages already used.

Software requirements

Platform runs on PHP and requires a MySQL (or compatible) database. It is expected to run on Linux.

Architecture of platform apps

Platform can either be configured as a single-application framework, which then only supports a single application, or it can be configured for running instances, which are unlimited copies of the same application, each with their own database and file structure.

Programming something like Facebook would be considered a single application, since every user on the platform is using the same application and interact with each other. Programming something like Confluence, would be done with instances, since each organization should have their own instance of the software, where the data shouldn't be mixed with the data of any other organization.

Installing platform

Copy the code into your website folder and go to the website root. An interactive procedure will guide you through configuring the platform. You will need to have your database credentials ready, and decide where Platform is going to store files, and make these locations writeable by the web user.

Platform4PHP will write a configuration file one level up from the web site root, so it need to be able to do so.

If you are configuring for instances, then the local database user should have full permissions, including creating and dropping databases, as it is needed when creating instances.

Store folders should be writable for the web user, but doesn't have to reside in the web root.

Lastly you need to setup a PHP cron job, if you want to use the Platform Scheduler.

Demo example

Navigate to https://YOURSERVERNAME/demo/ to see a quick demo of Platform and get a feeling of the instance feature. Select “Create instance” and fill the form and click “Create instance” again.

A new instance have now been created with a test user. Observe that a new database is created. You can log out of this instance and into it again. You can also create further instances if you want to, or destroy the instances you have already created.

Where to go next?

You can start by navigating to the tutorial which explains in detail how the demo is constructed from scratch going through all the possibilities in Platform.

Otherwise go to the classes hierarchy to browse the different platform components or start building your own application. The first step in building your own application is to create a subclass of the Instance class to contain your own objects and logic, which is implemented using the Datarecord class. For the frontend part of Platform start with the Component class.

Otherwise it is just to explore the other classes in Platform and start coding away. The aim of Platform is to be easy and highly productive, keeping focus on your own ideas while handling all basic things such as database objects, forms, tables and other things as easy and with as little code as possible.

getting_started.txt · Last modified: 2024/02/14 14:16 by sahl

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki