Changeset 20610

Show
Ignore:
Timestamp:
10/03/08 17:45:22 (3 months ago)
Author:
anatoo
Message:

bug fix

Location:
events/phpframework/plain_php/trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/plain_php/trunk/action/FollowAction.php

    r20337 r20610  
    2525            $this->getFriendshipService()->follow($user_id, $this->followID); 
    2626            send_mail($follow_user['email'],  
    27                       $user_name . ' is now following you on Twitter!',  
     27                      $user_name . ' is now following you on Phwittr!',  
    2828                      $user_name . ' があなたをフォローし始めました。 
    2929  
     
    3939            $this->getFriendshipService()->request($user_id, $this->followID); 
    4040            send_mail($follow_user['email'],  
    41                       $user_name . ' is now requesting you on Twitter!',  
     41                      $user_name . ' is now requesting you on Phwittr!',  
    4242                      $user_name . ' があなたをフォローするためにリクエストしました。 
    4343  
  • events/phpframework/plain_php/trunk/core/ApplicationContext.php

    r20040 r20610  
    22 
    33class ApplicationContext 
    4 { 
    5     protected $baseUrl, $basePath, $templateBaseUrl, $templateBasePath; 
    6     function __construct($base_path,  
    7                          $base_url,  
    8                          $template_base_path,  
    9                          $template_base_url,  
    10                          $cookie_domain, 
    11                          $cookie_path) 
    12     { 
    13         $_ = $this; 
    14         list($_->basePath,  
    15              $_->baseUrl,  
    16              $_->templateBasePath,  
    17              $_->templateBaseUrl,  
    18              $_->cookieDomain, 
    19              $_->cookiePath) = func_get_args(); 
    20     } 
     4 
     5    protected $baseUrl, $basePath, $templateBaseUrl, $templateBasePath, $dsn, $dbUser, $dbPassword, $cookieDomain, $cookiePath; 
    216    function __get($name) 
    227    { 
     
    249        return $this->{$name}; 
    2510    } 
     11    function setBaseUrl($v) 
     12    { 
     13        $this->baseUrl = $v; 
     14        return $this; 
     15    } 
     16    function setBasePath($v) 
     17    { 
     18        $this->basePath = $v; 
     19        return $this; 
     20    } 
     21    function setTemplateBaseUrl($v) 
     22    { 
     23        $this->templateBaseUrl = $v; 
     24        return $this; 
     25    } 
     26     
     27    function setTemplateBasePath($v) 
     28    { 
     29        $this->templateBasePath = $v; 
     30        return $this; 
     31    } 
     32     
     33    function setDsn($v) 
     34    { 
     35        $this->dsn = $v; 
     36        return $this; 
     37    } 
     38    function setDbUser($v) 
     39    { 
     40        $this->dbUser = $v; 
     41        return $this; 
     42    } 
     43    function setDbPassword($v) 
     44    { 
     45        $this->dbPassword = $v; 
     46        return $this; 
     47    } 
     48 
     49    function setCookiePath($v) 
     50    { 
     51        $this->cookiePath = $v; 
     52        return $this; 
     53    } 
     54    function setCookieDomain($v) 
     55    { 
     56        $this->cookieDomain = $v; 
     57        return $this; 
     58    } 
    2659} 
  • events/phpframework/plain_php/trunk/core/ObjectBuilder.php

    r20336 r20610  
    1717    function buildPDO() 
    1818    { 
    19         $obj = new PDO('mysql:host=127.0.0.1;dbname=phwittr', 'phwittr', 'phwittr'); 
     19        $c = self::$context; 
     20        $obj = new PDO($c->dsn, $c->dbUser, $c->dbPassword); 
    2021        $obj->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 
    2122        $obj->exec('SET NAMES UTF8'); 
  • events/phpframework/plain_php/trunk/index.php

    r20339 r20610  
    33 
    44 
     5$c = new ApplicationContext; 
     6$c->setBasePath(dirname(__FILE__)) 
     7  ->setBaseUrl('http://localhost/phwittr') 
     8  ->setTemplateBasePath(dirname(__FILE__) . '/resource') 
     9  ->setTemplateBaseUrl('http://localhost/phwittr/resource') 
     10  ->setDsn('mysql:dbname=phwittr;host=127.0.0.1') 
     11  ->setDbUser('phwittr') 
     12  ->setCookieDomain('localhost') 
     13  ->setCookiePath('/phwittr') 
     14  ->setDbPassword('phwittr'); 
     15ObjectBuilder::setApplicationContext($c); 
     16 
     17 
    518$response = ref(new PhwittrFront)->process(new Request('UTF-8'), $c, new RendererBuilder($c)); 
    6 /* TODO 例外handlerをつける */ 
  • events/phpframework/plain_php/trunk/init.php

    r20339 r20610  
    1313 
    1414 
    15 $c = new ApplicationContext(dirname(__FILE__), 'http://localhost/phwittr',  
    16                             dirname(__FILE__) . '/resource', 'http://localhost/phwittr/resource', 
    17                             'localhost', 
    18                             '/phwittr'); 
    19 ObjectBuilder::setApplicationContext($c); 
    2015 
    2116mb_language('japanese'); 
  • events/phpframework/plain_php/trunk/resource/login.php

    r20038 r20610  
    3737 
    3838<?php if ($r->existsMessage()) foreach ($r->getMessages() as $m): ?> 
    39     <?php foreach ($r->getMessages() as $m): ?> 
    4039    <p class="warning"><?php echo $m ?></p> 
    41     <?php endforeach ?> 
    4240<?php endforeach ?> 
    4341 
  • events/phpframework/plain_php/trunk/resource/sessions.php

    r20038 r20610  
    3737 
    3838<?php if ($r->existsMessage()) foreach ($r->getMessages() as $m): ?> 
    39     <?php foreach ($r->getMessages() as $m): ?> 
    4039    <p class="warning"><?php echo $m ?></p> 
    41     <?php endforeach ?> 
    4240<?php endforeach ?> 
    4341