Aomebo Framework (AF) is a open-source (OS) object-oriented (OO) PHP: Hypertext Preprocessor (PHP) Model-View-Controller (MVC) framework.
  • PHP 98.1%
  • C 1.1%
  • Twig 0.4%
  • Smarty 0.3%
Find a file
2016-10-25 22:05:07 +02:00
Associatives Changed file permissions 2016-06-14 10:13:39 +02:00
Cache Added a Bootstrap response, updated year in copyright texts. 2015-10-05 16:19:24 +02:00
Database Fixed support for new DSN parameter for PDO adapter. 2016-10-12 06:23:54 +02:00
Dispatcher Possible to export basic configuration from setup. 2016-09-22 06:57:08 +02:00
Feedback Now dumps $_FILES in debug output if populated 2016-09-14 16:49:18 +02:00
Flowcharts Changed file permissions 2016-06-14 10:13:39 +02:00
GUI/Setup Unit tests are now executed from Setup GUI. 2016-10-25 22:05:07 +02:00
Indexing Indexing-engine and session-adapter now support installation via PDO adapter. 2016-08-14 08:47:45 +02:00
Internationalization Now ignoring tern files, php autocomplete files, fixed error in PO module 2016-09-14 16:42:02 +02:00
Interpreter Started with Unit Tests executed by GUI 2016-09-27 17:29:27 +02:00
Library/Books Implement localization for error messages 2015-10-20 13:16:44 +02:00
Locale Changed file permissions 2016-06-14 10:13:39 +02:00
Pointers Changed file permissions 2016-06-14 10:13:39 +02:00
Presenter aom_fw-253 Serve associatives with version suffix and endless cache expiration 2016-04-27 22:33:23 +02:00
Resources/images Initial commit 2013-12-13 16:41:56 +01:00
Response Started with Unit Tests executed by GUI 2016-09-27 17:29:27 +02:00
Runtime Support for non multi-byte installations. 2016-08-14 08:42:11 +02:00
Session Database connect() and reconnect() using the same iterative process, updated readme and made session-handler post processing conditional to setttings. 2016-09-16 22:58:12 +02:00
System Added a Bootstrap response, updated year in copyright texts. 2015-10-05 16:19:24 +02:00
Template Made Ajax requests as a separate response type 2016-09-19 16:48:43 +02:00
Tests Unit tests are now executed from Setup GUI. 2016-10-25 22:05:07 +02:00
Trigger General code clean-up 2016-08-31 07:21:33 +02:00
.gitignore Started with Unit Tests executed by GUI 2016-09-27 17:29:27 +02:00
.htaccess Started with Unit Tests executed by GUI 2016-09-27 17:29:27 +02:00
.project.org Database adapter DSN is now a stand-alone field to make it easier to generate configuration forms. 2016-10-11 16:53:03 +02:00
Aomebo.php Changed file permissions 2016-06-14 10:13:39 +02:00
Application.php Unit tests are now executed from Setup GUI. 2016-10-25 22:05:07 +02:00
Base.php A fix to systemTranslate when Internationalization system hasn't been initialized 2016-05-27 10:25:55 +02:00
best_practice.txt Fixed a phpDoc issue where @internal protected variables and functions were wrongly interpretated by a common IDE. 2015-12-14 10:46:27 +01:00
composer.json Started with Unit Tests executed by GUI 2016-09-27 17:29:27 +02:00
Configuration.php Database adapter DSN is now a stand-alone field to make it easier to generate configuration forms. 2016-10-11 16:53:03 +02:00
Exceptions.php General code clean-up 2016-08-31 07:21:33 +02:00
Filesystem.php aom_fw-301 Make fileemtime cache configurable 2016-04-25 16:31:00 +02:00
index.php Started with Unit Tests executed by GUI 2016-09-27 17:29:27 +02:00
license.txt Initial commit 2013-12-13 16:41:56 +01:00
phpdoc.sh Initial commit 2013-12-13 16:41:56 +01:00
README.md Unit tests are now executed from Setup GUI. 2016-10-25 22:05:07 +02:00
Request.php Started with Unit Tests executed by GUI 2016-09-27 17:29:27 +02:00
robots.txt Initial commit 2013-12-13 16:41:56 +01:00
Runtime.php General code clean-up 2016-08-31 07:21:33 +02:00
Singleton.php General code clean-up 2016-08-31 07:21:33 +02:00
structure.php Database adapter DSN is now a stand-alone field to make it easier to generate configuration forms. 2016-10-11 16:53:03 +02:00
test.sh Started with Unit Tests executed by GUI 2016-09-27 17:29:27 +02:00
update.sh Update-script now works regardless of where the framework is stored in the filesystem. 2016-02-09 09:28:45 +01:00

Aomebo Framework

Aomebo Framework (AF) is a open-source (OS) object-oriented (OO) PHP: Hypertext Preprocessor (PHP) Model-View-Controller (MVC) framework.

The framework is built to be compatible with all types of applications (even shell applications) and is fully scalable. Only loads the stuff you need for your project and tries to place as few limits as possible on the developer. The main idea of the framework is to enable swift development by using common and easy patterns and supporting a wide variety of programming styles.

It only requires PHP 5.3 or later with PHP standard modules.

The framework is built with time-, space- and memory-complexity in mind which makes it memory-efficient, CPU-efficient, storage-efficient and fast.

With optional features such as:

  • Built-in concurrency-support, supports communication between requests, limit concurrent requests (optional)
  • Advanced and easy-to-use queued trigger and filter system (Like Wordpress) (optional)
  • Internationalization and localization with adapters and supports multiple simulatenous text-domains and languages (Gettext adapter like Wordpress for .mo and .po files and PHP) (optional)
  • Multiple template adapters built-in (Smarty 3, Twig, PHP) (optional)
  • Support for Models, Controllers, Modules, Views, Libraries (Centralized MVC, Decentralized MVC or combined MVC design like Zend Framework)
  • Dependency-support and automatic CSS and Javascript generation (optional)
  • Works out of the box with APC, Xdebug and PHPUnit
  • Extensive support for URL-generation and routing (with or without mod_rewrite) (optional)
  • Support for different database adapters, preparing, escaping and transactions and to run without database too (MySQLi and PDO) (optional)
  • Cache-system for filesystem or database which supports raw, JSON or serialized data (optional)
  • Feedback and debug functions (optional)
  • Built-in support for dynamic sitemap indexing (optional)
  • Built-in support for different session setups (filesystem, native PHP or database) (optional)
  • All this super-fast, even with database-support and cache disabled execution-times around 30ms to a few hundred of miliseconds for large-scale sites.

The framework has been successfully used for:

  • Internationalized and localized sites.
  • Internationalized and localized communities.
  • Accounting and bookkeeping software.
  • Internationalized and localized e-commerce systems.
  • REST APIs.
  • Blogs.
  • Company homepages.

The framework is licensed by the Open license LGPL version 3.

A easy example

  1. Let's say we want to have the framework at /usr/share/aomebo-framework/ and we have our public root at /var/www/MyWebSite/public/, we want our application to be located outside of public root at /var/www/MyWebSite/private/
  2. Clone git repository git clone https://github.com/cjohansson/Aomebo-Framework.git /usr/share/aomebo-framework/
  3. Create a index.php in your public root like this and tell Aomebo Framework where your applications private files are located by passing the PARAMETER_SITE_PATH parameter to the Aomebo Application constructor like this

Let's say that this is /var/www/MyWebSite/public/index.php

<?php
require_once('/usr/share/aomebo-framework/Application.php');
new \Aomebo\Application(
    array(
        \Aomebo\Application::PARAMETER_SITE_PATH =>
            '/var/www/MyWebSite/private/',
    )
);
  1. Create some modules

We are going to create 4 modules: Html, Header, Footer, Wrapper and all paths from now on will be relative to /var/www/MyWebSite/.

Html

private/Modules/Html/Module.php

<?php
namespace Modules\Html
{

    /**
     * @method static \Modules\Html\Module getInstance()
     */
    class Module extends \Aomebo\Runtime\Module implements
        \Aomebo\Runtime\Executable,
        \Aomebo\Runtime\ExecutionParameters,
        \Aomebo\Runtime\Dependent
    {

	    /**
	     * @static
	     * @var string
	     */
	    private static $_title;

        /**
         * @return array|bool
         */
        public function getDependencies()
        {
            return array(
                new \Aomebo\Associatives\Dependent('jQuery'));
        }

        /**
         * @return array|bool
         */
        public function getParameters()
        {
	        return array('title', 'body');
        }

        /**
         * @static
         * @param string $title
         */
        public static function setTitle($title)
        {
	        self::$_title = $title;
        }

        /**
         * @static
         * @return string
         */
        public static function getTitle()
        {
	        return self::$_title;
        }

        /**
         * @return bool|mixed|string
         */
        public function execute()
        {
	        if (empty(self::$_title)) {
		        self::$_title = $this->getField('title');
	        }
	        $view = self::_getTwigView();
	        $view->setFile('views/view.twig');
	        $view->attachVariables(array(
		        'title' => self::$_title,
		        'body' => $this->getField('body'),
	        ));
            return $view->parse();
        }

    }
}

private/Modules/Html/views/view.twig

<html>
    <head>
	<title>{{ title }}</title>
    </head>
    <body>
	{{ body|raw }}
    </body>
</html>

private/Modules/Html/Associatives/script.js

$(document).ready(function(event) {
console.log('Site started');
});

private/Modules/Html/Associatives/style.css

body
{
}

Header

private/Modules/Header/Module.php

<?php
namespace Modules\Header
{

    /**
     * @method static \Modules\Header\Module getInstance()
     */
    class Module extends \Aomebo\Runtime\Module implements
        \Aomebo\Runtime\Executable
    {

        /**
         * @return bool|mixed|string
         */
        public function execute()
        {
	        $view = self::_getTwigView();
            $view->setFile('views/view.twig');
            $view->attachVariables(array(
	            'title' => \Aomebo\Configuration::getSetting('framework,name'),
	            'version' => \Aomebo\Configuration::getSetting('framework,version'),
            ));
            return $view->parse();
        }

    }
}

private/Modules/Header/views/view.twig

<div id="{{ F }}">
    &copy; {{ year }}
    <br /><a href="{{ website }}" target="_blank">{{ website }}</a>
</div>

private/Modules/Footer/Module.php

<?php
namespace Modules\Footer
{

    /**
     * @method static \Modules\Footer\Module getInstance()
     */
    class Module extends \Aomebo\Runtime\Module implements
        \Aomebo\Runtime\Executable
    {

        /**
         * @return string
         */
        public function execute()
        {
            $view = self::_getTwigView();
            $view->setFile('views/view.twig');
            $view->attachVariables(array(
                'website' => \Aomebo\Configuration::getSetting('framework,website'),
                'year' => date('Y'),
            ));
            return $view->parse();
        }

    }

}

private/Modules/Footer/views/view.twig

<div id="{{ F }}" class="text-center">
    &copy; {{ year }}
    <br /><a href="{{ website }}" target="_blank">{{ website }}</a>
</div>

private/Modules/Footer/Associatives/style.css

#footer {
    margin: 60px 0 40px;
}

`

  1. Create some pages

  2. Try it

  3. Add database connection

  4. Try again

  5. Create some routes