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
<?php | |
/** | |
* app/Controller/AppController.php | |
*/ | |
App::uses('BcAppController', 'Controller'); | |
App::uses('BcAgent', 'Lib'); | |
class AppController extends BcAppController { | |
/** |
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
<?php | |
class BaserCMS { | |
protected $settings; | |
protected $_server; | |
protected $_env; | |
/** | |
* ファクトリ用のstaticメソッドを定義 | |
* ConfigureやDB・環境変数等、外部への関与はここに集約 | |
*/ |
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
<?php | |
namespace Compose; | |
/** | |
* 関数を合成 | |
* pipe(f, g, h) なら h(g(f)) | |
* | |
* @return callable | |
*/ | |
function pipe() |
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
<?php | |
App::uses('BcAppView', 'View'); | |
class AppView extends BcAppView { | |
protected $baseTheme = 'hoge'; | |
protected function _paths($plugin = null, $cached = true) { | |
//プラグインの場合はそのまま | |
if ($plugin != null) |
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
<?php | |
/** | |
* {テーマのディレクトリ}/Config/bootstrap.phpとして配置する | |
* テーマ内で <?php echo $siteTitle ?> などと通常のビュー変数同様に利用可能 | |
*/ | |
/** | |
* 今回のビュー変数に限らず、テーマ用の設定はまとめておくとすっきりする | |
*/ | |
$config['MyTheme'] = array( |
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
trait RequiresServerRequestTrait | |
{ | |
/** | |
* @param RequestInterface $request | |
* @return ServerRequestInterface | |
* @throws ServerRequestRequiredException | |
*/ | |
private function ensureServerRequest(RequestInterface $request) | |
{ | |
if (($request instanceof ServerRequestInterface) === false) { |
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
<?php | |
class Concrete5ValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
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
<?php | |
interface RequestMatcherInterface | |
{ | |
match(RequestInterface $request) : RequestMatchResultInterface | |
} | |
interface RequestMatchResultInterface | |
{ | |
public function getRequest(): ServerRequestInterface; | |
public function getMatcher(): RequestMatcherInterface; |
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
<?php | |
interface RouterInterface { | |
public function match(): RoutingResultInterface; | |
} | |
interface RoutingResultInterface { | |
public function getHandler(): ?RouteInterface; | |
public function getParams(): array; | |
public function isSuccess(): bool; |
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
<?php | |
// コンテナ生成とキャッシュ | |
class ContainerBuilder implements ContainerBuilderInterface { | |
private $providers; | |
public function __construct(array $providers) { | |
$this->prividers = $providers; | |
} |
OlderNewer