Skip to content
This repository was archived by the owner on Dec 21, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions packager.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function validate($more_files = array(), $more_components = array(), $mor

// # public BUILD

public function build($files = array(), $components = array(), $packages = array(), $blocks = array()){
public function build($files = array(), $components = array(), $packages = array(), $blocks = array(), $excluded = array()){

if (!empty($components)){
$more = $this->components_to_files($components);
Expand All @@ -204,6 +204,13 @@ public function build($files = array(), $components = array(), $packages = array

$files = $this->complete_files($files);

if (!empty($excluded)){
$less = array();
foreach ($this->components_to_files($excluded) as $file) array_include($less, $file);
$exclude = $this->complete_files($less);
$files = array_diff($files, $exclude);
}

if (empty($files)) return '';

$included_sources = array();
Expand All @@ -226,17 +233,17 @@ public function build_from_files($files){
return $this->build($files);
}

public function build_from_components($components){
return $this->build(array(), $components);
public function build_from_components($components, $excluded = null){
return $this->build(array(), $components, array(), array(), $excluded);
}

public function write_from_files($file_name, $files = null){
$full = $this->build_from_files($files);
file_put_contents($file_name, $full);
}

public function write_from_components($file_name, $components = null){
$full = $this->build_from_components($components);
public function write_from_components($file_name, $components = null, $exclude = null){
$full = $this->build_from_components($components, $exclude);
file_put_contents($file_name, $full);
}

Expand Down