Giter Club home page Giter Club logo

elefant's Introduction

Elefant CMS

GitHub Workflow Status GitHub Packagist PHP Version Support

Elefant is a refreshingly simple PHP content management system and web framework. Elefant is a fast, lean tool for building everything from simple websites to complete web applications.

Installation help & documentation

Elefant has extensive documentation including installation instructions, user manual, designer guides, and developer tutorials here:

You can also find help on our community forum here:

Built for designers

Compiled, ultra-fast templates

Elefant compiles your templates into secure, readable PHP code, so rendering is as fast as possible and also takes advantage of bytecode caching (e.g., APC).

Dead simple, concise template tags

Familiar syntax to other template languages, with some added conveniences for dynamic embeds and internationalization.

Clean, easy to use site editor for your users

Elefant comes out of the box with a full-featured CMS for your users. You can even white label it.

Syntax highlighted template and CSS editor

Sophisticated in-browser editing with highlights and references at your finger tips.

Live preview while editing templates and CSS

Preview in real time as you make changes. Or if you prefer, edit files directly with your editor of choice.

Integrates with 960 grid system and jQuery

Or any other CSS grid/layout system, giving you complete control over your designs. Theme builder also provides defaults for Twitter Bootstrap.

Built for developers

Quickly built custom apps

With all the tools you need, and a very low learning curve, Elefant gets you writing code quickly.

Extensively documented

Including full API reference, user manual, tutorials, and much more.

Strong security by default

Flexible form building, input validation, and automatic prevention of XSS, SQL injection, CSRF, and other types of attacks.

Very fast and low memory

Elefant uses less memory than any of the major frameworks, so you can serve more visitors with the same resources. Benchmarks: MVC layer, database access, and template rendering.

Solid debugging tools

Debug mode prints full traces with highlighted source code and variable state to help you fix bugs faster.

Minimalist HMVC/Model2 architecture

Elefant takes a unique but proven approach that helps minimize boilerplate without sacrificing code organization as your project grows.

Shared apps to save you time

From blogs to user management, events to search, Elefant saves you time not reinventing the wheel with high quality shared apps.

Thoroughly unit-tested

Elefant's core framework is covered by extensive unit tests, ensuring a stable base to build on.

Internationalization

Elefant apps are automatically i18n aware, with built-in multilingual capabilities and locale awareness.

More developer goodness

Elefant builds on over 12 years of PHP experience, and aims to simplify rapid PHP development again. As such, Elefant takes into consideration all the little details to help you work faster and better:

Try it out

Download the latest release here.

FAQ

Q. Do you know you spelt Elephant wrong?

A. This was my attempt at being hip and cool. No good?

Q. Isn't Elefant a bit of an oxymoron for a slim framework?

A. Why, yes. Yes it is.

elefant's People

Contributors

axorb avatar betaman avatar electrolinux avatar gareththered avatar jbroadway avatar jonphipps avatar lux avatar mmelnyk avatar olegiv avatar pincher2012 avatar r-j avatar shortjared avatar twheel avatar vlastikcz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elefant's Issues

Simpler (Mem)Caching Extension

Hi, I have a tiny addition that you may or may not like to see inside elefant, and I'm slightly unsure as to where it should live in the code due to how you select the caching class at runtime. It is simply an tiny extension to your existing Cache class to make caching even quicker to add to existing code. It is used like so:

$value = $memcache->cache('mykey', '30 minutes', function () {
    // Generate expensive value here, eg. database query
    return $expensive_value;
});

It is possible to "monkey-patch" the cache class at runtime by adding this code at ~line 50 in index.php:

$memcache->cache = function ($key, $timeout, $function) {
    if (($val = $this->get($key)) === false) {
        $val = $function();
        $this->set($key, $val, strtotime($timeout) - time());
    }
    return $val;
};

But I'm sure you'll have a better way of integrating it should you choose to do so!

This information is also duplicated here, http://demonastery.org/72/tiny-memcached-wrapper/ where I posted it initially. I should point out that it was because of your Reddit post that I decided to play around with Memcache in the first place, so thank you for that :)

Dynamic object to embed arbitrary HTML into pages

Need a dynamic object handler that shows a textarea to paste HTML, but converts it to a key and stores the HTML elsewhere so the tag doesn't become:

{! admin/html?content=<strong>some+text</strong> !}

As you can see, that would get ugly fast. Need a callback setting for replacing the input in dynamic objects, for example the callback could simply do:

<?php

function my_dynamic_object_callback ($data) {
    // store the data
    db_execute ('insert into dynamic_objects (id, data) values (null, ?)', $data);

    // return the id of it
    return db_lastid ();
}

?>

Then the handler rendering the dynamic object would be able to say:

<?php

$html = db_shift ('select data from dynamic_objects where id = ?', $data['id']);

?>

An API for this would be simple to create.

Web-based installer

An installer app that would:

  1. Checks folder permissions
  2. Get database connection settings, test connection
  3. Get site name, email, choose admin password
  4. Create database based on the above
  5. Write the conf/config.php file
  6. Disable the installer from running again (touch conf/installed then installer can check file_exists(conf/installed) and exit)

Check for updates in admin UI, upgrade utility in CLI tool

Would be good to be able to check for updates and install them through the admin panel, at least bug fix releases. The installer mechanism could be a starting point for applying the updates, but source files would need to be updated too which might mean increased permissions on files...

Checking for updates could be done via an iframe + javascript so it doesn't affect the load of the admin toolbar.

Quick inline edit capability

A quick edit button for pages and blocks that lets you edit just the visible elements in-place on the page and save them without leaving the page.

Method for installing/updating shared apps

It would be good to be able to drop an app into apps/ and have Elefant recognize that it needs to be installed, and what the install handler is. Some thoughts:

  1. An apps table with installed and version status for each app. Missing entries wouldn't be installed at all yet.
  2. In the [Admin] block of each app's conf/config.php file it could have these settings:
installer = myapp/install
upgrade = myapp/upgrade
version = 1.0
  1. Installer-specific methods could be added to the controller or to the admin app such as:
<?php

// after admin checking do:
if ($this->installed ('myapp')) {
    $page->title = 'Already installed';
    return;
}

// run the install then:
$this->mark_installed ('myapp', '1.0');

?>
  1. The admin/head could check the install status in the db and notify admins of apps needing install or updates...

Needs fleshing out, but it's a start.

Add ./conf/elefant backup command

Should take the form:

$ ./conf/elefant backup /path/to/backups

Steps:

  1. mkdir cache/backup-{{ timestamp }}
  2. ./conf/elefant export-db cache/backup-{{ timestamp }}/db.sql
  3. cp .htaccess cache/backup-{{ timestamp }}/
  4. cp -R * cache/backup-{{ timestamp }}/
  5. tar -cf cache/backup-{{ timestamp }}.tar cache/backup-{{ timestamp }}
  6. gzip cache/backup-{{ timestamp }}.tar
  7. mv cache/backup-{{ timestamp }}.tar.gz {{ path_to_backups }}/
  8. rm -Rf cache/backup-{{ timestamp }}

Add ./conf/elefant export-db command

Should take the form:

$ ./conf/elefant export-db exported-data.sql

Should create the SQL to be compatible with the database type used by the site (sqlite, mysql).

Installer error with mysql

Guys get an error on a new install using mysql.

Connection Error:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock ( id int not null auto_increment primary key, user int not null, resource v' at line 1

My immediate guess would be that 'lock' is a keyword in mysql, and we have called a table after it?

Use env var to switch configurations for dev, staging and prod setups

Use an environment variable to load alternate configurations for different servers (development, staging, production), e.g.:

define ('ELEFANT_ENV', (getenv ('ELEFANT_ENV') ? getenv ('ELEFANT_ENV') : 'production');

$conf = parse_ini_file ('conf/' . ELEFANT_ENV . '.php');

Then specify your environment in .htaccess or your vhost configuration:

SetEnv ELEFANT_ENV development
  • Could also force debugging to be off for production.
  • We would also need to update any hard-coded references to conf/config.php or split it into conf/general.php and env-specific settings like database info into conf/staging.php and the like.
  • Need to find out how to set environment variables in Nginx

Add support for MongoDB-based models

See lib/MongoModel.php and tests/MongoModelTest.php for model info. See lib/MongoManager.php for connection info. Already implemented:

  • connection settings
  • creating basic models
  • __construct()
  • put(), get(), and remove()

Still several methods yet to be implemented:

  • group()
  • fetch()
  • single()
  • count()
  • fetch_orig()

Add video embeds from vimeo

Just like the youtube dynamic object. Use vimeo video urls (e.g., http://vimeo.com/23299746) and grab the video ID then generate the appropriate embed code, such as:

<iframe src="http://player.vimeo.com/video/23299746?title=0&amp;byline=0&amp;portrait=0" width="480" height="270" frameborder="0"></iframe>

Add support for replicated databases

Currently uses a global $db object to contain a single PDO reference. Would need to store multiple database connections perhaps in conf/db.php...

[master]

; connection info

[slave1]

; connection info

Then lib/Database.php would need a helper to balance reads between connections (with writes still going to master).

Sync uploaded files to S3

Replace direct filesystem calls with a FileStore class that extends Model, with a schema like:

create table filestore (
    path char(128) primary key,
    link char(255),
    size int not null,
    mtime int not null
)

The link field would reference the S3 copy once synced, or be empty if not. We would then need a background task to sync uploaded files to S3 (with option to delete local version too). A download handler (e.g., /filemanager/dl/path/to/file.ext) would simply have to do the following:

<?php

$fs = new FileStore (join ('/', $this->params));
if ($fs->error) {
    // check if local file does exist and if so, create entry.
    // it may have been uploaded outside the system.
    // if not, real error
}

if (! empty ($fs->link)) {
    $this->redirect ($fs->link);
}
$this->redirect ('/files/' . $fs->path);

?>

Create a setting for default layout so layout themes could be switched between

This would make it possible to create layout "themes" by creating a themename.html file and a corresponding themename folder for associated assets (css, images) and just drop it into layouts.

Then to make that the default theme, you would simply change the setting for "Default layout" from default to themename and the site would change.

Make the admin UI rebrandable

Allow developers to customize the logo, name, and colours via a configuration file, so they can produce their own branded version of Elefant.

Preview capability in Designer app

For layouts: An iframe filling the bottom of the window (with popout option?), updating every x seconds.
For stylesheets: The same iframe, but with a "choose a layout" option.

Translation app

An app for managing translations of strings/objects in published sites

Unify conf/*.php scripts into one 'elefant' script

Instead of having separate script names to remember, there should be one main script with help info that runs each command, for example:

# conf/createdb.php becomes:
$ ./elefant install

# conf/translations.php becomes:
$ ./elefant build-translation de

# conf/genpass.php becomes:
$ ./elefant encrypt-password "my pass here"

# conf/make.php becomes:
$ ./elefant build-app myapp

# print all commands:
$ ./elefant --help

# help for the build-app command:
$ ./elefant build-app --help

This would give a much better base for building on, and be much clearer for developers to use.

Add automatic caching to handlers

Use $this->cache = 300; to tell the Controller to cache a handler with a key of the form app/handler and bypass it entirely next time. You can then clear it in another handler later via $cache->delete ('app/key');.

Skip 'Page saved' pages and go directly to next page

  1. Create a way to set and show notifications for add/edit/delete actions
  2. Instead of showing a 'Page saved' page with a 'Continue' link, set a notification message and send them to the link immediately
  3. On the next page, show the notification

This will save a lot of clicks and improve overall usability.

"Missing" mod_rewrite

At PHP Fog we have the apache_get_modules() command disabled for security purposes, which causes a false "Missing mod_rewrite" error when installing. I patched in a quick fix that removes this check since PHP Fog will always have mod_rewrite enabled.

Custom dialog needed for dynamic embeds in wysiwyg editor

Right now it simply embeds the following:

<div class="embedded">{! app/handler !}</div>

Behind the scenes, it will need:

  • a way to configure which handlers are embeddable and what parameters they require
  • a handler that generates a list of all embeddable handlers from all apps
  • a handler that generates a form to input any parameters needed by a chosen handler
  • a jWysiwyg plugin that calls out to these handlers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.