Skip to content

Instantly share code, notes, and snippets.

@gartes
Last active May 6, 2018 04:18
Show Gist options
  • Save gartes/f5bc75ea9913df83bad176453dfb5a2a to your computer and use it in GitHub Desktop.
Save gartes/f5bc75ea9913df83bad176453dfb5a2a to your computer and use it in GitHub Desktop.
ukcpu.document $uDoc
/**
* скачать внешний файл скрипта и сохранить
* opt - найти в файле подстроки и заменить
* opt - добавить подстроки в конец и/или в начало файла
* @ $file_url - Url скачиваемого файла
* @ $save_to - локальное хранилище файла ( JPATH_BASE . "/assets/resurs" . '/gtm/'.$ID.'/gtm.js' )
* @ $scripCherch - array // массив поиска в файле
* @ $scriptRepl = array // массив замены
* @ $addToContent array(
* 'srart' => NULL , // - Добавить в начало файла ( строка )
* 'end' => NULL , // - Добавить в конец файла ( строка )
* )
*/
$uDoc->downloadJs( $file_url , JPATH_BASE . $save_to , $scripCherch , $scriptRepl , $addToContent = NULL );
jimport('ukcpu.document.document');
$uDoc = ukcpuDocument::getDocument();
// src - точка
$uDoc::getDotSrc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment