Skip to content

Commit c5dbcb3

Browse files
committed
Merge branch 'develop' of https://github.com/sagarnasit/site-type-php into sagarnasit-develop
2 parents 9defd60 + 4e42fce commit c5dbcb3

12 files changed

Lines changed: 1052 additions & 0 deletions

.distignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.DS_Store
2+
.git
3+
.gitignore
4+
.gitlab-ci.yml
5+
.editorconfig
6+
.travis.yml
7+
behat.yml
8+
circle.yml
9+
bin/
10+
features/
11+
utils/
12+
*.zip
13+
*.tar.gz
14+
*.swp
15+
*.txt
16+
*.log

.editorconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# https://make.wordpress.org/core/handbook/coding-standards/
6+
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = lf
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
indent_style = tab
15+
16+
[{.jshintrc,*.json,*.yml,*.feature}]
17+
indent_style = space
18+
indent_size = 2
19+
20+
[{*.txt,wp-config-sample.php}]
21+
end_of_line = crlf
22+
23+
[composer.json]
24+
indent_style = space
25+
indent_size = 4

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
ee.local.yml
3+
node_modules/
4+
vendor/
5+
*.zip
6+
*.tar.gz
7+
*.swp
8+
*.txt
9+
*.log
10+
composer.lock
11+
.idea
12+
*.db

phpcs.xml.dist

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="EE">
3+
<description>WordPress Coding Standards for EE</description>
4+
5+
<!-- Show sniff codes in all reports, and progress while running -->
6+
<arg value="sp"/>
7+
<!-- Check all PHP files in directory tree by default. -->
8+
<arg name="extensions" value="php"/>
9+
<!-- Run different reports -->
10+
<arg name="report" value="full"/>
11+
<arg name="report" value="summary"/>
12+
<arg name="report" value="source"/>
13+
14+
<file>.</file>
15+
<exclude-pattern>*/ci/*</exclude-pattern>
16+
<exclude-pattern>*/features/*</exclude-pattern>
17+
<exclude-pattern>*/packages/*</exclude-pattern>
18+
<exclude-pattern>*/tests/*</exclude-pattern>
19+
<exclude-pattern>*/utils/*</exclude-pattern>
20+
<exclude-pattern>*/vendor/*</exclude-pattern>
21+
22+
<rule ref="PHPCompatibility">
23+
<!-- Polyfill package is used so array_column() is available for PHP 5.4- -->
24+
<exclude name="PHPCompatibility.PHP.NewFunctions.array_columnFound"/>
25+
<!-- Both magic quotes directives set in wp-settings-cli.php to provide consistent starting point. -->
26+
<exclude name="PHPCompatibility.PHP.DeprecatedIniDirectives.magic_quotes_runtimeDeprecatedRemoved"/>
27+
<exclude name="PHPCompatibility.PHP.DeprecatedIniDirectives.magic_quotes_sybaseDeprecatedRemoved"/>
28+
</rule>
29+
<config name="testVersion" value="7.0-"/>
30+
31+
<rule ref="WordPress-Core">
32+
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" />
33+
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar" />
34+
<exclude name="WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase" />
35+
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase" />
36+
</rule>
37+
<rule ref="WordPress.Files.FileName">
38+
<properties>
39+
<property name="strict_class_file_names" value="false"/>
40+
</properties>
41+
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
42+
</rule>
43+
</ruleset>

site-type-php.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
if ( ! defined ( 'SITE_PHP_TEMPLATE_ROOT' ) ) {
4+
define( 'SITE_PHP_TEMPLATE_ROOT', __DIR__ . '/templates' );
5+
}
6+
7+
if ( ! class_exists( 'EE' ) ) {
8+
return;
9+
}
10+
11+
$autoload = dirname( __FILE__ ) . '/vendor/autoload.php';
12+
if ( file_exists( $autoload ) ) {
13+
require_once $autoload;
14+
}
15+
16+
Site_Command::add_site_type( 'php', 'EE\Site\Type\PHP' );

0 commit comments

Comments
 (0)