复制脚本
@param $binDir
@param $fileName
504011
public static function copyScript($binDir, $fileName)
    {
        $binDir         = $binDir."/zwei/rabbitmq-event";
        @mkdir($binDir, null , true);
        $originFilePath = __DIR__.'/run-scripts/'.$fileName;
        $tartFilePath   = $binDir.'/'.$fileName;
        copy($originFilePath, $tartFilePath);
    }
1195414
protected function create(string $filename){
        $fileSystem = new Filesystem();
        $source = $this->config['source'] ?: 'Source';
        $file_path = ROOT . '/' . $source;
        // 创建文件路径
        $fileSystem->exists($file_path) || $fileSystem->mkdir($file_path);

        $html = '';
        $html .= "---" . PHP_EOL;
        $html .= "title: " . $filename . PHP_EOL;
        $html .= "type: " . 'type' . PHP_EOL;
        $html .= "date: " . date('Y-m-d H:i:s') . PHP_EOL;
        $html .= "tags: " . $filename . PHP_EOL;
        $html .= "---" . PHP_EOL . PHP_EOL;
        $html .= "Create at ".date('Y-m-d H:i:s').PHP_EOL;
        $html .= 'You should edit this page as markdown'.PHP_EOL;

        $file_name = $file_path . '/' . $filename . '.md';
        if ($fileSystem->exists([$file_name])) {
            throw new Exception('Create '.$filename.'.php failed, this file exited!!!');
        }
        
        $status = file_put_contents($file_name, $html, LOCK_EX);
        if ($status === false) {
            throw new Exception('Create '.$filename.' failed!');
        }
    }
667057
public function executeActionsFromFile($fileName)
    {
        $actions = array();
        if (file_exists($fileName)) {
            $actionsClasses = $this->decode($fileName);

            foreach ($actionsClasses as $bundleName => $actionsClass){
                $this->actionManagerGenerator->generate($actionsClass);
                $actions[$bundleName] = $this->actionManagerGenerator->getActionManager();
            }

            $this->filesystem->remove($fileName);
        }
        $this->executeActions($actions);
    }
1352508
public static function createBoundValidator($methodName, ...$boundArgs)
    {
        return function (...$args) use ($methodName, $boundArgs) {
            return call_user_func_array("self::$methodName", array_merge($boundArgs, $args));
        };
    }
1032322
public static function rrmdir($dir, $removeDir = false, $except = []) {
        if (is_dir($dir)) {
            $objects = scandir($dir);
            foreach ($objects as $object) {
                if ($object != "." && $object != "..") {
                    if (filetype($dir . "/" . $object) == "dir") {
                        Terminal::rrmdir($dir . "/" . $object, $removeDir, $except);

                        if ($removeDir == true) {
                            rmdir($dir . "/" . $object . '/');
                        }
                    }
                    else {
                        if (!in_array($object, $except)) {
                            unlink($dir . "/" . $object);
                        }
                    }
                }
            }
            reset($objects);
        }
    }
1021494
public function validExt($filename){
        $exts = $this->config['ext'];
        $ext = $this->getExtension($filename);
        if(array_search($ext,$exts)===false){
            return false;
        }else{
            return true;
        }


    }
116005
public function addFile(string $filename, string $name = null, string $mimeType = null): void
    {
        $attachment = new FileAttachment();
        $attachment->filename = $filename;
        if ($name !== null) {
            $attachment->name = $name;
        }
        if ($mimeType !== null) {
            $attachment->mimeType = $mimeType;
        }
        $this->set($attachment);
    }
1194482
public function setAdditionalElementFromFile(string $filename, Scopable $scope = null, bool $relativeToRootPath = true): void
    {
        $this->additionalElement = new HtmlFromFile($filename, $scope, $relativeToRootPath);
    }
456048
public function getFilePath($filename, $basedir, $relative)
    {
        // Validating the 'file' information
        $files = (array) $filename;

        // Processing the file information
        foreach ($files as $index => $file) {
            $absolutefilename = (($relative === false) ? ($basedir . PhingFile::$separator) : '');
            $absolutefilename .= $file;
            if ($relative === false) {
                $files[$index] = (new FileUtils())->normalize($absolutefilename);
            } else {
                $files[$index] = $absolutefilename;
            }
        }

        return (is_array($filename) ? $files : $files[0]);
    }
546244
private function fileLineGenerator(string $fileName, callable $formatter = null)
    {
        $f = fopen($fileName, 'r');
        try {
            while ($line = fgets($f)) {
                if(!is_null($formatter)){
                    yield call_user_func($formatter, $line);
                }
                else {
                    yield $line;
                }
            }
        } finally {
            fclose($f);
        }
    }
1374894
protected function processCallbacksFor($eventName, File $file)
    {
        if (! array_key_exists($eventName, $this->callbacks) || empty($this->callbacks[$eventName])) {
            return;
        }

        foreach ($this->callbacks[$eventName] as $callback) {
            $callback($file);
        }
    }
486091
private function loadFromBaseDir($basedir, $overwrite = false)
    {
        foreach ($this->getYmlFiles($basedir) as $filename) {
            $this->loadFromFile($filename, $overwrite);
        }
    }
395352
public function submit($itemName, $idCard, $photoSavePath = '', $saveName = '')
    {
        $this->protocol();

        $url = Config::get('url.cet_apply');

        $param['__EVENTTARGET'] = "";
        $param['__EVENTARGUMENT'] = "";
        $param['__VIEWSTATE'] = true;
        $param['txtxxmc'] = "";
        $param[$itemName] = "on";
        $param['txtSFZH'] = $idCard;
        $param['btnSubmit'] = iconv('utf-8', 'gb2312', ' 确 定 ');
        $param['TextBox1'] = "";

        $files['File1'] = '';

        $response = $this->request('upload', [$url, $param, [], $files]);

        return $this->parseCet($response, $photoSavePath, $saveName);
    }
214052
public function byFileNameAndByOrganization($file_name, $organizationId, $databaseConnectionName = null)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    return $this->File->setConnection($databaseConnectionName)
      ->where('name', '=', $file_name)
      ->where('organization_id', '=', $organizationId)
      ->get();
  }
829837
public function removeFile($filename) {
		if( ($key = array_search($filename, $this->attachedFiles)) === false ) {
			throw new \Exception('FileNotContained');
		}
		unset($this->attachedFiles[$key]);
	}
289860
function doOpen( $filename, $mode )
    {
        $this->FileHandler = @fopen( $filename, $mode );
        return $this->FileHandler;
    }
492468
public void addFile(String filename) {
        synchronized (files) {
            if (!files.contains(filename)) {
                files.add(filename);
            }
        }
    }