Actions

開発者エリア/Maharaアーキテクチャインストラクション/コアサブシステム: Difference between revisions

From Mahara Wiki

< 開発者エリア/Maharaアーキテクチャインストラクション
No edit summary
Line 37: Line 37:
</div><div id="section_6">
</div><div id="section_6">


===HTML Filtering: HTMLPurifier===
===HTMLフィルタリング: HTMLPurifier===


In plenty of places in Mahara, user content is displayed. We bundle HTMLPurifier and provide wrapper functions for it, so you never have to worry about users inserting malicious tags. This filter is so good, we've previously had people complain that they can't embed anything at all! Mahara now ships with filters for allowing embedded code from select websites that most people trust, such as Youtube and Slideshare, and the filters are naturally pluggable.
In plenty of places in Mahara, user content is displayed. We bundle HTMLPurifier and provide wrapper functions for it, so you never have to worry about users inserting malicious tags. This filter is so good, we've previously had people complain that they can't embed anything at all! Mahara now ships with filters for allowing embedded code from select websites that most people trust, such as Youtube and Slideshare, and the filters are naturally pluggable.
Line 43: Line 43:
</div><div id="section_7">
</div><div id="section_7">


===Templating: Dwoo===
===テンプレーティング: Dwoo===


Mahara uses Dwoo for its templating needs since Mahara 1.2, and previous to 1.2 used Smarty. PHP developers familiar with Smarty's abilities will find Dwoo quite similar, and we use it extensively throughout Mahara.
Mahara uses Dwoo for its templating needs since Mahara 1.2, and previous to 1.2 used Smarty. PHP developers familiar with Smarty's abilities will find Dwoo quite similar, and we use it extensively throughout Mahara.

Revision as of 04:10, 9 Ocak 2013

作成中です - mits

In order to make the job of writing Mahara easier, both for the core developers and plugin writers, Mahara has several subsystems to provide certain functionality. You'll see them used in many places across Mahara's codebase.

活動システム

The activity system allows Mahara to notify users about things that have happened in the system. It supports pluggable activity types, which are provided by the core and plugins, and the notification plugin type hooks in here to allow users to choose how they receive these messages.

データベースレイヤ: ADODB/XMLDB

Mahara supports both MySQL and PostgreSQL by using ADODB for database abstraction, and XMLDB for handling the schema and upgrades. Mahara has a library on top of ADODB to make simple operations easier to perform - such as getting records, inserting/deleting rows. In many places in Mahara however, raw SQL is used to grab the data required.

Mahara's database has foreign keys, and in the case of PostgreSQL, some more data integrity features.

Cron

Mahara implements cron internally. The main reason for this is to prevent the need for people to set up and edit cron jobs constantly. As cron is implemented internally, new plugins can simply register what cron jobs they want to run with Mahara, which will ensure they are run at the appropriate times (note: you still need one cron job set up to trigger Mahara's internal cron, but you set it up when setting up Mahara and then forget about it).

エラー処理およびロギング

Being a PHP5 application, Mahara provides and uses exceptions for much of the error handling. Mahara also provides excellent logging facilities (to apache error logs) that give detailed error messages and backtraces when a problem occurs. Mahara also catches uncaught exceptions and displays generic "an error occured" pages, that don't give away any information to potential hackers about what went wrong.

フォーラムビルディング: Pieforms

Mahara bundles the Pieforms form building library. It provides a very simple way to generate and process forms. It takes away the hard work of writing HTML and even much of the tedious validation work. It also handles session key checking for you, so you'll never generate a form vulnerable to XSS unless your try really hard to work around it. And if necessary, it provides the capability to lay out a form with widgets anywhere you choose - though most of the time you'll be happy enough with the forms generated by default.

HTMLフィルタリング: HTMLPurifier

In plenty of places in Mahara, user content is displayed. We bundle HTMLPurifier and provide wrapper functions for it, so you never have to worry about users inserting malicious tags. This filter is so good, we've previously had people complain that they can't embed anything at all! Mahara now ships with filters for allowing embedded code from select websites that most people trust, such as Youtube and Slideshare, and the filters are naturally pluggable.

テンプレーティング: Dwoo

Mahara uses Dwoo for its templating needs since Mahara 1.2, and previous to 1.2 used Smarty. PHP developers familiar with Smarty's abilities will find Dwoo quite similar, and we use it extensively throughout Mahara.

Previous: Core Components