-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49c11b4
commit f53c433
Showing
851 changed files
with
199,270 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
set nonumber | ||
|
||
" ノラ用のテンプレート | ||
" | ||
autocmd BufNewFile *.php silent! 0r doc/template/skelton.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#本番用 | ||
[ production ] | ||
env = production | ||
static.useCache = 1 | ||
# PHPの設定 | ||
php.display_errors = 0 | ||
# マルチバイト言語用の設定 | ||
mb.internal_encoding = utf8 | ||
mb.language = ja | ||
# クラスの設定 | ||
class.namespace = NoraApplication | ||
class.path = APP_HOME/src/class | ||
########################################### | ||
# ブートストラッパの設定 | ||
########################################### | ||
# ブートストラッパの設定 | ||
bootstrapper.class = NoraApplication\Bootstrapper | ||
|
||
########################################### | ||
# リソースの設定 | ||
########################################### | ||
# | ||
# ロガーの設定 | ||
resource.logging.loggerName = Application | ||
resource.logging.type = file | ||
resource.logging.file = /tmp/application-log | ||
resource.logging.mode = a | ||
resource.logging.reportingLevel = self::E_ALL ^ self::E_DEBUG | ||
# | ||
# ビューの設定 | ||
resource.view.viewPath = APP_HOME/view | ||
# | ||
# レイアウトの設定 | ||
resource.layout.path = APP_HOME/layout/script | ||
# | ||
# コントローラの設定 | ||
resource.FrontController.controllerPath = APP_HOME/controller | ||
# | ||
# メイラの設定 | ||
resource.mailer.smtp.host = tls://smtp.gmail.com | ||
resource.mailer.smtp.port = 465 | ||
resource.mailer.smtp.user = [email protected] | ||
resource.mailer.smtp.passwd = bopdtvqfrcvymxmg | ||
# | ||
# モジュールの設定 | ||
resource.modules.modulesPath = APP_HOME/modules | ||
|
||
# 開発用 | ||
[ development : production ] | ||
env = development | ||
static.useCache = 0 | ||
# PHPの設定 | ||
php.display_errors = 1 | ||
resource.logging.reportingLevel = self::E_ALL | ||
resource.logging.loggerName = Application | ||
resource.logging.type = default | ||
resource.logging.logFormat = [:label(:level)] [:name] :message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#本番用 | ||
[ production ] | ||
class.namespace = NoraModule\Theme | ||
class.path = NORAMODULE_THEME_HOME/src/class | ||
# 開発用 | ||
[ development : production ] |
47 changes: 47 additions & 0 deletions
47
doc/examples/application/modules/theme/src/class/Controller/StaticController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ | ||
|
||
/** | ||
* のらプロジェクト:クラスファイル | ||
* | ||
* @category Application | ||
* @package Application | ||
* @author ハジメ <[email protected]> | ||
* @copyright opyright (c) 2013, Nora Project All rights reserved. | ||
* @license http://www.hazime.org/license/bsd.txt 修正BSDライセンス | ||
* @version $Id$ | ||
*/ | ||
namespace NoraModule\Theme\Controller; | ||
|
||
use Nora\Application; | ||
|
||
/** | ||
* コントローラー | ||
*/ | ||
class StaticController implements Application\ControllerIF | ||
{ | ||
use Application\ControllerTrait; | ||
|
||
public function actionIndex( $req, $res ) | ||
{ | ||
if( !isset($req['request_uri']) ) return; | ||
|
||
$request_uri = $req['request_uri']; | ||
$file = NORAMODULE_THEME_HOME.'/themes/'.$request_uri; | ||
|
||
if(!file_exists($file)) dir(" $file not found "); | ||
|
||
// ドキュメントルートに書き出す | ||
$target = $req->getDocumentRoot().'/themes/'.$request_uri; | ||
|
||
$dirname = dirname($target); | ||
|
||
if( !nora_mkdir_recursive($dirname) ) die("ディレクトリ $dirname が作成できません"); | ||
|
||
if( is_writable( $target ) die("ターゲット $target に書き込みができません"); | ||
|
||
file_put_contents( $target, $contents = file_get_contents( $file ) ); | ||
echo $contents; | ||
die(); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
doc/examples/application/modules/theme/themes/default/assets/css/reset.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background : red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ | ||
|
||
/** | ||
* のらプロジェクト:クラスファイル | ||
* | ||
* @category Application | ||
* @package Application | ||
* @author ハジメ <[email protected]> | ||
* @copyright opyright (c) 2013, Nora Project All rights reserved. | ||
* @license http://www.hazime.org/license/bsd.txt 修正BSDライセンス | ||
* @version $Id$ | ||
*/ | ||
namespace NoraApplication; | ||
|
||
use Nora\Application; | ||
|
||
/** | ||
* ブートスラッパ | ||
*/ | ||
class Bootstrapper extends Application\Bootstrapper | ||
{ | ||
|
||
public function _initRouter( $setting ) | ||
{ | ||
$router = parent::_initRouter( $setting ); | ||
|
||
$router->addRoute(100, '/themes/:request_uri', array('module'=>'theme','controller'=>'static','action'=>'index')); | ||
$router->addRoute(999, ':request_uri', array('controller'=>'staticPublish','action'=>'index','request_uri'=>'index.html')); | ||
|
||
return $router; | ||
} | ||
|
||
public function _initView( $setting ) | ||
{ | ||
$view = parent::_initView( $setting ); | ||
$view = $this->initComponent('view', $view ); | ||
|
||
$view->headMeta( )->charset('utf8'); | ||
$view->headMeta( )->name('keyword','test,nora,php,framework,国産'); | ||
$view->headMeta( )->httpEquiv('content-type','text/html; charset=UTF-8'); | ||
$view->headMeta( )->property('og:title','たいとる'); | ||
|
||
$view->headMeta( )->twitter('card','summary'); | ||
$view->headMeta( )->twitter('site','@hajime-mat'); | ||
$view->headMeta( )->twitter('creater','@hajime-mat'); | ||
$view->headMeta( )->twitter('url','http://dev.hazime.org/index.php'); | ||
$view->headMeta( )->twitter('title','松本ハジメのWEBサイト'); | ||
$view->headMeta( )->twitter('description','松本ハジメのWEBサイト'); | ||
$view->headMeta( )->twitter('image',''); | ||
|
||
$view->headMeta( )->og('site_name','松本ハジメのWEBサイト'); | ||
$view->headMeta( )->og('title','松本ハジメのWEBサイト'); | ||
$view->headMeta( )->og('description','松本ハジメのWEBサイト'); | ||
$view->headMeta( )->og('url','http://dev.hazime.org/index.php'); | ||
$view->headMeta( )->og('type','profile'); | ||
$view->headMeta( )->og('image','profile'); | ||
|
||
$view->headStyle( )->appendFile('/assets/css/reset.css'); | ||
$view->headScript( )->appendFile('/assets/js/jQuery.js'); | ||
$view->bodyScript( )->appendCode('alert("loaded");'); | ||
$view->googleAnalytics('UA-37941501-1'); | ||
|
||
return $view; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ | ||
|
||
/** | ||
* のらプロジェクト:クラスファイル | ||
* | ||
* @category NoraApplication | ||
* @package Controller | ||
* @author ハジメ <[email protected]> | ||
* @copyright opyright (c) 2013, Nora Project All rights reserved. | ||
* @license http://www.hazime.org/license/bsd.txt 修正BSDライセンス | ||
* @version $Id$ | ||
*/ | ||
namespace NoraApplication\Controller; | ||
|
||
use Nora\Controller; | ||
|
||
/** | ||
* コントローラー | ||
*/ | ||
class Home implements Controller\ControllerIF | ||
{ | ||
use Controller\ControllerTrait; | ||
|
||
public function indexAction( $req, $res ) | ||
{ | ||
$res['message'] = 'ようこそ、のらフレームワーク'; | ||
return 'success'; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
doc/examples/application/src/class/Controller/HomeController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ | ||
|
||
/** | ||
* のらプロジェクト:クラスファイル | ||
* | ||
* @category Application | ||
* @package Application | ||
* @author ハジメ <[email protected]> | ||
* @copyright opyright (c) 2013, Nora Project All rights reserved. | ||
* @license http://www.hazime.org/license/bsd.txt 修正BSDライセンス | ||
* @version $Id$ | ||
*/ | ||
namespace NoraApplication\Controller; | ||
|
||
use Nora\Application; | ||
|
||
/** | ||
* コントローラー | ||
*/ | ||
class HomeController implements Application\ControllerIF | ||
{ | ||
use Application\ControllerTrait; | ||
|
||
public function actionIndex( $req, $res ) | ||
{ | ||
$view = $this->bootstrap('view'); | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
doc/examples/application/src/class/Controller/StaticPublishController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ | ||
|
||
/** | ||
* のらプロジェクト:クラスファイル | ||
* | ||
* @category Application | ||
* @package Application | ||
* @author ハジメ <[email protected]> | ||
* @copyright opyright (c) 2013, Nora Project All rights reserved. | ||
* @license http://www.hazime.org/license/bsd.txt 修正BSDライセンス | ||
* @version $Id$ | ||
*/ | ||
namespace NoraApplication\Controller; | ||
|
||
use Nora\Application; | ||
|
||
/** | ||
* コントローラー | ||
*/ | ||
class StaticPublishController implements Application\ControllerIF | ||
{ | ||
use Application\ControllerTrait; | ||
|
||
public function actionIndex( $req, $res ) | ||
{ | ||
if( !isset($req['request_uri']) ) return; | ||
$request_uri = trim($req['request_uri']); | ||
|
||
if( $request_uri == '' || $request_uri == '/' ) $request_uri = 'index.html'; | ||
|
||
// 単純なスタティックファイルを探す | ||
$file = APP_HOME.'/static/'.$request_uri; | ||
if(file_exists($file)) return $this->doStaticFile( $file, $request_uri ); | ||
|
||
$file = APP_HOME.'/static-recipe/'.$request_uri; | ||
if(file_exists($file)) return $this->doRecipeFile( $file, $request_uri ); | ||
|
||
} | ||
|
||
public function doRecipeFile( $file, $request_uri ) | ||
{ | ||
$config = new \Nora\Config\ConfigINI(); | ||
$config->load($file); | ||
|
||
switch( $config['type'] ) | ||
{ | ||
case 'file': | ||
if( !isset($config['file']) || !file_exists($config['file'] ) ) die('Recipe Failed: Cose File Not Found '. $config['file']); | ||
return $this->doStaticFile( $config['file'], $request_uri ); | ||
break; | ||
case 'dispatch': | ||
$res = $this->bootstrap('frontController')->dispatch( $config['params'] ); | ||
break; | ||
} | ||
} | ||
|
||
public function doStaticFile( $file, $request_uri ) | ||
{ | ||
// ドキュメントルートに書き出す | ||
$target = $this->getRequest()->getDocumentRoot().'/'.$request_uri; | ||
|
||
if( $this->bootstrap('config')->getConfig('static.useCache') ) | ||
{ | ||
nora_copy( $file, $target ); | ||
} | ||
|
||
echo file_get_contents($file); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
type = dispatch | ||
uri = /home/index | ||
params.controller = home | ||
params.action = index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
type = file | ||
file = APP_HOME/static/index.html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?=$view->doctype('html5');?> | ||
<!-- vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: --> | ||
<html> | ||
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#"> | ||
<?=$view->headMeta();?> | ||
<?=$view->headTitle();?> | ||
<?=$view->headStyle();?> | ||
<?=$view->headScript();?> | ||
</head> | ||
<?=$view->placeholder('body')->setPrefix('<body')->setPostfix('>'.PHP_EOL)->setFormat('%s="%s"')?> | ||
<?=$view->githubForkme('hajime-matsumoto/nora'); ?> | ||
<img src="<?=$view->socialGravatar('[email protected]');?>" /> | ||
テーマのCSS | ||
<?=$view->placeholder('table');?> | ||
|
||
<?=$view->bodyScript()?> | ||
<?=$view->googleAnalytics();?> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ | ||
|
||
/** | ||
* のらプロジェクト | ||
* | ||
* @author ハジメ <[email protected]> | ||
* @copyright opyright (c) 2013, Nora Project All rights reserved. | ||
* @license http://www.hazime.org/license/bsd.txt 修正BSDライセンス | ||
* @version $Id$ | ||
*/ | ||
namespace NoraApp\Blog\Api; | ||
|
||
use Nora\Controller; | ||
|
||
/** | ||
* コントローラー | ||
*/ | ||
class Blog extends Controller\ActionController | ||
{ | ||
public function indexAction( $response, $request ) | ||
{ | ||
$response['message'] = 'hello wild'; | ||
} | ||
|
||
public function createAction( $response, $request ) | ||
{ | ||
$response->capEnd(); | ||
|
||
$id = $request['id']; | ||
$title = $request['title']; | ||
$description = $request['description']; | ||
|
||
var_dump($this->helper('bootstrapper')->getServiceManager()); | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.