Skip to content

Commit c1c7525

Browse files
"Added more pointless PHP files to clutter up the project."
1 parent 831b604 commit c1c7525

File tree

9 files changed

+232
-2
lines changed

9 files changed

+232
-2
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/*
3+
* Spindle CMS
4+
* Copyright (c) 2025. All rights reserved.
5+
*
6+
* This file is part of the Spindle CMS project — a lightweight, modular PHP content framework derived from OpenCart.
7+
*
8+
* @license GNU General Public License v3.0 (GPL-3.0-or-later)
9+
* @link https://github.com/RandomCoderTinker/Spindle
10+
*/
11+
12+
namespace Spindle\shared\controller\system;
13+
14+
use Spindle\System\Engine\Controller;
15+
16+
class Application extends Controller
17+
{
18+
19+
public function index (): void
20+
{
21+
// Load the helpers
22+
$this->load->helper('helpers');
23+
24+
// Load other modals, functions and things in here that are application specific
25+
26+
}
27+
28+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/*
3+
* Spindle CMS
4+
* Copyright (c) 2025. All rights reserved.
5+
*
6+
* This file is part of the Spindle CMS project — a lightweight, modular PHP content framework derived from OpenCart.
7+
*
8+
* @license GNU General Public License v3.0 (GPL-3.0-or-later)
9+
* @link https://github.com/RandomCoderTinker/Spindle
10+
*/
11+
12+
namespace Spindle\shared\controller\system;
13+
14+
use Spindle\System\Engine\Controller;
15+
16+
class Event extends Controller
17+
{
18+
/**
19+
* Index
20+
*
21+
* @return void
22+
*/
23+
public function index (): void
24+
{
25+
// No event system yet as no database
26+
27+
}
28+
29+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
/*
3+
* Spindle CMS
4+
* Copyright (c) 2025. All rights reserved.
5+
*
6+
* This file is part of the Spindle CMS project — a lightweight, modular PHP content framework derived from OpenCart.
7+
*
8+
* @license GNU General Public License v3.0 (GPL-3.0-or-later)
9+
* @link https://github.com/RandomCoderTinker/Spindle
10+
*/
11+
12+
namespace Spindle\Shared\controller\system;
13+
14+
use Spindle\System\Engine\Controller;
15+
16+
class Language extends Controller
17+
{
18+
/**
19+
* @var array<string, array<string, mixed>>
20+
*/
21+
private static array $languages = [];
22+
23+
/**
24+
* Index
25+
*
26+
* @return void
27+
*/
28+
public function index (): void
29+
{
30+
// Hardcoded langauge at the moment
31+
32+
$this->config->set('config_language', "en-gb");
33+
$this->load->language('default');
34+
35+
}
36+
37+
/**
38+
* After
39+
*
40+
* Override the language default values
41+
*
42+
* @param string $route
43+
* @param string $prefix
44+
* @param string $code
45+
* @param array<mixed> $output
46+
*
47+
* @return void
48+
*/
49+
public function after (&$route, &$prefix, &$code, &$output): void
50+
{
51+
if (!$code) {
52+
$code = $this->config->get('config_language');
53+
}
54+
55+
// Use $this->language->load so it's not triggering infinite loops
56+
$this->language->load($route, $prefix, $code);
57+
58+
if (isset(self::$languages[$code])) {
59+
$language_info = self::$languages[$code];
60+
61+
$path = '';
62+
63+
// Use $this->language->load so it's not triggering infinite loops
64+
$this->language->load($path . $route, $prefix, $code);
65+
}
66+
}
67+
68+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/*
3+
* Spindle CMS
4+
* Copyright (c) 2025. All rights reserved.
5+
*
6+
* This file is part of the Spindle CMS project — a lightweight, modular PHP content framework derived from OpenCart.
7+
*
8+
* @license GNU General Public License v3.0 (GPL-3.0-or-later)
9+
* @link https://github.com/RandomCoderTinker/Spindle
10+
*/
11+
12+
namespace Spindle\shared\controller\system;
13+
14+
use Spindle\System\Engine\Controller;
15+
16+
class Maintenance extends Controller
17+
{
18+
19+
public function index (): void
20+
{
21+
// Everything hardcoded at the moment
22+
23+
}
24+
25+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/*
3+
* Spindle CMS
4+
* Copyright (c) 2025. All rights reserved.
5+
*
6+
* This file is part of the Spindle CMS project — a lightweight, modular PHP content framework derived from OpenCart.
7+
*
8+
* @license GNU General Public License v3.0 (GPL-3.0-or-later)
9+
* @link https://github.com/RandomCoderTinker/Spindle
10+
*/
11+
12+
namespace Spindle\Shared\Controller\System;
13+
14+
use Spindle\System\Engine\Controller;
15+
16+
class SeoUrl extends Controller
17+
{
18+
19+
public function index (): void
20+
{
21+
// Add all SEO settings in here
22+
}
23+
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/*
3+
* Spindle CMS
4+
* Copyright (c) 2025. All rights reserved.
5+
*
6+
* This file is part of the Spindle CMS project — a lightweight, modular PHP content framework derived from OpenCart.
7+
*
8+
* @license GNU General Public License v3.0 (GPL-3.0-or-later)
9+
* @link https://github.com/RandomCoderTinker/Spindle
10+
*/
11+
12+
namespace Spindle\Shared\Controller\System;
13+
14+
use Spindle\System\Engine\Controller;
15+
16+
class Settings extends Controller
17+
{
18+
19+
public function index ()
20+
{
21+
// Load the settings from the database
22+
23+
}
24+
25+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/*
3+
* Spindle CMS
4+
* Copyright (c) 2025. All rights reserved.
5+
*
6+
* This file is part of the Spindle CMS project — a lightweight, modular PHP content framework derived from OpenCart.
7+
*
8+
* @license GNU General Public License v3.0 (GPL-3.0-or-later)
9+
* @link https://github.com/RandomCoderTinker/Spindle
10+
*/
11+
12+
// Load all helpers in the directory - makes it easier to read and add more..
13+
foreach (glob(__DIR__ . '/*.php') as $file) {
14+
if (basename($file) !== 'helpers.php') {
15+
require_once $file;
16+
}
17+
}

storage/config/app.config.sample.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@
1717
$_['response_header'] = ['Content-Type: text/html; charset=utf-8'];
1818
$_['response_compression'] = 0;
1919

20-
$_['action_pre_action'] = [];
20+
$_['action_pre_action'] = [
21+
'system/settings',
22+
'system/seo_url',
23+
'system/language',
24+
'system/application',
25+
'system/event',
26+
'system/maintenance',
27+
];
2128

2229
$_['action_event'] = [
2330
'controller/*/before' => [

storage/config/subdomain.config.sample.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@
3535
$_['response_header'] = ['Content-Type: text/html; charset=utf-8'];
3636
$_['response_compression'] = 0;
3737

38-
$_['action_pre_action'] = [];
38+
$_['action_pre_action'] = [
39+
'system/settings',
40+
'system/seo_url',
41+
'system/language',
42+
'system/application',
43+
'system/event',
44+
'system/maintenance',
45+
];
3946

4047
$_['action_event'] = [
4148
'controller/*/before' => [

0 commit comments

Comments
 (0)