Download the PHP package attogram/attogram-framework without Composer
On this page you can find all versions of the php package attogram/attogram-framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download attogram/attogram-framework
More information about attogram/attogram-framework
Files in attogram/attogram-framework
Package attogram-framework
Short Description The Attogram Framework provides developers a PHP skeleton starter site with a content module system, file-based URL routing, IP-protected backend, Markdown parser, jQuery and Bootstrap. Core modules available to add an integrated SQLite database with web admin, user system, and more.
License (MIT or GPL-3.0+)
Homepage https://github.com/attogram/attogram
Informations about the package attogram-framework
Attogram Framework
The Attogram Framework provides developers a PHP skeleton starter site with a content module system, file-based URL routing, IP-protected backend, Markdown parser, jQuery and Bootstrap.
Core modules available to add a SQLite database with web admin, user system, and more.
After that, Attogram tries to stay out of your way while you do your thing!
More Info
- Attogram Framework @ GitHub: https://github.com/attogram/attogram
- Attogram Framework @ Packagist: https://packagist.org/packages/attogram/attogram-framework
- Attogram Framework @ Travis CI: https://travis-ci.org/attogram/attogram
- Attogram Framework vendor package @ GitHub: (download ZIP) https://github.com/attogram/attogram-vendor
Requirements
- PHP 5.3.3 or higher, or PHP7
- PHP installed with SQLite PDO driver
- Apache 2.2.16 or higher, with setting: AllowOveride all
Setup: Install
-
Get Attogram:
- use Composer:
composer create-project attogram/attogram-framework your-install-directory
-
or manually install:
- Download latest code from GitHub:
https://github.com/attogram/attogram/archive/master.zip
- If composer is not available, also download the vendor distribution from
https://github.com/attogram/attogram-vendor/archive/master.zip
and move the./vendor/
directory to the top level of your install directory.
- use Composer:
- Setup your web server to use the
./public/
directory as the web site root. - edit
./public/.htaccess
, set FallbackResource, ErrorDocument 403 and ErrorDocument 404 to the full web path to the index.php file in the install directory. - (optional) copy
./public/config.sample.php
to./public/config.php
and edit to change default settings .
Setup: Admin
- admin pages are IP protected
- change the allowed admin IPs by setting
$config['admins']
in./public/config.php
- default admin IPs is localhost in ip4 and ip6:
array( '127.0.0.1', '::1' )
- admin page requests from non-admin IPs will result in a 404 Page Not Found error
Attogram now has modules! Updated docs coming soon
OLD DOCS
Setup: Database
- Install the Attogram Database Module
- Make sure the database file
./db/global
is writeable by the web server - Tables are lazily created when needed.
- To create all tables at once, goto the db-tables admin page and click Create Attogram Tables
- phpLiteAdmin is available for database administration, goto the db-admin admin page, default password is attogram
Setup: Users
- load the homepage, goto admin action users, click Create New User
- enter username, password, etc. and click Insert
- load the homepage, click login, login as the new user
Attogram Modules
- Easily create modules to extend Attogram!
- Each module lives in its own subdirectory within the Attogram
./modules/
directory.
Module Structure
-
Modules may have the following subdirectories:
actions/
- The Public Actions (.php or .md markdown files) If present, thehome
action is used as the home page.admin_actions/
- The backend admin-only Actions (.php or .md markdown files)configs/
- Configurations vianamespace Attogram; global $config; $config['configname'] = ...
, loaded at startup (.php files only)includes/
- Included files, loaded at startup (.php files only)tables/
- Database table definitions. Tables are created lazily as needed (.sql files only)templates/
- Templates, to override default Attogram templates (.php files only)public/
- Files for public consumption. Served via requests to theweb/
virtual web directory
-
Modules are loaded in directory list order.
- Actions and files cascade: a duplicate action name or file will overwrite any previous modules action or file of the same name.
Core Modules
- Attogram Module Manager - https://github.com/attogram/attogram-modulemanager
- Attogram Database - https://github.com/attogram/attogram-database
- Attogram User - https://github.com/attogram/attogram-user
- Attogram Info - https://github.com/attogram/attogram-info
- Attogram Contact Form - https://github.com/attogram/attogram-contactform
Create a page
- create a new PHP or Markdown file in the
./actions/
directory, add anything you want! - The filename is used as the page URL. ./actions/example.php = example.com/example/
PHP pages
- PHP filenames must end in
.php
- The Attogram object is available via the
$this
variable -
Helpful functions:
- $this->pageHeader($title)
- $this->pageFooter()
- $this->log->debug(), ->error(), etc.
- $this->getSiteUrl()
- $this->error404($error_message)
- $this->isAdmin()
- $this->isLoggedIn()
-
Depth settings in
./public/config.php
$config['depth']['insert-action-name-here']
-
End Slash settings in
./public/config.php
$config['noEndSlash'][] = 'insert-action-name-here'
Markdown pages
- Markdown filenames must end in
.md
- The first line of the Markdown file is used as the page title
Remove a page
- delete the pages corresponding file from the
./actions/
directory
Admin pages
- create/delete the same as normal pages, but in the
./admin_actions/
directory
Database tables
- To add a table, add a file into
./tables/
directory - The filename must be the name of the table
- File content is the sql
CREATE TABLE ...
statement - tables are automatically created upon first use
Web discovery
- If
./robots.txt
does not exist, Attogram dynamically serves it, with a link to the Sitemap - If
./sitemap.xml
does not exist, Attogram dynamically serves it, with a listing of all public pages
Admin URL overrides
- admins may use URL/
?noadmin
on any page to turn off admin access - admins may use URL/
?debug
on any page to turn on debugging
All versions of attogram-framework with dependencies
ext-pdo Version *
ext-pdo_sqlite Version *
psr/log Version ~1.0
monolog/monolog Version ~1.20
symfony/http-foundation Version ~3.1.2
erusev/parsedown Version ~1.6
erusev/parsedown-extra Version ~0.7.1