[//]: # ( Attogram Framework - README.md (markdown) - v0.1.19 )
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.
After that, Attogram tries to stay out of your way while you do your thing!
- 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
- PHP 5.3.3 or higher, or PHP7
- PHP installed with SQLite PDO driver
- Apache 2.2.16 or higher, with setting: AllowOveride all
composer create-project attogram/attogram-framework your-install-directory
or manually install:
- Download latest code from GitHub:
- If composer is not available, also download the vendor distribution from
https://github.com/attogram/attogram-vendor/archive/master.zipand move the
./vendor/directory to the top level of your install directory.
- Download latest code from GitHub:
Setup your web server to use the
./public/directory as the web site root.
./public/.htaccess, set FallbackResource, ErrorDocument 403 and ErrorDocument 404 to the full web path to the index.php file in the install directory.
./public/config.phpand edit to change default settings .
- admin pages are IP protected
- change the allowed admin IPs by setting
- 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
- Install the Attogram Database Module
- Make sure the database file
./db/globalis 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
- 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
- Easily create modules to extend Attogram!
- Each module lives in its own subdirectory within the Attogram
Modules may have the following subdirectories:
actions/- The Public Actions (.php or .md markdown files) If present, the
homeaction is used as the home page.
admin_actions/- The backend admin-only Actions (.php or .md markdown files)
configs/- Configurations via
namespace 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 the
web/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.
- 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 filenames must end in
The Attogram object is available via the
- $this->log->debug(), ->error(), etc.
Depth settings in
End Slash settings in
$config['noEndSlash'] = 'insert-action-name-here'
- Markdown filenames must end in
- The first line of the Markdown file is used as the page title
Remove a page
- delete the pages corresponding file from the
- create/delete the same as normal pages, but in the
- To add a table, add a file into
- The filename must be the name of the table
- File content is the sql
CREATE TABLE ...statement
- tables are automatically created upon first use
./robots.txtdoes not exist, Attogram dynamically serves it, with a link to the Sitemap
./sitemap.xmldoes not exist, Attogram dynamically serves it, with a listing of all public pages