Skip to content

Commit

Permalink
Merge pull request #22 from Risoluto/PSR1
Browse files Browse the repository at this point in the history
Code fix to PSR-1
  • Loading branch information
hayakawa committed Nov 16, 2014
2 parents 8e77c2e + 2b84742 commit 727937e
Show file tree
Hide file tree
Showing 50 changed files with 1,638 additions and 1,618 deletions.
2 changes: 1 addition & 1 deletion public_html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@
//------------------------------------------------------//
/** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */
$risoluto_instance = new \Risoluto\Core;
$risoluto_instance->Perform();
$risoluto_instance->perform();
10 changes: 5 additions & 5 deletions risoluto/apps/RisolutoApps/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class Error extends \Risoluto\RisolutoControllerBase implements \Risoluto\Risolu
*
* @return void なし
*/
public function Play()
public function play()
{
// ヘッダ情報のセット
$header = $this->GetDefaultHeader();
$header = $this->ReplaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');
$header = $this->ReplaceHeader($header, 'title', 'エラーが発生しました');
$header = $this->getDefaultHeader();
$header = $this->replaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');
$header = $this->replaceHeader($header, 'title', 'エラーが発生しました');

// テンプレートエンジン関連の処理
$assign_value = array('header' => $header);
$this->RisolutoView($assign_value);
$this->risolutoView($assign_value);
}
}
12 changes: 6 additions & 6 deletions risoluto/apps/RisolutoApps/Sample/Sample1.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Sample1 extends \Risoluto\RisolutoControllerBase implements \Risoluto\Riso
use \Risoluto\RisolutoViewTrait;

/**
* Play()
* play()
*
* 主処理を行う
*
Expand All @@ -34,17 +34,17 @@ class Sample1 extends \Risoluto\RisolutoControllerBase implements \Risoluto\Riso
*
* @return void なし
*/
public function Play()
public function play()
{
// ユーザ定義のライブラリコール例
\RisolutoUserLibs\SampleLibs::SampleMethod();
\RisolutoUserLibs\SampleLibs::sampleMethod();

// ヘッダ情報のセット
$header = $this->GetDefaultHeader();
$header = $this->ReplaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');
$header = $this->getDefaultHeader();
$header = $this->replaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');

// テンプレートエンジン関連の処理
$assign_value = array('header' => $header);
$this->RisolutoView($assign_value);
$this->risolutoView($assign_value);
}
}
12 changes: 6 additions & 6 deletions risoluto/apps/RisolutoApps/Sample/Sample2.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Sample2 extends \Risoluto\RisolutoControllerBase implements \Risoluto\Riso
use \Risoluto\RisolutoViewTrait;

/**
* Play()
* play()
*
* 主処理を行う
*
Expand All @@ -34,14 +34,14 @@ class Sample2 extends \Risoluto\RisolutoControllerBase implements \Risoluto\Riso
*
* @return void なし
*/
public function Play()
public function play()
{
// ユーザ定義のライブラリコール例
\RisolutoUserLibs\SampleLibs::SampleMethod();
\RisolutoUserLibs\SampleLibs::sampleMethod();

// ヘッダ情報のセット
$header = $this->GetDefaultHeader();
$header = $this->ReplaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');
$header = $this->getDefaultHeader();
$header = $this->replaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');


// テンプレートエンジン関連の処理
Expand All @@ -52,6 +52,6 @@ public function Play()
'post' => $_POST,
'server' => $_SERVER
);
$this->RisolutoView($assign_value);
$this->risolutoView($assign_value);
}
}
12 changes: 6 additions & 6 deletions risoluto/apps/RisolutoApps/Sample/Sample3.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Sample3 extends \Risoluto\RisolutoControllerBase implements \Risoluto\Riso
use \Risoluto\RisolutoViewTrait;

/**
* Play()
* play()
*
* 主処理を行う
*
Expand All @@ -34,17 +34,17 @@ class Sample3 extends \Risoluto\RisolutoControllerBase implements \Risoluto\Riso
*
* @return void なし
*/
public function Play()
public function play()
{
// ユーザ定義のライブラリコール例
\RisolutoUserLibs\SampleLibs::SampleMethod();
\RisolutoUserLibs\SampleLibs::sampleMethod();

// ヘッダ情報のセット
$header = $this->GetDefaultHeader();
$header = $this->ReplaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');
$header = $this->getDefaultHeader();
$header = $this->replaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');

// テンプレートエンジン関連の処理
$assign_value = array('header' => $header);
$this->RisolutoView($assign_value);
$this->risolutoView($assign_value);
}
}
18 changes: 9 additions & 9 deletions risoluto/apps/RisolutoApps/Sample/Sample4.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Sample4 extends \Risoluto\RisolutoControllerBase implements \Risoluto\Riso
use \Risoluto\RisolutoViewTrait;

/**
* Play()
* play()
*
* 主処理を行う
*
Expand All @@ -34,33 +34,33 @@ class Sample4 extends \Risoluto\RisolutoControllerBase implements \Risoluto\Riso
*
* @return void なし
*/
public function Play()
public function play()
{
// ユーザ定義のライブラリコール例
\RisolutoUserLibs\SampleLibs::SampleMethod();
\RisolutoUserLibs\SampleLibs::sampleMethod();

//--- DB関連の操作(ここから)
// モデルインスタンスを作成する
$model = new Sample4Model();

// モデルの初期処理を実行
$dat = '';
if ($model->Begin()) {
if ($model->begin()) {

// 全データを取得する
$dat = $model->GetAll();
$dat = $model->getAll();

// モデルの最終処理を実行
$model->End();
$model->end();
}
//--- DB関連の操作(ここまで)

// ヘッダ情報のセット
$header = $this->GetDefaultHeader();
$header = $this->ReplaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');
$header = $this->getDefaultHeader();
$header = $this->replaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');

// テンプレートエンジン関連の処理
$assign_value = array('header' => $header, 'dat' => $dat);
$this->RisolutoView($assign_value);
$this->risolutoView($assign_value);
}
}
20 changes: 10 additions & 10 deletions risoluto/apps/RisolutoApps/Sample/Sample4Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class Sample4Model extends \Risoluto\RisolutoModelBase
{
/**
* Begin()
* begin()
*
* モデルの初期処理を行う
*
Expand All @@ -31,18 +31,18 @@ class Sample4Model extends \Risoluto\RisolutoModelBase
*
* @return 処理結果(true: 成功 / false: 失敗)
*/
public function Begin()
public function begin()
{
// コンフィグから接続情報を取得する
$db_conf = new \Risoluto\Conf;
$db_conf->Parse(RISOLUTO_CONF . 'risoluto_db.ini');
$db_conf->parse(RISOLUTO_CONF . 'risoluto_db.ini');

// DBへ接続する
return $this->db->Connect($db_conf->GetIni('DB'));
return $this->db->connect($db_conf->getIni('DB'));
}

/**
* GetAll()
* getAll()
*
* テーブル中の全データを取得する
*
Expand All @@ -52,13 +52,13 @@ public function Begin()
*
* @return string テーブル中の全データ
*/
public function GetAll()
public function getAll()
{
return $this->db->DoQuery("SELECT id, column1, column2 FROM risoluto_db_test;");
return $this->db->doQuery("SELECT id, column1, column2 FROM risoluto_db_test;");
}

/**
* End()
* end()
*
* モデルの最終処理を行う
*
Expand All @@ -68,9 +68,9 @@ public function GetAll()
*
* @return void なし
*/
public function End()
public function end()
{
// DB接続を解除する
$this->db->DisConnect();
$this->db->disConnect();
}
}
10 changes: 5 additions & 5 deletions risoluto/apps/RisolutoApps/ServiceStop.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class ServiceStop extends \Risoluto\RisolutoControllerBase implements \Risoluto\
*
* @return void なし
*/
public function Play()
public function play()
{
// ヘッダ情報のセット
$header = $this->GetDefaultHeader();
$header = $this->ReplaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');
$header = $this->ReplaceHeader($header, 'title', '現在サービスを停止しています');
$header = $this->getDefaultHeader();
$header = $this->replaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');
$header = $this->replaceHeader($header, 'title', '現在サービスを停止しています');

// テンプレートエンジン関連の処理
$assign_value = array('header' => $header);
$this->RisolutoView($assign_value);
$this->risolutoView($assign_value);
}
}
10 changes: 5 additions & 5 deletions risoluto/apps/RisolutoApps/Top.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Top extends \Risoluto\RisolutoControllerBase implements \Risoluto\Risoluto
use \Risoluto\RisolutoViewTrait;

/**
* Play()
* play()
*
* 主処理を行う
*
Expand All @@ -34,14 +34,14 @@ class Top extends \Risoluto\RisolutoControllerBase implements \Risoluto\Risoluto
*
* @return void なし
*/
public function Play()
public function play()
{
// ヘッダ情報のセット
$header = $this->GetDefaultHeader();
$header = $this->ReplaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');
$header = $this->getDefaultHeader();
$header = $this->replaceHeader($header, 'robots', 'NOINDEX,NOFOLLOW');

// テンプレートエンジン関連の処理
$assign_value = array('header' => $header);
$this->RisolutoView($assign_value);
$this->risolutoView($assign_value);
}
}
12 changes: 11 additions & 1 deletion risoluto/conf/risoluto.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,14 @@ max_loadavg = 3
; 【設定項目解説】
; outboards : 使用するテーマが格納されたディレクトリ名を指定
[THEME]
outboards = "vendor"
outboards = "vendor"

;☆認証関連の設定
; 【設定項目解説】
; provider : 認証プロバイダーを指定
; users : ユーザ情報定義が含まれるリソース
; groups : グループ情報定義が含まれるリソース
[AUTH]
provider = "Risoluto\\AuthDb"
users = "risoluto_users"
groups = "risoluto_groups"
4 changes: 3 additions & 1 deletion risoluto/conf/risoluto_db.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
; pass : DB接続パスワード
; dbname : DB名
; host : DBホスト名
; charset : キャラクタセット
; persistent : 永続的な接続を使うか(true or false)
[DB]
dsn = ""
dsn = "mysql:dbname=risoluto_db_test;hostname=localhost;charset=utf8"
driver = "mysql"
user = "root"
pass = ""
dbname = "risoluto_db_test"
host = "localhost"
charset = "utf8"
persistent = true
12 changes: 6 additions & 6 deletions risoluto/lib/vendor/Risoluto/Conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Conf
// クラスメソッド定義
//------------------------------------------------------//
/**
* GetParseStatus()
* getParseStatus()
*
* パース状況を取得する
*
Expand All @@ -51,13 +51,13 @@ class Conf
*
* @return boolean パース状況(true:パース済み/false:未パース)
*/
public function GetParseStatus()
public function getParseStatus()
{
return $this->parsestatus;
}

/**
* Parse($path)
* parse($path)
*
* 引数で与えられたパスよりiniファイルを読み込みパースする
*
Expand All @@ -67,7 +67,7 @@ public function GetParseStatus()
*
* @return boolean パース結果(true:正常終了/false:異常終了)
*/
public function Parse($path)
public function parse($path)
{
// ファイルが存在しているかをテスト
clearstatcache();
Expand All @@ -88,7 +88,7 @@ public function Parse($path)
}

/**
* GetIni($section = '', $key = '')
* getIni($section = '', $key = '')
*
* パース済みiniファイルより、セクションのみが指定された場合はセクション内すべての値を配列を、
* キーが指定された場合はキーが持つ値を返却する
Expand All @@ -102,7 +102,7 @@ public function Parse($path)
*
* @return mixed セクションに対応する配列、またはキーに対応する値。どちらも存在しない場合はnull
*/
public function GetIni($section = '', $key = '')
public function getIni($section = '', $key = '')
{
// 一度もパースされていない場合は、nullを返す
if (!$this->parsestatus) {
Expand Down

0 comments on commit 727937e

Please sign in to comment.