PHP Класс Components_Generator_Plugin, components.underscores.me

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$build_dir
$bypass_cache
$components_dir
$logging
$prototype_dir
$repo_file_name
$repo_url
$selected_theme

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

public __construct ( )

add_component_files() публичный Метод

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

add_javascript() публичный Метод

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

add_replacement_files() публичный Метод

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

add_sass_includes() публичный Метод

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

add_templates() публичный Метод

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

build_type() публичный Метод

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

copy_build_files() публичный Метод

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

copy_files() публичный Метод

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

create_zippity_zip() публичный Метод

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

delete_directory() публичный Метод

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

delete_file() публичный Метод

This deletes a file.
public delete_file ( $URI )

do_tracking() публичный Метод

Track total downloads and type downloads.
public do_tracking ( )

download_file() публичный Метод

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

ensure_directory() публичный Метод

Checks if a directory exists, creates it otherwise.
См. также: http://php.net/mkdir
public ensure_directory ( $directory, $delete_if_exists = false )

gen_types_cache() публичный Метод

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

get_build_sources() публичный Метод

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

get_stylesheet_paths() публичный Метод

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

get_theme_components() публичный Метод

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

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.
public get_types ( )

handle_config() публичный Метод

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

log_message() публичный Метод

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

read_base_dir() публичный Метод

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

read_dir() публичный Метод

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

read_dir_recursive() публичный Метод

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

read_json() публичный Метод

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

render_types_form() публичный Метод

Renders the generator type form.
public render_types_form ( )

replace_theme_fields() публичный Метод

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

set_expiration_and_go() публичный Метод

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

unzip_file() публичный Метод

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

Описание свойств

$build_dir публичное свойство

public $build_dir

$bypass_cache публичное свойство

public $bypass_cache

$components_dir публичное свойство

public $components_dir

$logging публичное свойство

public $logging

$prototype_dir публичное свойство

public $prototype_dir

$repo_file_name публичное свойство

public $repo_file_name

$repo_url публичное свойство

public $repo_url

$selected_theme публичное свойство

public $selected_theme