Skip to content

Commit

Permalink
Adjust line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Dec 14, 2015
1 parent 4c209b6 commit eee0752
Showing 1 changed file with 98 additions and 98 deletions.
196 changes: 98 additions & 98 deletions minit.php
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
<?php
/*
Plugin Name: Minit
Plugin URI: https://github.com/kasparsd/minit
GitHub URI: https://github.com/kasparsd/minit
Description: Combine JS and CSS files and serve them from the uploads folder.
Version: 1.3-beta
Author: Kaspars Dambis
Author URI: http://kaspars.net
*/

add_action( 'plugins_loaded', array( 'Minit_Plugin', 'instance' ) );

class Minit_Plugin {

public $version = 'minit-1.3';
public $plugin_file;


public static function instance() {

static $instance;

if ( ! $instance )
$instance = new self();

return $instance;

}


protected function __construct() {

$this->plugin_file = __FILE__;

add_action( 'wp', array( $this, 'init' ) );
add_action( 'init', array( $this, 'admin_init' ) );

// This action can used to delete all Minit cache files from cron
add_action( 'minit-cache-purge-delete', array( $this, 'cache_delete' ) );

}


public function init() {

if ( is_admin() )
return;

include dirname( __FILE__ ) . '/include/minit-assets.php';
include dirname( __FILE__ ) . '/include/minit-js.php';
include dirname( __FILE__ ) . '/include/minit-css.php';
include dirname( __FILE__ ) . '/include/helpers.php';

$js = new Minit_Js( $this );
$css = new Minit_Css( $this );

$js->init();
$css->init();

}

public function admin_init() {

include dirname( __FILE__ ) . '/include/admin.php';

$admin = new Minit_Admin( $this );
$admin->init();

}


public static function cache_bump() {

// Use this as a global cache version number
update_option( 'minit_cache_ver', time() );

// Allow other plugins to know that we purged
do_action( 'minit-cache-purged' );

}


public static function cache_delete() {

$wp_upload_dir = wp_upload_dir();
$minit_files = glob( $wp_upload_dir['basedir'] . '/minit/*' );

if ( $minit_files ) {
foreach ( $minit_files as $minit_file ) {
unlink( $minit_file );
}
}

}


}
<?php
/*
Plugin Name: Minit
Plugin URI: https://github.com/kasparsd/minit
GitHub URI: https://github.com/kasparsd/minit

This comment has been minimized.

Copy link
@szepeviktor

szepeviktor Jan 8, 2016

Contributor

@kasparsd Please consider GitHub Plugin URI to make updates possible:
https://github.com/afragen/github-updater
and you may enjoy the benefits of https://github.com/szepeviktor/github-link

This comment has been minimized.

Copy link
@kasparsd

kasparsd Jan 8, 2016

Author Owner

Added #59

This comment has been minimized.

Copy link
@kasparsd

kasparsd Jan 8, 2016

Author Owner

@szepeviktor See this comment from 2013 :) afragen/git-updater#24

This comment has been minimized.

Copy link
@szepeviktor
Description: Combine JS and CSS files and serve them from the uploads folder.
Version: 1.3-beta.2

This comment has been minimized.

Copy link
@szepeviktor

szepeviktor Jan 8, 2016

Contributor

Maybe this is my personal preference but Version is the 2nd most important to name, so it is more visible in the second row.

Author: Kaspars Dambis
Author URI: http://kaspars.net
*/

add_action( 'plugins_loaded', array( 'Minit_Plugin', 'instance' ) );

class Minit_Plugin {

public $revision = '20151214';
public $plugin_file;


public static function instance() {

static $instance;

if ( ! $instance )
$instance = new self();

return $instance;

}


protected function __construct() {

$this->plugin_file = __FILE__;

add_action( 'wp', array( $this, 'init' ) );
add_action( 'init', array( $this, 'admin_init' ) );

// This action can used to delete all Minit cache files from cron
add_action( 'minit-cache-purge-delete', array( $this, 'cache_delete' ) );

}


public function init() {

if ( is_admin() )
return;

include dirname( __FILE__ ) . '/include/minit-assets.php';
include dirname( __FILE__ ) . '/include/minit-js.php';
include dirname( __FILE__ ) . '/include/minit-css.php';
include dirname( __FILE__ ) . '/include/helpers.php';

$js = new Minit_Js( $this );
$css = new Minit_Css( $this );

$js->init();
$css->init();

}

public function admin_init() {

include dirname( __FILE__ ) . '/include/admin.php';

$admin = new Minit_Admin( $this );
$admin->init();

}


public static function cache_bump() {

// Use this as a global cache version number
update_option( 'minit_cache_ver', time() );

// Allow other plugins to know that we purged
do_action( 'minit-cache-purged' );

}


public static function cache_delete() {

$wp_upload_dir = wp_upload_dir();
$minit_files = glob( $wp_upload_dir['basedir'] . '/minit/*' );

if ( $minit_files ) {
foreach ( $minit_files as $minit_file ) {
unlink( $minit_file );
}
}

}


}

0 comments on commit eee0752

Please sign in to comment.