Changeset 1489
- Timestamp:
- 11/14/09 16:59:00 (10 months ago)
- Location:
- applications/nimpad/branches/0.2/lib
- URL:
- http://svn.nequal.jp/applications/nimpad/branches/0.2/lib
- Files:
-
- 5 edited
-
NimpadAdmin.php (modified) (2 diffs)
-
components/Root.php (modified) (1 diff)
-
dao/Wiki.php (modified) (1 diff)
-
nim/Mailer.php (modified) (1 diff)
-
nim/locator/Deployment.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
applications/nimpad/branches/0.2/lib/NimpadAdmin.php
r1292 r1489 24 24 25 25 /** 26 * @var string 27 */ 28 public $baseurl; 29 30 /** 26 31 * ランダムな名前を持つwikiの作成 27 32 * 28 33 * @param string 34 * @param string $baseurl ex. http://hoge.com/ 29 35 * @return string ランダムな名前 30 36 */ 31 function createNewWiki($text )37 function createNewWiki($text, $baseurl) 32 38 { 33 39 $this->pdo->beginTransaction(); … … 35 41 $name = $this->findNewRandomName(); 36 42 $wiki_id = $this->daoWiki->create($name, array('home' => 'README')); 37 $this->daoPage->create($wiki_id, 'README', array('html' => $this->textProcessor->render('hatena', $text, 'README'), 'text' => $text)); 43 $this->daoPage->create($wiki_id, 'README', 44 array('html' => $this->textProcessor->render('hatena', $text, 'README', $baseurl . $name . '/'), 45 'text' => $text)); 38 46 $this->pdo->commit(); 39 47 } catch (PDOException $e) { -
applications/nimpad/branches/0.2/lib/components/Root.php
r1339 r1489 36 36 } 37 37 38 $name = $this->nimpadAdmin->createNewWiki($text );38 $name = $this->nimpadAdmin->createNewWiki($text, $this->url('/')); 39 39 return new k_SeeOther($this->url($name . '/')); 40 40 } -
applications/nimpad/branches/0.2/lib/dao/Wiki.php
r1344 r1489 153 153 { 154 154 $smt = $this->pdo->prepare(' 155 UPDATE nim_ Wiki155 UPDATE nim_wiki 156 156 SET status = ? 157 157 WHERE id = ? -
applications/nimpad/branches/0.2/lib/nim/Mailer.php
r1376 r1489 6 6 function __construct($from_author, $from_address) 7 7 { 8 $this->from = 'From: ' . mb_encode_mimeheader(mb_convert_encoding($from_author, 'JIS', 'UTF-8')) . ' <' . $from_address . '>';8 $this->from = 'From: ' . mb_encode_mimeheader(mb_convert_encoding($from_author, 'JIS', 'UTF-8')) . ' <' . $from_address . '>'; 9 9 } 10 10 -
applications/nimpad/branches/0.2/lib/nim/locator/Deployment.php
r1333 r1489 12 12 return array(new nim_ExceptionHandler($this->factory, $this->context), 'handleForDeployment'); 13 13 } 14 15 protected function createPdo() 16 { 17 $option = array(/*PDO::ATTR_PERSISTENT => true, */PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'); 18 $pdo = new PDO('mysql:dbname=nimpad;host=127.0.0.1', 'nimpad', $this->dbPassword, $option); 19 $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 20 return $pdo; 21 } 14 22 }
Note: See TracChangeset
for help on using the changeset viewer.
