Refactored project structure.

This commit is contained in:
Dmitry Khomutov 2018-03-04 18:04:15 +07:00
parent cfe93434ad
commit c015d8c58b
No known key found for this signature in database
GPG Key ID: EC19426474B37AAC
308 changed files with 39 additions and 47 deletions

View File

@ -6,7 +6,7 @@ coverage:
- "runtime"
- "tests"
- "vendor"
- "src/PHPCensor/Migrations"
- "src/PHPCensor/Languages"
- "src/Migrations"
- "src/Languages"
comment: off

View File

@ -5,7 +5,7 @@ if (!defined('ROOT_DIR')) {
}
if (!defined('SRC_DIR')) {
define('SRC_DIR', ROOT_DIR . 'src/PHPCensor/');
define('SRC_DIR', ROOT_DIR . 'src/');
}
if (!defined('PUBLIC_DIR')) {

View File

@ -36,14 +36,12 @@
},
"autoload": {
"psr-4": {
"PHPCensor\\": "src/PHPCensor/",
"b8\\": "src/B8Framework/"
"PHPCensor\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\PHPCensor\\": "tests/PHPCensor/",
"Tests\\b8\\": "tests/B8Framework/"
"Tests\\PHPCensor\\": "tests/src/"
}
},
"require": {

View File

@ -20,20 +20,16 @@
<const name="POSTGRESQL_DBNAME" value="b8_test" />
</php>
<testsuites>
<testsuite name="B8Framework Test Suite">
<directory suffix="Test.php">./tests/B8Framework</directory>
</testsuite>
<testsuite name="PHP Common Test Suite">
<directory suffix="Test.php">./tests/PHPCensor</directory>
<directory suffix="Test.php">./tests/src</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
<exclude>
<directory suffix=".php">./src/PHPCensor/Migrations</directory>
<directory suffix=".php">./src/PHPCensor/Languages</directory>
<directory suffix=".php">./src/Migrations</directory>
<directory suffix=".php">./src/Languages</directory>
</exclude>
</whitelist>
</filter>

View File

@ -86,7 +86,7 @@ LOGO;
if ($databaseSettings) {
$phinxSettings = [
'paths' => [
'migrations' => ROOT_DIR . 'src/PHPCensor/Migrations',
'migrations' => ROOT_DIR . 'src/Migrations',
],
'environments' => [
'default_migration_table' => 'migration',

View File

@ -167,18 +167,12 @@ abstract class Element
*/
public function render($viewFile = null)
{
$viewPath = SRC_DIR . 'View/';
if (is_null($viewFile)) {
$class = explode('\\', get_called_class());
$viewFile = end($class);
}
if (file_exists($viewPath . 'Form/' . $viewFile . '.phtml')) {
$view = new View('Form/' . $viewFile);
} else {
$view = new View($viewFile, SRC_DIR . 'Form/View/');
}
$view = new View('Form/' . $viewFile);
$view->name = $this->getName();
$view->id = $this->getId();

Some files were not shown because too many files have changed in this diff Show More