Skip to content

Commit

Permalink
Merge pull request #14 from pi-engine/develop
Browse files Browse the repository at this point in the history
update 19 mars 2014
  • Loading branch information
krisxoofoo committed Mar 18, 2014
2 parents fe5f7cd + bfedf62 commit f1888eb
Show file tree
Hide file tree
Showing 2,287 changed files with 22,246 additions and 8,634 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Enforce Unix newlines
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.less text eol=lf
*.md text eol=lf
*.yml text eol=lf
5 changes: 2 additions & 3 deletions Gruntfile-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ module.exports = {
* Which modules will be handler by grunt
* Array list or string 'all'
*/
modules: ['article', 'comment', 'media', 'message', 'page', 'saml', 'system',
'tag', 'uclient', 'user', 'widget'],
modules: ['system', 'user'],
/*
* Which themes will be handler by grunt
* Array list or string 'all'
*/
themes: 'all'
themes: ['']
}
12 changes: 12 additions & 0 deletions doc/README-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

Pi Engine Setup

## Single site
1. Empty `setup/tmp/` and make it writable;
2. Access `setup/index.php` to start installation;
3. After the installation, remove `setup` folder.

## Multi-site
1. Install master site: install as `master` from `setup/master.php`
2. Remove `setup/master.php`
3. Install slave site: install as `slave` from `setup/slave.php`
9 changes: 9 additions & 0 deletions doc/README-string.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# Pi Engine String Handling for multi-byte cases

* strlen: `Pi::string()->strlen(<text>)`
* substr: `Pi::string()->substr(<text>, <offset>, <length>)`
* strpos: `Pi::string()->strpos(<haystack>, <needle>, <offset>)`
* convert: `Pi::string()->strpos(<text>, <toEncoding>, <fromEncoding>)`
* wordwrap: `Pi::string()->wordWrap(<text>, <width>, <break>, <cut>)`
* strpad: `Pi::string()->strPad(<text>, <length>, <pad>, <type>)`
1 change: 1 addition & 0 deletions doc/SAMPLE-deploy-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ chown -Rf www-data:www-data /home/pi/deploy/pi-demo/
```
chmod -f 0777 /home/pi/deploy/pi-demo/www/.htaccess
chmod -f 0777 /home/pi/deploy/pi-demo/www/boot.php
chmod -Rf 0777 /home/pi/deploy/pi-demo/www/setup/tmp/
chmod -Rf 0777 /home/pi/deploy/pi-demo/www/asset/
chmod -Rf 0777 /home/pi/deploy/pi-demo/var/
chmod -Rf 0777 /home/pi/deploy/pi-demo/upload/
Expand Down
7 changes: 5 additions & 2 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Pi Engine Changelog


Pi 2.4.0
Jan 1st, 2014
March 8th, 2014
============
* Refactored API calls to be compatible with registry and model calls: changed `Pi::api(<module>)` and `Pi::api(<module>, <api>)` to `Pi::api(<api>, <module>)`
* Added built-in support for module custom with build metadata versioning
Expand All @@ -11,7 +12,8 @@ Jan 1st, 2014
* Moved custom static to `asset/custom` folder for better deployment
* Moved system abstract API classes to sub namespace `Api` located in `lib/Pi/Application/Api`
* Added support for custom bootstrap and online custom bootstrap in themes

* Added service of `string` for multi-byte string handling
* Upgraded Zend Framework to 2.2.6 final

* Added config folders/files:
- var/config/event.listener.php
Expand All @@ -21,6 +23,7 @@ Jan 1st, 2014
- var/config/host.php
- var/config/hosts.php


Pi 2.3.0
Dec 3rd, 2013
============
Expand Down
65 changes: 34 additions & 31 deletions doc/releasenotes.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
Pi Engine 2.3.0 Release
Pi Engine 2.4.0 Release
=======================

The Pi Team is pleased to present Pi Engine 2.3.0 as a major release since its public release, focused on user oriented architecture, feature and API building.
Meanwhile Pi powered applications are launched by a variety of teams.
The Pi Team is pleased to present the Pi Engine **Pi Day** Release (Pi 2.4.0), an application development engine focusing on user oriented architecture, feature and API building. Meanwhile Pi powered applications are launched by a variety of teams.

Get the [Pi 2.3.0 Release](https://github.com/pi-engine/pi/archive/release-2.3.0.zip) and report issues and requests to [Pi Issue Tracker](https://github.com/pi-engine/pi/issues).
Get the [Pi Day Release](https://github.com/pi-engine/pi/archive/release-2.4.0.zip) and report issues and requests to [Pi Issue Tracker](https://github.com/pi-engine/pi/issues).

What's New
==========

Selected major features:
+ Primary modules available: `article`, `comment`, `message`, `tag`, `user`
+ User system implemented with features:
+ Extensible user profile field definition
+ Configurable user profile page
+ Configurable user data aggregator for user profile and activity feed
+ Per-user per-field profile privacy control
+ Cross-module user profile definition and data write
+ Extensible multi-mode for user profile access: local, client
+ Extensible multi-mode for avatar: local, select, gravatar, upload
+ Extensible multi-mode authentication: local, SSO
+ Built-in user data storage
+ Comment service
+ On-demand implementation on modules with multi-categories
+ Auto-locator for target resources
+ Support for JavaScript load of leading page
+ Extensible and customizable architecture
+ Module mechanism for functionality extensibility
+ Custom i18n, config, templates and classes for user-land customization
+ Preliminary Open API protocol and implementations
+ Gettext as i18n solution friendly to translators
+ AngularJS as front-end solution


Check out [changelog](https://github.com/pi-engine/pi/blob/release-2.3.0/doc/changelog.txt) for details.
During these months’ development, some features have been added and improved to Pi Engine and its basic modules.

Some of the major changes:

+ New basic modules available: `media`, `search`
+ Refactored API calls to be compatible with registry and model calls: changed `Pi::api(<module>)` and `Pi::api(<module>, <api>)` to `Pi::api(<api>, <module>)`
+ Media service introduced to operate media in local or remote
+ Added security and permission checks
+ Added all modules updating features
+ Added built-in support for module custom with build metadata versioning
+ Added built-in support for module and theme custom asset
+ Added customizable breadcrumbs provides by module itself
+ Simplified config API with `Pi::config()`
+ Merged module `asset` and `public`, located in `www/asset`; independent asset deployment dropped off
+ Moved custom static to `asset/custom` folder for better deployment
+ Moved system abstract API classes to sub namespace `Api` located in `lib/Pi/Application/Api`
+ Added support for custom bootstrap and online custom bootstrap in themes
+ Added service of `string` for multi-byte string handling
+ Upgraded Zend Framework to 2.2.6 final
+ Upgraded Bootstrap to 3.1.1
+ Improvements and bugs fixed on core module: `user`, `page`, `article`, `comment`, `message`, `tag`, `search`, `saml` and `uclient`
+ Added config folders/files:
+ var/config/event.listener.php
+ Modified config files:
+ var/config/engine.php
+ var/config/host.php
+ var/config/hosts.php

Check out [changelog](https://github.com/pi-engine/pi/blob/release-2.4.0/doc/changelog.txt) for details. And finally special thank goes to @[sexnothing](https://github.com/sexnothing), @[Simon Zhang](https://github.com/zhangsimon) and @[loidco](https://github.com/loidco).

Documentation
=============
Checkout Pi development manual and tutorials at [Github wiki](https://github.com/pi-engine/pi/wiki) and APIs and class charts at [Pi API](http://api.pialog.org).


---------------------
[Pi Team](http://pi-engine.org)
[Taiwen Jiang](http://github.com/taiwen), [Marc Desrousseaux](https://github.com/Marc-pi), [Hossein Azizabadi](http://github.com/voltan), [Zongshu Lin](https://github.com/linzongshu), [Pi Team](http://pi-engine.org)

Dec 3rd, 2013
Mar 14th, 2014
2 changes: 2 additions & 0 deletions lib/Pi/Application/Bootstrap/Resource/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class Session extends AbstractResource
*/
public function boot()
{
$this->engine->bootResource('database');

// Set options for session service
if (!empty($this->options['service'])) {
Pi::service('session')->setOptions($this->options['service']);
Expand Down
5 changes: 3 additions & 2 deletions lib/Pi/Application/Installer/Resource/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ class Page extends AbstractResource
*/
protected function canonize($config)
{
$moduleTitle = $this->event->getParam('title');
//$moduleTitle = $this->event->getParam('title');
$pageEntry = array(
'title' => $moduleTitle . ' *',
'title' => 'Module wide',
'block' => 1,
);
/*
// Set module exception for admin
Expand Down
52 changes: 35 additions & 17 deletions lib/Pi/Application/Installer/Resource/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Pi\Application\Installer\Resource;

use Pi;
use Module\User\AbstractCustomHandler;
use Module\User\Field\AbstractCustomHandler;

/**
* User meta setup
Expand Down Expand Up @@ -365,6 +365,10 @@ protected function canonizeField($spec)

if (isset($spec['edit'])) {
$spec['edit'] = $this->canonizeFieldEdit($spec['edit']);
if (isset($spec['edit']['required'])) {
$spec['is_required'] = $spec['edit']['required'] ? 1 : 0;
unset($spec['edit']['required']);
}
}

if (isset($spec['filter'])) {
Expand Down Expand Up @@ -398,19 +402,21 @@ protected function canonizeCompoundField(array $config, array $compound)
if (!isset($data['module'])) {
$data['module'] = $compound['module'];
}
//if ('compound' == $compound['type']) {
if (!isset($data['edit'])) {
$data['edit'] = 'text';
}
$data['edit'] = $this->canonizeFieldEdit($data['edit']);
if (isset($data['filter'])) {
if (empty($data['filter'])) {
$data['filter'] = array();
} else {
$data['filter'] = (array) $data['filter'];
}
if (!isset($data['edit'])) {
$data['edit'] = 'text';
}
$data['edit'] = $this->canonizeFieldEdit($data['edit']);
if (isset($data['filter'])) {
if (empty($data['filter'])) {
$data['filter'] = array();
} else {
$data['filter'] = (array) $data['filter'];
}
//}
}
if (isset($data['edit']['required'])) {
$data['is_required'] = $data['edit']['required'] ? 1 : 0;
unset($data['edit']['required']);
}

$fields[$compound['name'] . '-' . $key] = $data;
}
Expand Down Expand Up @@ -513,6 +519,8 @@ public function updateAction($force = false)
$module = $this->getModule();
Pi::registry('field', 'user')->clear();
Pi::registry('compound_field', 'user')->clear();
Pi::registry('display_group', 'user')->clear();
Pi::registry('display_field', 'user')->clear();

if (!$force && $this->skipUpgrade()) {
return;
Expand Down Expand Up @@ -549,6 +557,10 @@ public function updateAction($force = false)
if (isset($items[$key]['value'])) {
unset($items[$key]['value']);
}
// field/compound_field required attribute is set by admin
if (isset($items[$key]['is_required'])) {
unset($items[$key]['is_required']);
}

$row->assign($items[$key]);
$row->save();
Expand Down Expand Up @@ -663,6 +675,8 @@ public function uninstallAction()
}
Pi::registry('field', 'user')->clear();
Pi::registry('compound_field', 'user')->clear();
Pi::registry('display_group', 'user')->clear();
Pi::registry('display_field', 'user')->clear();

$fields = array();
$compounds = array();
Expand Down Expand Up @@ -714,14 +728,17 @@ public function uninstallAction()
*/
public function activateAction()
{
/*
if (!$this->isActive()) {
$module = $this->getModule();
// Skip for active user module, or other modules w/o user installed
if (!$this->isActive() || ($this->isActive() && 'user' == $module)) {
return;
}
*/

$module = $this->getModule();
Pi::registry('field', 'user')->clear();
Pi::registry('compound_field', 'user')->clear();
Pi::registry('display_group', 'user')->clear();
Pi::registry('display_field', 'user')->clear();

foreach (array('field', 'timeline', 'activity', 'quicklink')
as $op
Expand All @@ -744,6 +761,8 @@ public function deactivateAction()
$module = $this->getModule();
Pi::registry('field', 'user')->clear();
Pi::registry('compound_field', 'user')->clear();
Pi::registry('display_group', 'user')->clear();
Pi::registry('display_field', 'user')->clear();

foreach (array('field', 'timeline', 'activity', 'quicklink')
as $op
Expand Down Expand Up @@ -798,7 +817,6 @@ protected function addFields(array $fields)
*/
protected function dropFields(array $fields)
{
//$meta = Pi::registry('field', 'user')->read('profile');
$table = Pi::model('profile', 'user')->getTable();
$meta = Pi::db()->metadata()->getColumns($table);
$pattern = 'ALTER TABLE ' . $table . ' DROP `%s`';
Expand Down
2 changes: 1 addition & 1 deletion lib/Pi/Application/Registry/ThemeModuleAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function loadDynamic($options = array())
$files = array();
$appendVersion = isset($options['v']) ? $options['v'] : null;
$theme = $options['theme'];
$type = $options['type'];
//$type = $options['type'];
//$path = Pi::service('asset')->getSourcePath('theme/' . $theme . '/', $type) . '/module';
$path = Pi::path('theme/' . $theme . '/module');
$component = 'theme/' . $theme . '/module';
Expand Down
2 changes: 1 addition & 1 deletion lib/Pi/Application/Service/Captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function load($type = null, $options = array())
$type = $type ?: 'image';
$class = 'Pi\Captcha\\' . ucfirst($type);
if (!class_exists($class)) {
$class = 'Pi\Captcha\\' . ucfirst($type);
$class = 'Zend\Captcha\\' . ucfirst($type);
}
if ($options) {
$options = array_merge($this->options, $options);
Expand Down
2 changes: 1 addition & 1 deletion lib/Pi/Application/Service/Markup.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function __construct($options = array())
*/
public function render(
$content,
$renderer,
$renderer = null,
$parser = null,
$options = array()
) {
Expand Down
Loading

0 comments on commit f1888eb

Please sign in to comment.