Class constructor

@param string filename for storing the workbook. "-" for writing to stdout.
@access public
545525
function Spreadsheet_Excel_Writer_Workbook($filename)
    {
        // It needs to call its parent's constructor explicitly
        $this->Spreadsheet_Excel_Writer_BIFFwriter();

        $this->_filename         = $filename;
        $this->_parser           =  new Spreadsheet_Excel_Writer_Parser($this->_byte_order, $this->_BIFF_version);
        $this->_1904             = 0;
        $this->_activesheet      = 0;
        $this->_firstsheet       = 0;
        $this->_selected         = 0;
        $this->_xf_index         = 16; // 15 style XF's and 1 cell XF.
        $this->_fileclosed       = 0;
        $this->_biffsize         = 0;
        $this->_sheetname        = 'Sheet';
        $this->_tmp_format       =  new Spreadsheet_Excel_Writer_Format($this->_BIFF_version);
        $this->_worksheets       = array();
        $this->_sheetnames       = array();
        $this->_formats          = array();
        $this->_palette          = array();
        $this->_codepage         = 0x04E4; // FIXME: should change for BIFF8
        $this->_country_code     = -1;
        $this->_string_sizeinfo  = 3;

        // Add the default format for hyperlinks
        $this->_url_format =  $this->addFormat(array('color' => 'blue', 'underline' => 1));
        $this->_str_total       = 0;
        $this->_str_unique      = 0;
        $this->_str_table       = array();
        $this->_setPaletteXl97();
    }
168755
public function HTML_QuickForm_header($elementName = null, $text = null) {
        debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
        self::__construct($elementName, $text);
    }
374525
function(filename, options) {
    var self = this;
    var stream;
    return utils.fs.exists(filename)
      .then(function(exists) {
        if (!exists) {
          throw new Error('File not found: ' + filename);
        }
        stream = fs.createReadStream(filename);
        return self.read(stream, options)
          .catch(function(error) {
            stream.close();
            throw error;
          });
      })
      .then(function(workbook) {
        stream.close();
        return workbook;
      });
  }
92395
abstract protected function __construct($filename);
    /**
     * @param string $filename
     * @return mixed
     */
    protected function loadYaml($filename)
    {
        $ymlParser = new Parser();
        return $ymlParser->parse(file_get_contents($filename));
    }
310361
protected function _construct() {
		parent::_construct();
		$this
			->_prop(self::$P__CONTENTS, DF_V_ARRAY)
			->_prop(self::$P__TAG, DF_V_STRING_NE)
			->_prop(self::P__1251, DF_V_BOOL, false)
			->_prop(self::P__ATTRIBUTES, DF_V_ARRAY, false)
			->_prop(self::P__DOC_TYPE, DF_V_STRING, false)
			->_prop(self::P__DECODE_ENTITIES, DF_V_BOOL, false)
			->_prop(self::P__PRETTY, DF_V_BOOL, false)
			->_prop(self::P__REMOVE_LINE_BREAKS, DF_V_BOOL, false)
			->_prop(self::P__SKIP_HEADER, DF_V_BOOL, false)
			->_prop(self::P__WRAP_IN_CDATA, DF_V_BOOL, false)
		;
	}
1041185
public function output(string $filename) : Recipe
    {
        $this->output = function () use ($filename) : void {
            $output = $this->render();
            if (getenv("CODGER_DRY")) {
                $output = "\n$filename:\n$output\n";
                self::$inout->write($output);
            } else {
                $dir = dirname($filename);
                if (file_exists($dir) && !is_dir($dir)) {
                    self::$inout->error("$dir already exists, but is not a directory!");
                } else {
                    if (!file_exists($dir)) {
                        mkdir($dir, 0755, true);
                    }
                    $overwrite = (bool)getenv("CODGER_OVERWRITE");
                    $dump = (bool)getenv("CODGER_DUMP");
                    $skip = (bool)getenv("CODGER_SKIP");
                    if (file_exists($filename) && !($overwrite || $dump || $skip)) {
                        $this->options(
                            "$filename already exists, overwrite or dump to screen?",
                            ['o' => 'Overwrite', 'd' => 'Dump', 's' => 'Skip'],
                            function ($answer) use (&$overwrite) {
                                $overwrite = $answer == 'o';
                            }
                        );
                    }
                    if (!file_exists($filename) || $overwrite) {
                        file_put_contents($filename, $output);
                    } elseif ($dump) {
                        self::$inout->write("\n$filename:\n$output\n");
                    }
                }
            }
        };
        return $this;
    }
498533
protected function init() {
		$this->_file = new FileGenerator();
		$this->_class = new ClassGenerator();
		
		$this->setupFile();
		$this->setupFileDocBlock();
		
		$this->setupClass();
		$this->setupMethods();
	}
656101
public function setFilename($filename)
    {
        if (is_array($filename) && isset($filename['name'])) {
            $this->filename = $filename['name'];
        } else {
            $this->filename = $filename;
        }
    }
1135536
public function createPHPExcelObject($filename = null)
    {
        return (null === $filename) ? new \PHPExcel() : call_user_func(array($this->phpExcelIO, 'load'), $filename);
    }
287704
public function addFile($fileName)
    {
        $this->files[$fileName] = sha1_file($fileName);

        $reflection = new FileReflector($fileName, true);
        $reflection->process();

        foreach ($reflection->getClasses() as $class) {
            $class = new ClassDoc($class, $this, ['sourceFile' => $fileName]);
            $this->classes[$class->name] = $class;
        }
        foreach ($reflection->getInterfaces() as $interface) {
            $interface = new InterfaceDoc($interface, $this, ['sourceFile' => $fileName]);
            $this->interfaces[$interface->name] = $interface;
        }
        foreach ($reflection->getTraits() as $trait) {
            $trait = new TraitDoc($trait, $this, ['sourceFile' => $fileName]);
            $this->traits[$trait->name] = $trait;
        }
    }
1158804
public function loadFile($filename) {
		$this->filename = $filename;


		// If a cache directory was specified,
        // try to load from it
		if ($this->cachePath) {
		    if (! $this->templatesRoot) {
		        $this->templatesRoot = dirname($filename);
            }
		    $cacheFile = $this->makeCacheFilename($this->cachePath, $this->templatesRoot, $this->filename);
            if ( file_exists($cacheFile)
                 && (! file_exists($this->filename) || (filemtime($this->filename) < filemtime($cacheFile)) )
            ) {
                $this->loadFromSerialized(file_get_contents($cacheFile));
                return;
            }
        }

		if(file_exists($filename)) {
			$this->source = file_get_contents($filename);
		} else {
			$message = "File not found: $filename";
			throw new FileNotFoundException($message, $filename);
		}
	}
679826
public function MoodleQuickForm_wikifiletable($elementName = null, $elementLabel = null, $attributes = null, $fileinfo = null, $format = null) {
        debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
        self::__construct($elementName, $elementLabel, $attributes, $fileinfo, $format);
    }
154101
public function saveAsScript(string $filename): void
    {
        $config = clone $this;
        unset($config->i__loader);

        $export = str_replace('stdClass::__set_state', '(object)', var_export($config, true));
        $script = "<?php\nreturn $export;";

        $success = file_put_contents($filename, $script, str_contains($filename, ':') ? 0 : LOCK_EX);

        if ($success && function_exists('opcache_compile_file')) {
            // @codeCoverageIgnoreStart
            opcache_compile_file($filename);
            // @codeCoverageIgnoreEnd
        }
    }
434915
public static function output($filename='excel', $format='Xlsx')
    {
        $objPhpSpreadsheet = self::validExcelObj();

        // Create Writer first
        $objWriter = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($objPhpSpreadsheet, $format);

        /**
         * Type Mapping
         */
        $inTypeList = isset(self::$_writerTypeInfo[$format]) ? true : false;
        $extension = ($inTypeList) ? self::$_writerTypeInfo[$format]['extension'] : '';
        $contentType = ($inTypeList) 
            ? self::$_writerTypeInfo[$format]['contentType'] 
            : 'application/octet-stream';

        // Redirect output to a client's web browser
        header("Content-Type: {$contentType}");
        /**
         * @see http://www.rfc-editor.org/rfc/rfc5987.txt
         */
        $filename = rawurlencode($filename);
        header("Content-Disposition: attachment; filename={$filename}{$extension}; filename*=UTF-8''{$filename}{$extension};");
        header("Cache-Control: max-age=0");

        $objWriter->save('php://output');
        exit;
    }
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!');
        }
    }
549886
public function component_installer($sourcebase, $zippath, $zipfilename, $md5filename='', $destpath='') {
        debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
        self::__construct($sourcebase, $zippath, $zipfilename, $md5filename, $destpath);
    }
66084
public function write($fileName=null)
    {
        $this->_resetFileName($fileName);

        ksort($this->data);
        $output = array();

        foreach ($this->data as $path => $hash) {
            array_push($output, "$hash $path\n");
        }

        writeFileText(
            $this->fileName,
            $this->fileEncoding,
            implode('', $output)
        );
    }