Skip to content

Commit

Permalink
Merge pull request #16 from SolidBunch/php-composer-support
Browse files Browse the repository at this point in the history
added php composer support
  • Loading branch information
zyv4yk committed Feb 14, 2019
2 parents 953056e + 3d7ffb7 commit fe132ce
Show file tree
Hide file tree
Showing 7,947 changed files with 5,408 additions and 4,290 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ indent_size = 2
trim_trailing_whitespace = false

[{*.txt,wp-config-sample.php}]
end_of_line = crlf
end_of_line = crlf

[composer.json]
indent_style = space
indent_size = 4
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ node_modules
# Specific Plugins #
#===========================#
build/broswer-sync.config.js


#Additionals
/vendor/
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
- build - webpack configs
- framework-customizations/ – Unyson customization (see https://github.com/ThemeFuse/Scratch-Theme)
- template-parts/ – default WordPress templates (included in files below)
- vendor/ – third-party development
- vendor-custom/ – third-party development
- 404.php
- comments.php
- footer.php
Expand Down
2 changes: 1 addition & 1 deletion app/Controller/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct() {
add_action( 'admin_enqueue_scripts', array( $this, 'load_assets' ) );

// install required plugins
require_once get_template_directory() . '/vendor/tgm/class-tgm-plugin-activation.php';
require_once get_template_directory() . '/vendor-custom/tgm/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', array( $this, 'tgmpa_register' ) );

// Change theme options default menu position
Expand Down
21 changes: 15 additions & 6 deletions app/Controller/OAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public function check_request() {
**/
public function auth_facebook() {

require_once get_template_directory() . '/vendor/oauth/facebook/autoload.php';
if(defined('VENDOR_DIR')) {
require_once get_template_directory() . '/vendor-custom/oauth/facebook/autoload.php';
}

$fb = new \Facebook\Facebook( [
'app_id' => \StarterKit\Helper\Utils::get_option( 'facebook_app_id' ),
Expand All @@ -92,8 +94,9 @@ public function auth_facebook() {
* Oauth callback for Facebook
**/
public function callback_facebook() {

require_once get_template_directory() . '/vendor/oauth/facebook/autoload.php';
if(defined('VENDOR_DIR')) {
require_once get_template_directory() . '/vendor-custom/oauth/facebook/autoload.php';
}

try {
$fb = new \Facebook\Facebook( [
Expand Down Expand Up @@ -223,7 +226,9 @@ public function auth_google() {
**/
private function _get_google_client() {

require_once get_template_directory() . '/vendor/oauth/google/vendor/autoload.php';
if(defined('VENDOR_DIR')) {
require_once get_template_directory() . '/vendor-custom/oauth/google/vendor/autoload.php';
}

$client = new \Google_Client();
$client->setAuthConfig( [
Expand Down Expand Up @@ -273,7 +278,9 @@ public function callback_google() {
**/
public function auth_twitter() {

require_once get_template_directory() . '/vendor/oauth/twitter/autoload.php';
if(defined('VENDOR_DIR')) {
require_once get_template_directory() . '/vendor-custom/oauth/twitter/autoload.php';
}

$connection = new \Abraham\TwitterOAuth\TwitterOAuth(
\StarterKit\Helper\Utils::get_option( 'twitter_consumer_key' ),
Expand Down Expand Up @@ -308,7 +315,9 @@ public function callback_twitter() {
exit;
}

require_once get_template_directory() . '/vendor/oauth/twitter/autoload.php';
if(defined('VENDOR_DIR')) {
require_once get_template_directory() . '/vendor-custom/oauth/twitter/autoload.php';
}

$oauth_token = $_GET['oauth-token'];
$consumer_key = \StarterKit\Helper\Utils::get_option( 'twitter_consumer_key' );
Expand Down
4 changes: 2 additions & 2 deletions app/Helper/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function the_img( $image_atts = array(), $func_atts = array() ) {
$func_atts = wp_parse_args( $func_atts, $func_dafault_atts );

if ( ! class_exists( 'Aq_Resize' )) {
require_once get_template_directory() . '/vendor/aq_resizer/aq_resizer.php';
require_once get_template_directory() . '/vendor-custom/aq_resizer/aq_resizer.php';
}

if ( ( empty($image_atts['src']) && empty($func_atts['attachment_id']) ) or ( !empty($image_atts['src']) && $image_atts['src'] === get_the_post_thumbnail_url( get_the_ID(), 'full' ) ) ) {
Expand Down Expand Up @@ -142,7 +142,7 @@ public static function the_img( $image_atts = array(), $func_atts = array() ) {
*/
public static function img_resize( $url, $width, $height, $crop = true ) {
if ( ! class_exists( 'Aq_Resize' ) ) {
require_once \get_template_directory() . '/vendor/aq_resizer/aq_resizer.php';
require_once \get_template_directory() . '/vendor-custom/aq_resizer/aq_resizer.php';
}

if ( strpos( $url, 'http' ) !== 0 ) {
Expand Down
32 changes: 32 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "solidbunch/starter-kit",
"description": "Wordpress theme boilerplate",
"type": "project",
"license": "GPL-2.0",
"authors": [
{
"name": "SoliBunch Team",
"email": "[email protected]"
},
{
"name": "Nikita Bolotov",
"email": "[email protected]"
}
],
"require": {
"google/apiclient": "^2.0",
"abraham/twitteroauth": "^1.0",
"facebook/graph-sdk": "^5.7"
},
"require-dev": {
"roave/security-advisories": "dev-master"
},
"autoload": {
"psr-4": {
"StarterKit\\": "app/"
}
},
"config": {
"optimize-autoloader": true
}
}
Loading

0 comments on commit fe132ce

Please sign in to comment.