Skip to content

Commit

Permalink
Fix mistakes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Skirenko committed Mar 4, 2017
1 parent 701ea90 commit 98a8754
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion content/content.precompile_assets_ajax.php
Expand Up @@ -62,7 +62,7 @@ public function build(array $context = array())
$precompile = explode(',', $settings['precompile_files']);
foreach ($precompile as $input_file) {
$input_file = trim(trim($input_file), '/');
$output_file = file_get_contents('ap.filename-for://' . $input_file);
$output_file = file_get_contents('ap.filename://' . $input_file);
if (General::getExtension($input_file) == 'php') {
$input_file = substr($input_file, 0, -4);
}
Expand Down
1 change: 1 addition & 0 deletions lib/defines.php
Expand Up @@ -30,5 +30,6 @@ function define_here($name, $value)
$output_dir = trim($settings['output_directory'], '/');
$use_docroot = ($settings['output_parent_directory'] == 'docroot');
define_here('OUTPUT_DIR', ($use_docroot ? \DOCROOT : \WORKSPACE) . '/' . $output_dir);
//define_here('OUTPUT_URL', \URL . ($use_docroot ? '/' : '/workspace/') . $output_dir);
define_here('OUTPUT_URL', ($use_docroot ? '/' : '/workspace/') . $output_dir);
}
6 changes: 3 additions & 3 deletions lib/functions.php
Expand Up @@ -110,7 +110,7 @@ function url($file)
if (is_file(OUTPUT_DIR . '/' . $file_out)) {
return OUTPUT_URL . '/' . $file_out;
} else {
return file_get_contents('ap.url-for://' . $file);
return file_get_contents('ap.url://' . $file);
}
}

Expand All @@ -123,7 +123,7 @@ function css_url($file)
return OUTPUT_URL . '/' . $file_out;
} else {
#return file_get_contents('am.data://css-url/' . $file);
return file_get_contents('ap.url-for://' . $file . '?output_type=css');
return file_get_contents('ap.url://' . $file . '?output_type=css');
}
}

Expand All @@ -134,7 +134,7 @@ function js_url($file)
if (is_file(OUTPUT_DIR . '/' . $file_out)) {
return OUTPUT_URL . '/' . $file_out;
} else {
return file_get_contents('ap.url-for://' . $file . '?output_type=js');
return file_get_contents('ap.url://' . $file . '?output_type=js');
}
}

Expand Down
6 changes: 3 additions & 3 deletions lib/stream/class.APStream.php
Expand Up @@ -96,7 +96,7 @@ function setOutput()
}
}

if ($this->action == 'url-for') {
if ($this->action == 'url') {
// Save file and output file URL.
$output_file = filename_insert_md5($modified_file_path, md5($content));
if (APP_MODE == 'administration') {
Expand All @@ -106,7 +106,7 @@ function setOutput()
file_put_contents(ASSET_CACHE . '/' . $output_file, $content);
$this->output = '/' . $output_file . '/?mode=pipeline';
}
} elseif ($this->action == 'filename-for') {
} elseif ($this->action == 'filename') {
$output_file = filename_insert_md5($modified_file_path, md5($content));
file_put_contents(OUTPUT_DIR . '/' . $output_file, $content);
$this->output = $output_file;
Expand All @@ -115,7 +115,7 @@ function setOutput()
}
} else {
// Non-text file.
if ($this->action == 'url-for') {
if ($this->action == 'url') {
$output_file = filename_insert_md5($modified_file_path, md5_file($source_file_abs));
if (APP_MODE == 'administration') {
copy($source_file_abs, OUTPUT_DIR . '/' . $output_file);
Expand Down
4 changes: 2 additions & 2 deletions lib/stream/stream-setup.php
Expand Up @@ -4,5 +4,5 @@
require 'class.APStream.php';

stream_wrapper_register('ap', 'AssetPipeline\APStream');
stream_wrapper_register('ap.url-for', 'AssetPipeline\APStream');
stream_wrapper_register('ap.filename-for', 'AssetPipeline\APStream');
stream_wrapper_register('ap.url', 'AssetPipeline\APStream');
stream_wrapper_register('ap.filename', 'AssetPipeline\APStream');

0 comments on commit 98a8754

Please sign in to comment.