Skip to content

Commit

Permalink
Merge branch 'master' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed May 7, 2015
2 parents a3bd874 + 37a0b74 commit e30bde0
Show file tree
Hide file tree
Showing 51 changed files with 791 additions and 590 deletions.
2 changes: 1 addition & 1 deletion documents/COPYRIGHT → LICENSE.md
@@ -1,4 +1,4 @@
Copyright (C) 2004-2010, Needlworks / Tatter Network Foundation.
Copyright (C) 2004-2015, Needlworks / Tatter Network Foundation.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand Down
30 changes: 19 additions & 11 deletions README.md
Expand Up @@ -13,6 +13,12 @@ Supports import/export individual data via XML compatible with other solutions i
* Expandable from individual blog to blog service platform.
* Supports easy backup and restore via TTXML format, which is supported by various platforms of 'Project Tattertools.'


[![License](https://img.shields.io/badge/license-GPLv2-green.svg)](http://www.gnu.org/licenses/gpl-2.0.html)
[![Unstable](https://img.shields.io/badge/unstable-2.0a1-red.svg)](https://github.com/Needlworks/Textcube/archive/latest-unstable.zip)
[![Testing](https://img.shields.io/badge/testing-1.10.7b1-green.svg)](https://github.com/Needlworks/Textcube/archive/latest-testing.zip)
[![Stable](https://img.shields.io/badge/stable-1.10.6-blue.svg)](https://github.com/Needlworks/Textcube/archive/latest-stable.zip)

## HISTORY

Textcube is based on online publishing platform 'Tattertools,' started by JH in 2004, developed by TNC in 2005 and GPLized in 2006. Tatter Network Foundation (TNF) developed Tattertools with TNC from Apr. 2006. Needlworks/TNF was dedicated to Tattertools' development from Nov. 2006, and started developing 'Project S2' as its successor. 'Textcube' was named by YJ Park, and made its debut in Aug. 2007.
Expand All @@ -21,20 +27,22 @@ Textcube is based on online publishing platform 'Tattertools,' started by JH in
Textcube supports various environments. However, you need at least one webserver supporting PHP environments, one database engine

* Web servers (Need at least one environment)
* Apache 2.1 or above
* Apache > 2.1
* fancyURL support with mod_rewrite module (recommended)
* Nginx 1.1
* IIS 5.0 or above
* Nginx > 1.1
* Lighttpd > 1.4
* PHP built-in Web Server > 5.5.7
* IIS > 5.0
* with ISAPI Rewrite Filter
* Language
* PHP 5.5 or above
* PHP > 5.5
* with iconv (for TTXML character converting from old servers) / gd module (for image resampling)
* Database Management System (Need at least one environment)
* MySQL > 5.0 / MariaDB 5.1 with UTF-8 character set and collation setting
* MySQL > 5.0 / MariaDB > 5.1 with UTF-8 character set and collation setting
* With PHP MySQLi extension (MySQLnd support is in development stage.)
* Cubrid R2008 or above
* PostgreSQL 8.3 or above
* Sqlite 3 or above
* Cubrid > R2008
* PostgreSQL > 8.3
* Sqlite > 3.0

For massive service / Heavy load environments

Expand All @@ -47,10 +55,10 @@ are strongly recommended.
## REQUIREMENTS (OLD VERSIONS)

* Web servers (Need at least one environment)
* Apache 1.3 or above
* Apache > 1.3
* fancyURL support with mod_rewrite module
* Language
* (Till Textcube 1.7) PHP 4.3~5.1, (Till Textcube 1.10) ~PHP 5.3
* (Till Textcube 1.7) PHP 4.3~5.1, (Till Textcube 1.10) PHP 5.0~5.3
* with iconv / gd module
* Database Management System (Need at least one environment)
* (Till Textcube 1.7) MySQL > 4.1 / MariaDB > 5 (lower version with UTF-8 emulation routine in Textcube)
Expand All @@ -73,7 +81,7 @@ This is apache setting ( < 2.4).
DocumentRoot /var/www/textcube/
<Directory /var/www/textcube>
AllowOverride FileInfo
Require all granted (+for apache > 2.4)
Require all granted (+needed for apache > 2.4)
Order allow,deny
allow from all
</Directory>
Expand Down
2 changes: 1 addition & 1 deletion app.yaml.template
Expand Up @@ -2,7 +2,7 @@

application: [# project instance name without quotes : test-voice-123 #]
version: 1
runtime: php
runtime: php55
api_version: 1

handlers:
Expand Down
16 changes: 10 additions & 6 deletions documents/changelog_ko.txt
Expand Up @@ -53,13 +53,17 @@
[TODO]

## v1.10.7 배포 요약
### 추가된 점
* 설치 : HTTPS 로 설치시 자동으로 SSL 옵션 추가 (#1669)

### 변경된 점
* 일반 : SSL 사용시 플러그인들 일부가 http 프로토콜을 사용하여 warning 이 뜨는 부분 수정 (#1669)

### 버그 수정
* 플러그인 : 플러그인이 다이나믹 리소스를 URL로 뿌려주는 경우 헤더에 404가 붙어서 날아가는 문제 수정 (#1799)
* 백업/복원 : 포매터 및 에디터 정보가 복원할 때 무조건 ttml 및 modern 이 되어버리는 문제 수정 (#1801)

* 백업/복원 : 포매터 및 에디터 정보 복원시 무조건 ttml 및 modern 이 되어버리는 문제 수정 (#1801)
* 백업/복원 : 오래된 텍스트큐브 버전에서 백업한 파일을 복원할 때 방명록이 누락될 수 있는 문제 수정 (#1802)


## v1.10.6 배포 요약
### 추가된 점
Expand Down Expand Up @@ -1614,11 +1618,11 @@ a3 * 설치 - DB 제거시 XMLRPCPingSettings 가 삭제되지 않는 문제
</requirements>
와 같이 지정할 수 있습니다.

또한 플러그인에서 현재 블로그가 전체 메타 페이지인지 개인 블로그인지 구분해서 동작하기 위해서는 misc::isMetaBlog를 사용하실 수 있습니다.
requireComponent('Textcube.Function.misc');
$isMetaBlog = misc::isMetaBlog();
또한 플러그인에서 현재 블로그가 전체 메타 페이지인지 개인 블로그인지 구분해서 동작하기 위해서는 Utils_Misc::isMetaBlog를 사용하실 수 있습니다.
$isMetaBlog = Utils_Misc::isMetaBlog();
와 같이 사용하면 됩니다.


* 관리자 플러그인의 도움말 편집
텍스트큐브 도움말 위키를 이용하여 관리자 플러그인들의 도움말 페이지를 만들 수 있습니다. 관리자 화면의 메뉴 막대 우측의 '도우미' 링크가 이제는 관리자 플러그인 화면인 상태에서도 현재 관리자 플러그인 주소로 링크되어 동작합니다. 위키에 사용자 등록을 하신 후 도움말 페이지를 등록할 수 있습니다.

Expand Down Expand Up @@ -1987,7 +1991,7 @@ Gifts
2 function TattertoolsBirthday_TattertoolsBirthday($target) {
3 global $configVal;
4 requireComponent('Textcube.Function.misc');
5 $data = misc::fetchConfigVal( $configVal);
5 $data = Utils_Misc::fetchConfigVal( $configVal);

### 스킨
#### 댓글/ 트랙백의 복수형 지원
Expand Down
58 changes: 47 additions & 11 deletions framework/data/Cubrid/Adapter.php
Expand Up @@ -90,11 +90,11 @@ public static function query($query, $compatibility = true) {
$query = str_replace('UNIX_TIMESTAMP()', Timestamp::getUNIXtime(), $query); // compatibility issue.
if (stripos($query, "ORDER BY") !== false) {
$origPagingInst = array(
'/(ASC|DESC) LIMIT ([0-9]+) OFFSET 0/si',
'/(ASC|DESC) LIMIT ([0-9]+) OFFSET ([0-9]+)/si',
'/(ASC|DESC) LIMIT (\d+) OFFSET 0/si',
'/(ASC|DESC) LIMIT (\d+) OFFSET (\d+)/si',
'/(ASC|DESC) LIMIT 1(^[0-9])/si',
'/(ASC|DESC) LIMIT ([0-9]+)/si',
'/RAND\(\) LIMIT ([0-9]+)/si'
'/(ASC|DESC) LIMIT (\d+)/si',
'/RAND\(\) LIMIT (\d+)/si'
);
$descPagingInst = array(
'$1 FOR ORDERBY_NUM() BETWEEN 1 AND $2',
Expand All @@ -106,11 +106,11 @@ public static function query($query, $compatibility = true) {
} else {
if (stripos($query, "GROUP BY") !== false) {
$origPagingInst = array(
'/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT ([0-9]+) OFFSET 0/si',
'/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT ([0-9]+) OFFSET ([0-9]+)/si',
'/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT (\d+) OFFSET 0/si',
'/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT (\d+) OFFSET ([0-9]+)/si',
'/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT 1(^[0-9])/si',
'/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT ([0-9]+)/si',
'/GROUP BY(.*)(ORDER BY)(.*)RAND\(\) LIMIT ([0-9]+)/si'
'/GROUP BY(.*)(ORDER BY)(.*)(ASC|DESC) LIMIT (\d+)/si',
'/GROUP BY(.*)(ORDER BY)(.*)RAND\(\) LIMIT (\d+)/si'
);
$descPagingInst = array(
'GROUP BY $1 HAVING GROUPBY_NUM() = $5 $2 $3 $4',
Expand All @@ -121,10 +121,10 @@ public static function query($query, $compatibility = true) {
);
} else {
$origPagingInst = array(
'/WHERE(.*)LIMIT ([0-9]+) OFFSET 0/si',
'/WHERE(.*)LIMIT ([0-9]+) OFFSET ([0-9]+)/si',
'/WHERE(.*)LIMIT (\d+) OFFSET 0/si',
'/WHERE(.*)LIMIT (\d+) OFFSET ([0-9]+)/si',
'/WHERE(.*)LIMIT 1(^[0-9])/si',
'/WHERE(.*)LIMIT ([0-9]+)/si',
'/WHERE(.*)LIMIT (\d+)/si',
'/SUM\((size|value)\)/si'
);
$descPagingInst = array(
Expand Down Expand Up @@ -446,6 +446,42 @@ public static function fieldType($abstractType) {
}
}

public static function structure($tableName) {
$result = self::queryAll("DESCRIBE ".$tableName);
$structure = array();
foreach ($result as $r) {
$structure[$r['Field']] = array();
preg_match('/(.*)\((\d+)\)/si',$r['Type'], $match);
switch (count($match)) {
case 2:
$type = array_search($match[1],self::$typeTable);
break;
case 3:
$type = array_search($match[1],self::$typeTable);
$structure[$r['Field']]['length'] = $match[2];
break;
}
$structure[$r['Field']]['type'] = $type;
if ($r['Null'] == 'NO') {
$structure[$r['Field']]['isNull'] = false;
} else {
$structure[$r['Field']]['isNull'] = true;
}
if ($r['Key'] == 'PRI') {
if (!isset($this->option['primary'])) {
$this->option['primary'] = array();
}
array_push($this->option['primary'], $r['Field']);
} elseif ($r['Key'] == 'MUL') {
$structure[$r['Field']]['index'] = true;
}
if ($r['Default'] != 'NULL') {
$structure[$r['Field']]['default'] = $r['Default'];
}
}
return $structure;
}

static $typeTable = array(
"integer" => "integer",
"int" => "integer",
Expand Down
27 changes: 26 additions & 1 deletion framework/data/DBModel.php
Expand Up @@ -36,11 +36,12 @@ function doesExistTable($tablename) {

/* DBModel : lightweight database abstraction implementation for codeball / Textcube.
2.4.1.20150212
2.5.0.20150504
Needlworks / Tatter Network Foundation. (http://www.needlworks.org)
*/

/*
2.5.0 (2015.5.4) : Added - aliases for ontology approaches.
2.4.2 (2015.2.19) : Added - Affirmation / Negation
2.4.1 (2015.2.12) : Added - setProjection accepts comma-separated input string.
2.4.0 (2015.2.10) : Added - store / restore method to keep track of nested queries.
Expand Down Expand Up @@ -666,6 +667,30 @@ public function discard() {
return false;
}

/* POD-oriented ontology approaches (basics) */
public function define() {
return $this->create();
}

public function purge(){
return $this->delete();
}

public function getStructure() {
$this->structure = POD::structure();
return $this->structure;
}

public function restrict() {
$args = func_get_args();
if (is_array($args[0])) {
return $this->setQualifierSet($args);
} else {
return $this->setQualifier($args);
}
}

/* Private methods */
private function _getTableName($table = null) {
if (is_null($table)) {
$table = $this->table;
Expand Down
36 changes: 36 additions & 0 deletions framework/data/MySQL/Adapter.php
Expand Up @@ -384,6 +384,42 @@ public static function fieldType($abstractType) {
}
}

public static function structure($tableName) {
$result = self::queryAll("DESCRIBE ".$tableName);
$structure = array();
foreach ($result as $r) {
$structure[$r['Field']] = array();
preg_match('/(.*)\((\d+)\)/si',$r['Type'], $match);
switch (count($match)) {
case 2:
$type = array_search($match[1],self::$typeTable);
break;
case 3:
$type = array_search($match[1],self::$typeTable);
$structure[$r['Field']]['length'] = $match[2];
break;
}
$structure[$r['Field']]['type'] = $type;
if ($r['Null'] == 'NO') {
$structure[$r['Field']]['isNull'] = false;
} else {
$structure[$r['Field']]['isNull'] = true;
}
if ($r['Key'] == 'PRI') {
if (!isset($this->option['primary'])) {
$this->option['primary'] = array();
}
array_push($this->option['primary'], $r['Field']);
} elseif ($r['Key'] == 'MUL') {
$structure[$r['Field']]['index'] = true;
}
if ($r['Default'] != 'NULL') {
$structure[$r['Field']]['default'] = $r['Default'];
}
}
return $structure;
}

public static $typeTable = array(
"integer" => "int",
"int" => "int",
Expand Down
36 changes: 36 additions & 0 deletions framework/data/MySQLi/Adapter.php
Expand Up @@ -374,6 +374,42 @@ public static function fieldType($abstractType) {
}
}

public static function structure($tableName) {
$result = self::queryAll("DESCRIBE ".$tableName);
$structure = array();
foreach ($result as $r) {
$structure[$r['Field']] = array();
preg_match('/(.*)\((\d+)\)/si',$r['Type'], $match);
switch (count($match)) {
case 2:
$type = array_search($match[1],self::$typeTable);
break;
case 3:
$type = array_search($match[1],self::$typeTable);
$structure[$r['Field']]['length'] = $match[2];
break;
}
$structure[$r['Field']]['type'] = $type;
if ($r['Null'] == 'NO') {
$structure[$r['Field']]['isNull'] = false;
} else {
$structure[$r['Field']]['isNull'] = true;
}
if ($r['Key'] == 'PRI') {
if (!isset($this->option['primary'])) {
$this->option['primary'] = array();
}
array_push($this->option['primary'], $r['Field']);
} elseif ($r['Key'] == 'MUL') {
$structure[$r['Field']]['index'] = true;
}
if ($r['Default'] != 'NULL') {
$structure[$r['Field']]['default'] = $r['Default'];
}
}
return $structure;
}

private static $typeTable = array(
"integer" => "int",
"int" => "int",
Expand Down
36 changes: 36 additions & 0 deletions framework/data/PostgreSQL/Adapter.php
Expand Up @@ -419,6 +419,42 @@ public static function fieldType($abstractType) {
}
}

public static function structure($tableName) {
$result = self::queryAll("DESCRIBE ".$tableName);
$structure = array();
foreach ($result as $r) {
$structure[$r['Field']] = array();
preg_match('/(.*)\((\d+)\)/si',$r['Type'], $match);
switch (count($match)) {
case 2:
$type = array_search($match[1],self::$typeTable);
break;
case 3:
$type = array_search($match[1],self::$typeTable);
$structure[$r['Field']]['length'] = $match[2];
break;
}
$structure[$r['Field']]['type'] = $type;
if ($r['Null'] == 'NO') {
$structure[$r['Field']]['isNull'] = false;
} else {
$structure[$r['Field']]['isNull'] = true;
}
if ($r['Key'] == 'PRI') {
if (!isset($this->option['primary'])) {
$this->option['primary'] = array();
}
array_push($this->option['primary'], $r['Field']);
} elseif ($r['Key'] == 'MUL') {
$structure[$r['Field']]['index'] = true;
}
if ($r['Default'] != 'NULL') {
$structure[$r['Field']]['default'] = $r['Default'];
}
}
return $structure;
}

static $typeTable = array(
"integer" => "integer",
"int" => "integer",
Expand Down

0 comments on commit e30bde0

Please sign in to comment.