Download the PHP package slogsdon/flat-file without Composer

On this page you can find all versions of the php package slogsdon/flat-file. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flat-file

flat-file

Latest Stable Version Total Downloads Latest Unstable Version License Build Status Maintainability Test Coverage

Fast static-site generator / flat-file CMS

View an example project.

Features

Reasoning

PHP is easy to install, if not already present on you computer. PHP runs pretty much everywhere. PHP is flexible.

This project also scratches an itch to see how much PHP can handle in this problem domain.

Requirements

Getting Started

The scripts and config sections are not required, but they do help simplify the development process. If using the start script, the process-timeout configuration option allows Composer to run a script for longer than the default timeout (300 seconds).

If not using Composer script configurations, you'll need to reference the flat-file script as vendor/bin/flat-file, e.g.:

After setting up your composer.json file, don't forget to pull down your dependencies:

Adding Content

Next, your individual pages need to be included in a pages directory at the root of your project (i.e. next to your composer.json file). Pages can be written in Markdown (with the .md or .markdown file extension), plain HTML, or PHP (with the .php file extension). PHP files have the option of outputing the content as normal (echo, print, content outside of ` tags, etc.) or returning the content as a string (<?php return 'hello world';`).

Add more pages with new files under pages, e.g.:

Running the Development Server

Ready to test? Spin up the development server:

This will start a PHP development server listening on http://localhost:3000. Pressing Ctrl-C will stop the server, freeing the way for building your project to plain HTML files for later deployment.

Building Static Files

Kick off a build of the site:

Ignoring Composer's vendor directory, you should see something similar to below in your project root once all is said and done:

Using a Custom Entrypoint

By default, we provide an entrypoint for the webserver to use when serving requests. It completes some rewrites for files in public, requires the Composer autoloader, and kicks off the application. You can elect to include your own by creating a new entrypoint named index.php and put it in the public directory at the root of your project. Here's the default one for reference:

Running as a Flat-File CMS

If you wish to run your project with a PHP-enabled web server as a flat-file CMS instead of a static site, you'll want to:

  1. Configure your web root to be public
  2. Use a custom entrypoint or configure your web server to have vendor/slogsdon/flat-file/src/router.php serve any non-existent paths.

Your web server will then be able to serve static assets from public as it normally would and also any pages you create.

F.A.Q.

What about LiveReload like functionality?
That's being investigated, but use F5/Cmd-R for the time being.

License

This project is licensed under the MIT License. See LICENSE for details.


All versions of flat-file with dependencies

PHP Build Version
Package Version
Requires php Version ~7.1
league/commonmark Version ^0.17.5
spatie/yaml-front-matter Version ^2.0
symfony/console Version ^4.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package slogsdon/flat-file contains the following files

Loading the files please wait ....