View disallow_ssh_exec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$output = []; | |
exec('[ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "remote" || echo "local"', $output); | |
if ($output[0] != 'local') { | |
echo "Run this script only on your computer!\n\n"; | |
// @codingStandardsIgnoreStart | |
exit(1); | |
// @codingS |
View VdmgReturnIntValueCheckSniff.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use PHP_CodeSniffer\Files\File; | |
use PHP_CodeSniffer\Sniffs\Sniff; | |
final class VdmgReturnIntValueCheckSniff implements Sniff { | |
/** | |
* String representation of error. | |
* |
View VdmgNoDuplicateNegativIfConditionRule.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace vdmg\App\scripts\githooks\StandardVdmg\PHPStan; | |
use PhpParser\Node; | |
use PHPStan\Analyser\Scope; | |
use PHPStan\Rules\Rule; |
View mod-ide-helper.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
namespace my_helper { | |
// init | |
$str = ''; | |
require_once __DIR__ . '/boostrap.php'; | |
require_once __DIR__ . '/etc/config.php'; |
View Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WARNINGS && INFO: | |
# - a "\t" (tab) is needed before the commands, do not use spaces ..." | |
# - a "$" has special meaning in Makefiles, you need to double it to pass it) | |
# - please install/use the "Makefile support"-plugin for PhpStrom :) | |
TEST_ENV ?= local | |
CHECK_FILES ?= . | |
PHPSTAN_LEVEL ?= 3 |
View code_check_git_hook.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/** | |
* // | |
* // add something like this in your "composer post-update-cmd && post-install-cmd" | |
* // | |
* echo "\n\n"; | |
* echo "Run force \"code_check_git_hook.php\" as pre-commit-hook ..."; | |
* $force_pre_commit_hook_cmd = 'ln -sf YOUR_PATH_TO_CODE_CHECK_SCRIPTS/code_check_git_hook.php YOUR_PATH_TO_PROJECT_ROOT/.git/hooks/pre-commit'; |
View check_code_phpstan.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
use Composer\XdebugHandler\XdebugHandler; | |
require_once __DIR__ . '/YOUR_PATH_THE_AUTOLOADER.php'; | |
$xdebug = new XdebugHandler('phpstan-code-check'); | |
$xdebug->check(); | |
unset($xdebug); |
View remove_first_html_tag.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$input_lines = ' <div>da<a> | |
lalll | |
</a>sda | |
</div>'; | |
$output = preg_replace('/^<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\1)>$/usi', '$3', trim($input_lines)); | |
View .editorconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For more information about the properties used in | |
# this file, please see the EditorConfig documentation: | |
# http://editorconfig.org/ | |
# top-most EditorConfig file | |
root = true | |
# Unix-style newlines + UTF-8 encoding | |
[*] | |
charset=utf-8 |
View .htaccess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [simple.cms] + Apache Server Configs v3.1.0 | MIT License | |
# https://github.com/h5bp/server-configs-apache | |
# (!) Using `.htaccess` files slows down Apache, therefore, if you have | |
# access to the main server configuration file (which is usually called | |
# `httpd.conf`), you should add this logic there. | |
# | |
# https://httpd.apache.org/docs/current/howto/htaccess.html | |
# ---------------------------------------------------------------------- |
NewerOlder