Figures out where to load yui3 files from and prepends them to $packerFiles

@param array $args
@param array $packerFiles ByRef list of files to pack (by ezjscPacker)
@return string Empty string, this function only modifies $packerFiles
486948
public static function yui3( $args, &$packerFiles )
    {
        $ezjscoreIni = eZINI::instance( 'ezjscore.ini' );
        if ( $ezjscoreIni->variable( 'eZJSCore', 'LoadFromCDN' ) === 'enabled' )
        {
            $scriptFiles = $ezjscoreIni->variable( 'eZJSCore', 'ExternalScripts' );
            $packerFiles = array_merge( array( $scriptFiles['yui3'], 'ezjsc::yui3conf' ), $packerFiles );
        }
        else
        {
            $scriptFiles = $ezjscoreIni->variable( 'eZJSCore', 'LocalScripts' );
            $scriptBases = $ezjscoreIni->variable( 'eZJSCore', 'LocalScriptBasePath' );
            $packerFiles = array_merge( array( $scriptFiles['yui3'], 'ezjsc::yui3conf::' . $scriptBases['yui3'] ), $packerFiles );
        }
        return '';
    }
900782
protected function upload($args)
    {
        $target = $args['target'];
        $volume = $this->volume($target);
        $files  = isset($args['FILES']['upload']) && is_array($args['FILES']['upload']) ? $args['FILES']['upload'] : array();
        $result = array('added' => array(), 'header' => empty($args['html']) ? false : 'Content-Type: text/html; charset=utf-8');

        if (empty($files)) {
            return array('error' => $this->error(self::ERROR_UPLOAD, self::ERROR_UPLOAD_NO_FILES), 'header' => $header);
        }

        if (!$volume) {
            return array('error' => $this->error(self::ERROR_UPLOAD, self::ERROR_TRGDIR_NOT_FOUND, '#'.$target), 'header' => $header);
        }

        foreach ($files['name'] as $i => $name) {
            if (($error = $files['error'][$i]) > 0) {
                $result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, $error == UPLOAD_ERR_INI_SIZE || $error == UPLOAD_ERR_FORM_SIZE ? self::ERROR_UPLOAD_FILE_SIZE : self::ERROR_UPLOAD_TRANSFER);
                $this->uploadDebug = 'Upload error code: '.$error;
                break;
            }

            $tmpname = $files['tmp_name'][$i];

            if (($fp = fopen($tmpname, 'rb')) == false) {
                $result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, self::ERROR_UPLOAD_TRANSFER);
                $this->uploadDebug = 'Upload error: unable open tmp file';
                break;
            }

            if (($file = $volume->upload($fp, $target, $name, $tmpname)) === false) {
                $result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, $volume->error());
                fclose($fp);
                break;
            }

            fclose($fp);
            $result['added'][] = $file;
        }

        return $result;
    }
260977
public function getFilesFromFal(&$files, $directoryArray)
    {
        foreach ($directoryArray as $directory) {
            $folder = $this->storage->getFolder($directory);

            if ($folder->getName() != '_temp_') {
                $filesInFolder = $folder->getFiles();
                if (count($filesInFolder)) {
                    foreach ($filesInFolder as $file) {
                        if (GeneralUtility::inList($this->pObj->indexerConfig['fileext'], $file->getExtension())) {
                            $files[] = $file;
                        }
                    }
                }

                // do recursion
                $subfolders = $folder->getSubFolders();
                if (count($subfolders)) {
                    foreach ($subfolders as $subfolder) {
                        $this->getFilesFromFal($files, array($subfolder->getIdentifier()));
                    }
                }
            }
        }
    }
592202
public function beforeUpdate(array &$args) {
        $data = &$args[1];
        foreach ($data as $key => $value) {
            /**
             * Save the current file value.
             * If it differs from the given value, it will be cleared
             * by afterUpdate.
             */
            if (in_array($key, $this->_fields)) {
                $this->_newValues[$key] = $value;
                if (!$this->_affectedRows) {
                    $model = $args[0];
                    $where = $args[2];
                    $affectedRows = $model->fetchAll($where);
                    $this->_affectedRows = $affectedRows;
                }
            }
        }
    }
611130
static public function saveDraftPreview( $args )
    {
        $result = self::saveDraft( $args );
        $object = eZContentObject::fetch( (int)$args[0] );
        $tpl = eZTemplate::factory();
        $tpl->setVariable( 'object', $object );
        $tpl->setVariable( 'version', $object->version( (int)$args[1] ) );
        $tpl->setVariable( 'locale', eZLocale::instance( $args[2] ) );
        $siteaccessList = self::getSiteaccessList( $args[2], $object );
        if ( empty( $siteaccessList ) )
        {
            $siteaccessList = array(
                eZINI::instance( 'site.ini' )->variable(
                    'SiteSettings', 'DefaultAccess'
                )
            );
        }
        $tpl->setVariable( 'default_siteaccess', current( $siteaccessList ) );
        $tpl->setVariable( 'siteaccess_list', $siteaccessList );

        $result['preview'] = $tpl->fetch( 'design:content/ajax_preview.tpl' );
        return $result;
    }
279435
public static function rander($file, array $args = [], bool $minify = false, array $headers = [])
    {
        static::$isCom = true;
        self::view($file, $args, $minify);
    }
943698
static public function children( $args )
    {
        $ezTagsINI = eZINI::instance( 'eztags.ini' );
        $params = array();

        // Missing: a limit parameter; generateOutput would need to pass it to eZTagsObject::fetchList
        return self::generateOutput(
            $params,
            $args[0],
            $args[1],
            $args[2]
        );
    }
602351
public function run($args)
	{
		if(!isset($args[0]))
		{
			echo "Error: module ID is required.\n";
			echo $this->getHelp();
			return 1;
		}

		$moduleID=$args[0];
		$moduleClass=ucfirst($moduleID).'Module';
		$modulePath=Yii::app()->getModulePath().DIRECTORY_SEPARATOR.$moduleID;

		$sourceDir=$this->templatePath===null?YII_PATH.'/cli/views/shell/module':$this->templatePath;
		$list=$this->buildFileList($sourceDir,$modulePath);
		$list['module.php']['target']=$modulePath.DIRECTORY_SEPARATOR.$moduleClass.'.php';
		$list['module.php']['callback']=array($this,'generateModuleClass');
		$list['module.php']['params']=array(
			'moduleClass'=>$moduleClass,
			'moduleID'=>$moduleID,
		);
		$list[$moduleClass.'.php']=$list['module.php'];
		unset($list['module.php']);

		$this->copyFiles($list);

		echo <<<EOD

Module '{$moduleID}' has been created under the following folder:
    $modulePath

You may access it in the browser using the following URL:
    http://hostname/path/to/index.php?r=$moduleID

Note, the module needs to be installed first by adding '{$moduleID}'
to the 'modules' property in the application configuration.

EOD;
	}
1280527
protected function normalizeArgs(array $args)
    {
        $args += [
            'statsFromPackage' => '',
        ];
        $error = $this->app->make('helper/validation/error');
        $normalized = [];

        try {
            /* @var \CommunityTranslation\Service\RateLimit $rateLimitHelper */
            list($normalized['rateLimit_maxRequests'], $normalized['rateLimit_timeWindow']) = $this->app->make(RateLimit::class)->fromWidgetHtml('rateLimit', $this->rateLimit_timeWindow ?: 3600);
        } catch (UserMessageException $x) {
            $error->add($x->getMessage());
        }

        $normalized['maxFileSize'] = null;
        if (isset($args['maxFileSizeValue']) && (is_int($args['maxFileSizeValue']) || (is_string($args['maxFileSizeValue']) && is_numeric($args['maxFileSizeValue'])))) {
            $maxFileSizeValue = (int) $args['maxFileSizeValue'];
            if ($maxFileSizeValue > 0) {
                $maxFileSizeUnit = $this->post('maxFileSizeUnit');
                $p = is_string($maxFileSizeUnit) ? array_search($maxFileSizeUnit, ['b', 'KB', 'MB', 'GB'], true) : false;
                if ($p === false) {
                    $error->add(t('Please specify the unit of the max size of uploaded files'));
                } else {
                    $maxFileSize = (int) $maxFileSizeValue * pow(1024, $p);
                    $postLimit = $this->getPostLimit();
                    if ($postLimit !== null && $maxFileSize > $postLimit) {
                        $nh = $this->app->make('helper/number');
                        $error->add(
                            t(
                                'You can\'t set the max file size to %1$s since the current limit imposed by PHP is %2$s',
                                $nh->formatSize($maxFileSize),
                                $nh->formatSize($postLimit)
                            )
                        );
                    } else {
                        $normalized['maxFileSize'] = $maxFileSize;
                    }
                }
            }
        }
        $normalized['maxLocalesCount'] = null;
        if (isset($args['maxLocalesCount']) && (is_int($args['maxLocalesCount']) || (is_string($args['maxLocalesCount']) && is_numeric($args['maxLocalesCount'])))) {
            $i = (int) $args['maxLocalesCount'];
            if ($i > 0) {
                $normalized['maxLocalesCount'] = $i;
            }
        }
        $normalized['maxStringsCount'] = null;
        if (isset($args['maxStringsCount']) && (is_int($args['maxStringsCount']) || (is_string($args['maxStringsCount']) && is_numeric($args['maxStringsCount'])))) {
            $i = (int) $args['maxStringsCount'];
            if ($i > 0) {
                $normalized['maxStringsCount'] = $i;
            }
        }
        $normalized['statsFromPackage'] = '';
        if (is_string($args['statsFromPackage'])) {
            $normalized['statsFromPackage'] = trim($args['statsFromPackage']);
            if ($normalized['statsFromPackage'] !== '') {
                $package = $this->app->make(PackageRepository::class)->findOneBy(['handle' => $normalized['statsFromPackage']]);
                if ($package === null) {
                    $error->add(t('Unable to find a package with handle "%s"', $normalized['statsFromPackage']));
                } elseif ($package->getLatestVersion() === null) {
                    $error->add(t('The package with handle "%s" does not have a latest version', $normalized['statsFromPackage']));
                }
            }
        }

        return $error->has() ? $error : $normalized;
    }
1013738
function loadModules(dir, container, args) {
  var files = fs.readdirSync(dir);
  for (var i = 0; i < files.length; i++) {
    var file = files[i];
    var filePath = path.join(dir, file);
    if (fs.statSync(filePath).isDirectory()) {
      container[file] = {};
      loadModules(filePath, container[file], args);
      continue;
    }
    if (/.+\.js$/.test(file)) {
      var name = file.replace(/\.js$/, '') 
      container[name] = require(filePath)(args, container);
    }
  }
}
995074
protected function get_packer_for_read_operation($archivefile) {
        global $CFG;
        require_once($CFG->dirroot . '/lib/filestorage/tgz_packer.php');

        if (tgz_packer::is_tgz_file($archivefile)) {
            return get_file_packer('application/x-gzip');
        } else {
            return get_file_packer('application/zip');
        }
    }
452381
public function makeBucket(array $args = array()) {
        $bucket = isset($args[0]) ? $args[0] : null;
        if (is_null($bucket)) {
            $config = Zend_Registry::get('config');
            $bucket = isset($config->cdn->s3->bucket) ? $config->cdn->s3->bucket : null;
        }
        if (is_null($bucket)) {
            Garp_Cli::errorOut('No bucket configured');
            return false;
        }
        return $this->s3(
            'mb', array(
            's3://' . $bucket
            )
        );
    }
326278
protected function rm($args) {
		$targets = is_array($args['targets']) ? $args['targets'] : array();
		$result  = array('removed' => array());
		
		foreach ($targets as $target) {
			if (($volume = $this->volume($target)) == false) {
				$result['warning'] = $this->error(self::ERROR_RM, '#'.$target, self::ERROR_FILE_NOT_FOUND);
				return $result;
			}
			if (!$volume->rm($target)) {
				$result['warning'] = $this->error($volume->error());
				return $result;
			}
		}

		return $result;
	}
673503
protected function archive($args) {
		$type    = $args['type'];
		$targets = isset($args['targets']) && is_array($args['targets']) ? $args['targets'] : array();
	
		if (($volume = $this->volume($targets[0])) == false) {
			return $this->error(self::ERROR_ARCHIVE, self::ERROR_TRGDIR_NOT_FOUND);
		}
	
		return ($file = $volume->archive($targets, $args['type']))
			? array('added' => array($file))
			: array('error' => $this->error(self::ERROR_ARCHIVE, $volume->error()));
	}
250659
protected function loadFixtures(
        LoaderInterface $loader,
        EntityManagerInterface $manager,
        array $files,
        array $parameters,
        ?PurgeMode $purgeMode
    ) {
        $persister = $this->createPersister($manager);

        $loader = $loader->withPersister($persister);

        return $loader->load($files, $parameters, [], $purgeMode);
    }
495695
public static function filterFiles($args, $allowWildcards = true)
    {
        $files = array();
        foreach ($args as $arg) {
            if (file_exists($arg)) {
                $files[] = $arg;
            } else if ($allowWildcards && strpos($arg, '*') !== false) {
                $files = array_merge($files, glob($arg));
            }
        }
        return $files;
    }
1373489
public function addFiles($fileOrFiles)
    {
        $files_list = self::createFilesList($fileOrFiles);
        if (empty($files_list))
            throw new InvalidArgumentException('Files list is empty!');
        $result = $this->archive->addFiles($files_list);
        $this->scanArchive();
        return $result;
    }