Skip to content

Commit

Permalink
Merge pull request #90 from svandragt/feature/composer
Browse files Browse the repository at this point in the history
Composerize
  • Loading branch information
svandragt authored Jul 1, 2020
2 parents 31d8aa4 + 6c0181f commit a130f9e
Show file tree
Hide file tree
Showing 51 changed files with 14 additions and 907 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "svandragt/cuttlefish",
"description": "Hackable web framework.",
"type": "project",
"type": "library",
"version": "0.4.2",
"license": "MIT",
"authors": [
{
Expand All @@ -19,8 +20,7 @@
},
"autoload": {
"psr-4": {
"": "src/application/",
"Cuttlefish\\": "src/system/"
"Cuttlefish\\": "src"
}
},
"config": {
Expand All @@ -45,4 +45,4 @@
"phpcs"
]
}
}
}
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/system/App.php → src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ class App
public $Security;
public $Cache;
public $Environment;
public $app_namespace;

public function __construct()
public function __construct($app_namespace = '')
{
$this->app_namespace = $app_namespace;
$this->Cache = new Cache();
if ($this->Cache->hasExistingCachefile()) {
$bytes = readfile($this->Cache->convertUrlpathToFilepath());
Expand All @@ -32,7 +34,7 @@ public function run()

// Process request if not statically cached.
$this->Cache->start();
new Request();
new Request($this->app_namespace);
$this->Cache->end();
}
}
File renamed without changes.
18 changes: 0 additions & 18 deletions src/Configuration.php.dist

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/system/Defaults.php → src/Defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Defaults
public const HOME_PAGE = '/home';
public const APPLICATION_FOLDER = 'application';
public const CACHE_FOLDER = '../_cache';
public const CONTENT_FOLDER = 'content';
public const CONTENT_FOLDER = '../content';
public const LOGS_FOLDER = '../_logs';
public const THEMES_FOLDER = 'themes';
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion src/system/Request.php → src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ class Request
{
protected $Controller;

public function __construct()
public function __construct($app_namespace)
{

// Route to controller
$args = explode("/", $this->pathInfo());
$controller_class = 'Controller' . ucfirst($args[1]);
if (!empty($app_namespace)) {
$controller_class = $app_namespace . '\\' . $controller_class;
}
$controller_arguments = array_slice($args, 2);
if (class_exists($controller_class, true)) {
$this->Controller = new $controller_class($this, $controller_arguments);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
109 changes: 0 additions & 109 deletions src/application/ControllerAdmin.php

This file was deleted.

35 changes: 0 additions & 35 deletions src/application/ControllerArchive.php

This file was deleted.

37 changes: 0 additions & 37 deletions src/application/ControllerErrors.php

This file was deleted.

33 changes: 0 additions & 33 deletions src/application/ControllerFeeds.php

This file was deleted.

38 changes: 0 additions & 38 deletions src/application/ControllerHome.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/application/ControllerImages.php

This file was deleted.

Loading

0 comments on commit a130f9e

Please sign in to comment.