Skip to content

Commit

Permalink
Merge pull request #1 from Langur/initial
Browse files Browse the repository at this point in the history
Initial commit
  • Loading branch information
Langur authored Jan 5, 2023
2 parents bc5634d + 4a86e0f commit ac99f9a
Show file tree
Hide file tree
Showing 22 changed files with 1,169 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Langur
Copyright (c) 2017-2023 Akihisa ONODA

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Macaca - A simple contents management system for PHP

## Overview
Macaca is a content management system that provides a simple MVC framework.
You can deploy a public directory or under a specific directory.
Of course, you can also be extended using composer.

## Deploy
You have a choice of two methods.
### Deploy a public directory
The following files will be made available to the public.
All files should then be routed to *public/index.php* .
- public/index.php

### Deploy under a specific directory
The following files will be made available to the public.
All files should then be routed to *index.php* .
- index.php

## License
This software is distributed under the MIT License. Please read LICENSE for information on the software availability and distribution.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.1
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Macaca Change Log

## Version 0.0.1 (Thr, Jan 5 2023)
- Initial public release
57 changes: 57 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/**
* Macacaの設定ファイル
*
* @copyright Copyright (c) 2017-2023 Akihisa ONODA
* @license https://github.com/Langur/macaca/blob/master/LICENSE MIT
* @link https://github.com/Langur/macaca#readme
* @author Akihisa ONODA <[email protected]>
*/

/* -------------------------------------------------------------
* Macaca用定義
* ------------------------------------------------------------- */
define('LOADED_CONFIG', true);

/* -------------------------------------------------------------
* PATH設定
* ------------------------------------------------------------- */
define('ROOT_URI', '/');
define('__ABSPATH__', dirname(__FILE__) . '/');
define('LIBPATH', __ABSPATH__ . 'libs/');
define('MODPATH', __ABSPATH__ . 'modules/');
define('ERROR_VIEW_PATH', __ABSPATH__ . 'view/error');

/* -------------------------------------------------------------
* PHPの設定変更
* ------------------------------------------------------------- */
ini_set("include_path", get_include_path() . PATH_SEPARATOR . LIBPATH);

/* -------------------------------------------------------------
* 環境設定
* ------------------------------------------------------------- */
# SiteName
define('SITE_NAME', 'Macaca');
define('SITE_EMAIL', 'webmaster@localhost');
define('SITE_USE_OGP', false);
define('SITE_CACHE', '20230105');

# ERROR
ini_set('display_errors', false);
ini_set('error_reporting', E_ALL & ~E_STRICT & ~E_NOTICE & ~E_DEPRECATED);

# DEBUG
define('DEBUG_SITE', false);

/* -------------------------------------------------------------
* 各種ロード
* ------------------------------------------------------------- */
foreach (glob(LIBPATH . '*/*.php') as $path) {
include $path;
}
foreach (glob(MODPATH . '*/class.php') as $path) {
require_once $path;
}
foreach (glob(MODPATH . '*/main.php') as $path) {
include $path;
}
19 changes: 19 additions & 0 deletions controler/sample/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* メインページのコントローラ
*
* Macacaにおける処理のコアとなります。
* 引数の監理やMVCの紐付けを行います。
*
* @copyright Copyright (c) 2017-2023 Akihisa ONODA
* @license https://github.com/Langur/macaca/blob/master/LICENSE MIT
* @link https://github.com/Langur/macaca#readme
* @author Akihisa ONODA <[email protected]>
*/

$argv = $this->getARGV();
$view_engine = $this->getViewEngine();

# setString(文字列)で保持したデータはgetString()で読み出すことができる。
# StringはFoobarのように任意の文字列に置換可能。
$view_engine['templateengine']->setString("main");
19 changes: 19 additions & 0 deletions controler/sample/sub/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* サブページのコントローラ
*
* Macacaにおける処理のコアとなります。
* 引数の監理やMVCの紐付けを行います。
*
* @copyright Copyright (c) 2017-2023 Akihisa ONODA
* @license https://github.com/Langur/macaca/blob/master/LICENSE MIT
* @link https://github.com/Langur/macaca#readme
* @author Akihisa ONODA <[email protected]>
*/

$argv = $this->getARGV();
$view_engine = $this->getViewEngine();

# setString(文字列)で保持したデータはgetString()で読み出すことができる。
# StringはFoobarのように任意の文字列に置換可能。
$view_engine['templateengine']->setString("sub");
Binary file added images/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Macacaのmain処理
*
* @copyright Copyright (c) 2017-2023 Akihisa ONODA
* @license https://github.com/Langur/macaca/blob/master/LICENSE MIT
* @link https://github.com/Langur/macaca#readme
* @author Akihisa ONODA <[email protected]>
*/
session_start();
include_once('./config.php');
require_once('./public/index.php');
Empty file added libs/.gitkeep
Empty file.
Loading

0 comments on commit ac99f9a

Please sign in to comment.