PHP Class Components_Generator_Plugin, components.underscores.me

Afficher le fichier Open project: Automattic/components.underscores.me Class Usage Examples

Méthodes publiques

Свойство Type Description
$build_dir
$bypass_cache
$components_dir
$logging
$prototype_dir
$repo_file_name
$repo_url
$selected_theme

Méthodes publiques

Méthode Description
__construct ( )
add_component_files ( $components, $target_dir, $replacements ) Adds component files needed for the build.
add_javascript ( $type, $files, $target_dir ) Removes component insertion comments from source.
add_replacement_files ( $type, $files, $target_dir ) Replaces files in the build from those specified by type.
add_sass_includes ( $type, $files, $target_dir ) Adds sass includes to the build and takes care of file overrides.
add_templates ( $files, $target_dir ) Adds templates to the build.
build_type ( $type ) Builds a given type from theme components.
copy_build_files ( $source_dir, $target_dir, $exclude = [] ) Copy files to temporary build directory.
copy_files ( $src_dir, $files, $target_dir ) Copies files to a given directory
create_zippity_zip ( ) Let's take the form input, generate and zip of the theme.
delete_directory ( $directory ) Delete a directory of files.
delete_file ( $URI ) This deletes a file.
do_tracking ( ) Track total downloads and type downloads.
download_file ( $URI, $file_name ) This downloads a file at a URL.
ensure_directory ( $directory, $delete_if_exists = false ) Checks if a directory exists, creates it otherwise.
gen_types_cache ( ) Creates an array and a JSON file from type configs to cache type data.
get_build_sources ( $dir ) Gets the build sources and associated file data.
get_stylesheet_paths ( $target_dir, $stylesheet, $basedir = null ) Gets list of stylesheets to include
get_theme_components ( $destination ) This gets our zip from the Github repo.
get_theme_components_init ( ) This is an init function to grab theme components so we can control when it's called by the generator.
get_types ( ) Returns an array with the available types.
handle_config ( $type, $config, $target_dir ) Handles the configuration and coordinates everything.
log_message ( $data ) Logs messages to debug.log in wp-content folder
read_base_dir ( $dir ) Read files to process from base. Stores files on array for processing.
read_dir ( $path, $fullpath = false ) Reads a directory excluding wildcards.
read_dir_recursive ( $path, $regex_filter = null ) Recursively reads a directory.
read_json ( $file ) Places data in JSON files in an array for later use.
render_types_form ( ) Renders the generator type form.
replace_theme_fields ( $contents, $filename ) Runs when looping through files contents, does the replacements fun stuff.
set_expiration_and_go ( ) Let's set an expiration on the last download and get current time.
unzip_file ( $zip_file ) This unzips our zip from the Github repo.

Method Details

__construct() public méthode

public __construct ( )

add_component_files() public méthode

Adds component files needed for the build.
public add_component_files ( $components, $target_dir, $replacements )

add_javascript() public méthode

Removes component insertion comments from source.
public add_javascript ( $type, $files, $target_dir )

add_replacement_files() public méthode

Replaces files in the build from those specified by type.
public add_replacement_files ( $type, $files, $target_dir )

add_sass_includes() public méthode

Adds sass includes to the build and takes care of file overrides.
public add_sass_includes ( $type, $files, $target_dir )

add_templates() public méthode

Adds templates to the build.
public add_templates ( $files, $target_dir )

build_type() public méthode

Builds a given type from theme components.
public build_type ( $type )

copy_build_files() public méthode

Copy files to temporary build directory.
public copy_build_files ( $source_dir, $target_dir, $exclude = [] )

copy_files() public méthode

Copies files to a given directory
public copy_files ( $src_dir, $files, $target_dir )

create_zippity_zip() public méthode

Let's take the form input, generate and zip of the theme.
public create_zippity_zip ( )

delete_directory() public méthode

Delete a directory of files.
public delete_directory ( $directory )

delete_file() public méthode

This deletes a file.
public delete_file ( $URI )

do_tracking() public méthode

Track total downloads and type downloads.
public do_tracking ( )

download_file() public méthode

This downloads a file at a URL.
public download_file ( $URI, $file_name )

ensure_directory() public méthode

Checks if a directory exists, creates it otherwise.
See also: http://php.net/mkdir
public ensure_directory ( $directory, $delete_if_exists = false )

gen_types_cache() public méthode

The generator form uses this to render type choices automatically.
public gen_types_cache ( )

get_build_sources() public méthode

Gets the build sources and associated file data.
public get_build_sources ( $dir )

get_stylesheet_paths() public méthode

Gets list of stylesheets to include
public get_stylesheet_paths ( $target_dir, $stylesheet, $basedir = null )

get_theme_components() public méthode

This gets our zip from the Github repo.
public get_theme_components ( $destination )

get_theme_components_init() public méthode

This is an init function to grab theme components so we can control when it's called by the generator.

get_types() public méthode

Returns an array with the available types.
public get_types ( )

handle_config() public méthode

Handles the configuration and coordinates everything.
public handle_config ( $type, $config, $target_dir )

log_message() public méthode

Logs messages to debug.log in wp-content folder
public log_message ( $data )

read_base_dir() public méthode

Read files to process from base. Stores files on array for processing.
public read_base_dir ( $dir )

read_dir() public méthode

Reads a directory excluding wildcards.
public read_dir ( $path, $fullpath = false )

read_dir_recursive() public méthode

Recursively reads a directory.
public read_dir_recursive ( $path, $regex_filter = null )

read_json() public méthode

Places data in JSON files in an array for later use.
public read_json ( $file )

render_types_form() public méthode

Renders the generator type form.
public render_types_form ( )

replace_theme_fields() public méthode

Runs when looping through files contents, does the replacements fun stuff.
public replace_theme_fields ( $contents, $filename )

set_expiration_and_go() public méthode

Let's set an expiration on the last download and get current time.

unzip_file() public méthode

This unzips our zip from the Github repo.
public unzip_file ( $zip_file )

Property Details

$build_dir public_oe property

public $build_dir

$bypass_cache public_oe property

public $bypass_cache

$components_dir public_oe property

public $components_dir

$logging public_oe property

public $logging

$prototype_dir public_oe property

public $prototype_dir

$repo_file_name public_oe property

public $repo_file_name

$repo_url public_oe property

public $repo_url

$selected_theme public_oe property

public $selected_theme