Skip to content

Commit

Permalink
Track
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Sep 7, 2019
1 parent 032214f commit 1b29b0b
Show file tree
Hide file tree
Showing 192 changed files with 14,832 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
13 changes: 13 additions & 0 deletions .gitignore
@@ -0,0 +1,13 @@
_trash/
_reports/
vendor/
docs/
app/var/
app/cache/
Chevereto-Chevere/logs/
var/
composer.lock
.vscode/
.phpunit.result.cache
app/build
/devnotes/
23 changes: 23 additions & 0 deletions .htaccess
@@ -0,0 +1,23 @@
# Disable server signature
ServerSignature Off

# Disable directory listing (-indexes), Multiviews (-MultiViews) and enable Follow system links (+FollowSymLinks)
Options -Indexes
Options -MultiViews
Options +FollowSymLinks

<IfModule mod_rewrite.c>

RewriteEngine On

# If you have problems with the rewrite rules remove the "#" from the following RewriteBase line
# You will also have to change the path to reflect the path to your Chevereto installation
# If you are using alias is most likely that you will need this.
RewriteBase /Core

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpe?g|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC]
RewriteRule . index.php [L]

</IfModule>
108 changes: 108 additions & 0 deletions .php-cs
@@ -0,0 +1,108 @@
<?php

$header = <<<'EOF'
This file is part of Chevere.

(c) Rodolfo Berrios <rodolfo@chevereto.com>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;

return PhpCsFixer\Config::create()
->setRules(array(
'@PSR2' => true,
'@Symfony' => true,
'yoda_style' => true,
'array_indentation' => true,
'array_syntax' => array('syntax' => 'short'),
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
'single_quote' => true,

'binary_operator_spaces' => array(
'align_double_arrow' => false,
'align_equals' => false,
),
// 'blank_line_after_opening_tag' => true,
// 'blank_line_before_return' => true,
'braces' => array(
'allow_single_line_closure' => true,
),
// 'cast_spaces' => true,
// 'class_definition' => array('singleLine' => true),
'concat_space' => array('spacing' => 'one'),
'declare_equal_normalize' => true,
'function_typehint_space' => true,
'hash_to_slash_comment' => true,
'include' => true,
'lowercase_cast' => true,
// 'native_function_casing' => true,
// 'new_with_braces' => true,
// 'no_blank_lines_after_class_opening' => true,
// 'no_blank_lines_after_phpdoc' => true,
// 'no_empty_comment' => true,
// 'no_empty_phpdoc' => true,
// 'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => array(
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'square_brace_block',
'throw',
'use',
),
// 'no_leading_import_slash' => true,
// 'no_leading_namespace_whitespace' => true,
// 'no_mixed_echo_print' => array('use' => 'echo'),
'no_multiline_whitespace_around_double_arrow' => true,
// 'no_short_bool_cast' => true,
// 'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
// 'no_trailing_comma_in_list_call' => true,
// 'no_trailing_comma_in_singleline_array' => true,
// 'no_unneeded_control_parentheses' => true,
// 'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
// 'normalize_index_brace' => true,
'object_operator_without_whitespace' => true,
// 'php_unit_fqcn_annotation' => true,
// 'phpdoc_align' => true,
// 'phpdoc_annotation_without_dot' => true,
// 'phpdoc_indent' => true,
// 'phpdoc_inline_tag' => true,
// 'phpdoc_no_access' => true,
// 'phpdoc_no_alias_tag' => true,
// 'phpdoc_no_empty_return' => true,
// 'phpdoc_no_package' => true,
// 'phpdoc_no_useless_inheritdoc' => true,
// 'phpdoc_return_self_reference' => true,
// 'phpdoc_scalar' => true,
// 'phpdoc_separation' => true,
// 'phpdoc_single_line_var_spacing' => true,
// 'phpdoc_summary' => true,
// 'phpdoc_to_comment' => true,
// 'phpdoc_trim' => true,
// 'phpdoc_types' => true,
// 'phpdoc_var_without_name' => true,
// 'pre_increment' => true,
// 'return_type_declaration' => true,
// 'self_accessor' => true,
// 'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
// 'single_class_element_per_statement' => true,
// 'space_after_semicolon' => true,
// 'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
// 'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
'header_comment' => ['header' => $header],
'declare_strict_types' => true,
))
//->setIndent("\t")
->setLineEnding("\n")
;
9 changes: 9 additions & 0 deletions Chevereto-Chevere/LICENSE
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) Rodolfo Berrios

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
74 changes: 74 additions & 0 deletions Chevereto-Chevere/bootstrap.php
@@ -0,0 +1,74 @@
<?php

declare(strict_types=1);

/*
* This file is part of Chevere.
*
* (c) Rodolfo Berrios <rodolfo@chevereto.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Chevere;

use Chevere\App\App;
use Chevere\App\Loader;
use Chevere\Console\Console;
use Chevere\Runtime\Runtime;
use Chevere\Runtime\Sets\RuntimeSetDebug;
use Chevere\Runtime\Sets\RuntimeSetDefaultCharset;
use Chevere\Runtime\Sets\RuntimeSetPrecision;
use Chevere\Runtime\Sets\RuntimeSetTimeZone;
use Chevere\Runtime\Sets\RuntimeSetUriScheme;
use Chevere\Runtime\Sets\RuntimeSetLocale;
use Chevere\Runtime\Sets\RuntimeSetErrorHandler;
use Chevere\Runtime\Sets\RuntimeSetExceptionHandler;

/** DEV_MODE true rebuild the App on every load */
define('Chevere\DEV_MODE', false);

/*
* Assuming that this file has been loaded from /app/bootstrap.php
*/

define('Chevere\BOOTSTRAPPER', debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1)[0]['file']);

/* Root path containing /app */
define('Chevere\ROOT_PATH', rtrim(str_replace('\\', '/', dirname(BOOTSTRAPPER, 2)), '/') . '/');

/*
* Chevere\PATH
* Relative path to Core, usually 'vendor/chevereto/chevereto-core'
*/
define('Chevere\PATH', rtrim(str_replace(ROOT_PATH, null, str_replace('\\', '/', __DIR__)), '/') . '/');

/* Relative path to app, usually 'app' */
define('Chevere\APP_PATH_RELATIVE', basename(dirname(BOOTSTRAPPER)) . '/');
define('Chevere\APP_PATH', ROOT_PATH . APP_PATH_RELATIVE);

if ('cli' == php_sapi_name()) {
Console::init(); //10ms
}

define('Chevere\CLI', Console::isAvailable());

// $sw = new Stopwatch();
Loader::setDefaultRuntime(
new Runtime(
new RuntimeSetDebug('1'), // 0.2ms
new RuntimeSetErrorHandler('Chevere\ExceptionHandler\ErrorHandler::error'), // 0.9ms
new RuntimeSetExceptionHandler('Chevere\ExceptionHandler\ExceptionHandler::exception'), // 0.5ms
new RuntimeSetLocale('en_US.UTF8'), // 0.2ms
new RuntimeSetDefaultCharset('utf-8'), // 0.2ms
new RuntimeSetPrecision('16'), // 0.2ms
new RuntimeSetUriScheme('https'), // 0.2ms
new RuntimeSetTimeZone('UTC') // 1.85
)
); // 0.6ms wrapper

// $sw->stop();
// dd($sw->records(), 'BOOTSTRAP');

// ->addFile(App::FILEHANDLE_CONFIG)
30 changes: 30 additions & 0 deletions Chevereto-Chevere/composer.json
@@ -0,0 +1,30 @@
{
"name": "chevereto/chevere",
"description": "Chevereto Framework",
"homepage": "http://github.com/chevereto/chevere",
"type": "library",
"license": "MIT",
"authors": [{
"name": "Rodolfo Berrios",
"email": "inbox@rodolfoberrios.com",
"homepage": "http://rodolfoberrios.com"
}],
"require": {
"php": ">=7.2",
"psr/simple-cache": "~1.0",
"monolog/monolog": "~1.24",
"symfony/http-foundation": "~4.2",
"symfony/console": "~4.2",
"jakub-onderka/php-console-color": "~0.2",
"roave/better-reflection": "~3.2"
},
"require-dev": {
"phpunit/phpunit": "^8"
},
"autoload": {
"files": ["utils/phpcheck.php", "resources/functions/dump.php"],
"psr-4": {
"Chevere\\": "src/"
}
}
}
11 changes: 11 additions & 0 deletions Chevereto-Chevere/phpunit.php
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Chevere;

require dirname(__DIR__, 1).'/vendor/autoload.php';
define('Chevere\ROOT_PATH', dirname(__DIR__, 1).'/');
define('Chevere\PATH', __DIR__.'/');
define('Chevere\App\PATH', 'app/');
define('Chevere\CLI', true);
8 changes: 8 additions & 0 deletions Chevereto-Chevere/phpunit.xml
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./phpunit.php">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>
29 changes: 29 additions & 0 deletions Chevereto-Chevere/resources/functions/dump.php
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

/*
* This file is part of Chevere.
*
* (c) Rodolfo Berrios <rodolfo@chevereto.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Chevere\VarDump\Dumper;

/**
* Dumps information about one or more variables.
*/
function dump(...$vars)
{
Dumper::dump(...$vars);
}
/**
* Dumps information about one or more variables and die().
*/
function dd(...$vars)
{
Dumper::dd(...$vars);
}

0 comments on commit 1b29b0b

Please sign in to comment.