function warning($context, $code) { if (\get_constant('\\platform\\config\\error::debug_server')) { $args = \func_get_args(); \array_shift($args); //BUG $label = \ucfirst(\strtolower(\get_constant('\\platform\\config\\error::warning_label'))); get_transmission()->warn("console.log('" . $label . " : " . \ucfirst(\strtolower(\preg_replace("/'/", "\\'", \call_user_func_array('config', $args)))) . "');"); } }
private function process() { $user = new user('plow'); $template = new template(); //get environment //send environment get_transmission()->stack(json_encode($user)); get_transmission()->stack(json_encode($template)); get_transmission()->stack('codie.environment.' . file_get_contents('client/templates/computer/journalist.template.js')); get_transmission()->run(); }
function stack_folder($path, $namespace, $mask = null) { //record the folder path containing libs try { $directory = new \DirectoryIterator($path); } catch (Exception $e) { warning('filesystem', 'e001', $path); return; } //format eventual namespace //if namespace exist push namespace in stack as new javascript object if ($namespace != '') { $namespace = trim($namespace, '.'); get_transmission()->stack('if(!' . $namespace . '){' . $namespace . ' = {};}'); $namespace = $namespace . '.'; } //scan the folder //exit if there is NO item, item is NOT (a folder or a file), item IS "dot" folder foreach ($directory as $object) { //get path of item $pathname = $object->getPathname(); if ($object->isDir() && !$object->isDot()) { //get foldername $foldername = $object->getBasename(); //build new namespace $newnamespace = $namespace . $foldername; //send new path and new namespace back to the function stack_folder($pathname, $newnamespace); } else { if ($object->isFile()) { //apply mask rule if ($mask) { if (!preg_match('#' . $mask . '#', $pathname)) { continue; } } //get file content $filecontent = get_file($pathname); //add $namespace to the beginning of file content $filecontent = $namespace . $filecontent; //push javascript object with new namespace in stack get_transmission()->stack($filecontent); } } } }
public function send() { $this->export(); get_transmission()->start(); }
public function __construct($data) { get_transmission()->stack('hello'); get_transmission()->run(); }