maketok / site
Maketok site framework
Requires
- php: >=5.4.0
- aptoma/twig-markdown: ~0.2
- erusev/parsedown-extra: ~0.2
- monolog/monolog: ~1.0
- symfony/config: 2.*
- symfony/dependency-injection: 2.*
- symfony/expression-language: 2.*
- symfony/form: 2.*
- symfony/http-foundation: 2.*
- symfony/twig-bridge: 2.*
- symfony/validator: 2.*
- twig/extensions: 1.*
- twig/twig: ~1
- zendframework/zend-db: 2.*
- zendframework/zend-eventmanager: 2.*
- zendframework/zend-stdlib: 2.*
- zendframework/zend-uri: 2.*
Requires (Dev)
- mikey179/vfsstream: ~1.0
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2022-02-01 12:42:58 UTC
README
About
A package is aimed to provide a simple platform for site developer. It includes independent components (bundles) from major vendors to handle low level operations.
This should be considered experimental until any stable release is out. So I wouldn't recommend it for any production instance.
App code is bundled in Maketok namespace and consists of major areas:
- SubjectManager. The most standard implementation.
- Installer. Consists of DDL and Data parts.
- DDL. This is component gathers Data Structure map across all subscribers (clients) and creates appropriate directives for concrete Data Storage. It also handles conflicts and dependencies across clients.
- Data. The Data part is not yet implemented. I should handle clients that update data inside the built Structure.
- MVC (Front Controller). Provides routing and helper classes for controllers.
- Few small Util classes
- StreamHandler - basic IO operations with files
- DirectoryHandler - basic IO operations with directories
- ExpressionParser - parse variables in curly brackets
- ClosureComparer - compare closures
- CallableHash - gets static hash of any callable
- ArrayValueTrait - safely gets the value from an array by key
- ConfigGetter - loads PHP and YAML configs in given paths
- PriorityQueue - wrapper around SPL \PriorityQueue to provide removal functional
This app is distributed under MIT licence, and anyone can use it for his (or her) needs as he sees fit. I'm not providing any means of warranty, and may or may not address any issues programmatic or of any other sort that are connected with or caused by the software.
Tech
Includes next major components from vendors:
- zend-db (zf 2.*) for database connection/model handling
- monolog (~1.0) for logging
- symfony/http-foundation (2.*) for http request handling
- symfony/dependency-injection (2.*) for ioc container
- symfony/form (2.*) for creating forms
- twig (~1) for templating
License
Install
- Checkout the repo - for example `git clone https://github.com/SlayerBirden/site.git
- If you don't have composer installed:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/bin/composer
- Install dependencies:
composer install
- Run setup:
php setup.php
- You can specify next options:
- webserver
- db_user, default root
- db_passw, default empty string
- db_host, default localhost
- db_database, default maketok
- db_driver, default pdo_mysql
- base_url
- admin_url
- admin_user_username
- admin_user_password
- admin_user_firsname
- admin_user_lastname
- For example:
php setup.php --webserver=apache --db_user=root --db_host=localhost --db_database=test --base_url=http://test.com
- Any of the parameters that are omitted will be prompted by Stdin provider.
Example Nginx Configuration
server {
listen 80;
listen 443 ssl;
ssl_certificate /PATH/TO/CERTS/server.crt;
ssl_certificate_key /PATH/TO/CERTS/server.key;
server_name SERVER_NAME;
index index.php index.html index.htm;
set $root_path '/PATH/TO/MAKETOK/ROOT/public';
root $root_path;
try_files $uri $uri/ @rewrite;
location /admin {
rewrite ^/(.*)$ /admin/index.php?_url=/$1 last;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index /index.php;
fastcgi_read_timeout 86400;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}