_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q251300
MemoryCacheItemPool.commit
validation
public function commit() { foreach ($this->deferred as $item) { /* @var $item \Psr6NullCache\CacheItem */ $this->save($item); } $this->deferred = []; return true; }
php
{ "resource": "" }
q251301
MetaHandler.set
validation
public function set($key, $value) { $meta = $this->metaModel::where('key', $key)->first(); if ($meta === null) { $meta = new $this->metaModel; $meta->key = $key; } $meta->value = $value; $meta->save(); }
php
{ "resource": "" }
q251302
MetaHandler.create
validation
public function create($key, $value) { $exists = $this->metaModel::where('key', $key) ->exists(); if ($exists) { $message = "Can't create meta (key: $key). "; $message .= "Meta already exists"; throw new \Exception($message); } $meta ...
php
{ "resource": "" }
q251303
MetaHandler.update
validation
public function update($key, $value) { try { $meta = $this->metaModel::where('key', $key) ->firstOrFail(); } catch (\Exception $e) { $message = "Can't update meta (key: $key). "; $message .= "Meta doesn't exist"; throw new \Exception($...
php
{ "resource": "" }
q251304
MetaHandler.get
validation
public function get($key, $default = null) { $meta = $this->metaModel::where('key', $key) ->first(); return $meta === null ? $default : $meta->value; }
php
{ "resource": "" }
q251305
MetaHandler.all
validation
public function all() { $meta = $this->metaModel::get(['key', 'value', 'type']); $data = []; foreach ($meta as $m) { $data[$m->key] = $m->value; } return $data; }
php
{ "resource": "" }
q251306
ParametersData.setPieces
validation
public function setPieces($pieces) { if ($pieces && !$pieces instanceof PieceBag) { $pieces = new PieceBag(is_array($pieces) ? $pieces : []); } return $this->setParameter('pieces', $pieces); }
php
{ "resource": "" }
q251307
FakerController.actionGenerate
validation
public function actionGenerate() { $input = $this->parseArguments(func_get_args()); $container = new Container(); $container->set(GeneratorInterface::class, array_merge(['class' => $this->generator_fqn], $input['generator'])); $container->set(DbProviderInterface::class, array_merge(...
php
{ "resource": "" }
q251308
Renderer.registerTags
validation
protected function registerTags() { // register the "normal" tags, ie tags that are not form controls (widgets, see below) $tags = array('error', 'hint', 'label', 'radioset', 'checkboxset'); foreach ($tags as $tag) { $tagClass = str_replace(' ', '', ucwords(str_replace('-', ' ', ...
php
{ "resource": "" }
q251309
Renderer.registerDecorators
validation
protected function registerDecorators() { $decorators = array('AutoId'); foreach ($decorators as $decoratorClass) { $decoratorClass = '\\Sirius\FormRenderer\\Decorator\\' . $decoratorClass; $this->addDecorator(new $decoratorClass); } }
php
{ "resource": "" }
q251310
Renderer.addDecorator
validation
public function addDecorator(TagDecoratorInterface $decorator, $priority = 0) { $this->decorators->add($decorator, $priority); return $this; }
php
{ "resource": "" }
q251311
Renderer.make
validation
public function make($tag, $props = null, $content = null) { $tag = parent::make($tag, $props, $content); $tag = $this->decorators->apply($tag, $this); return $tag; }
php
{ "resource": "" }
q251312
Renderer.render
validation
public function render(InputFilter $inputFilter) { $inputFilter->prepare(); // ensure it is prepare $props = $inputFilter->getAttributes(); $treeBuilder = new TreeBuilder($inputFilter); $props = array_merge($props, $treeBuilder->getTree()); return $this->make('widget-form', ...
php
{ "resource": "" }
q251313
TargetGroup.fromXML
validation
function fromXML($xmlElement) { $this->id = $xmlElement->id; $this->name = $xmlElement->name; $this->author = $xmlElement->author; $this->state = $xmlElement->state; $this->type = $xmlElement->type; $this->contactFilterName = $xmlElement->contact_filter_name;...
php
{ "resource": "" }
q251314
Drawing.allDrawings
validation
public function allDrawings(Spreadsheet $spreadsheet) { // Get an array of all drawings $aDrawings = []; // Loop through PhpSpreadsheet $sheetCount = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { // Loop through images and add to array ...
php
{ "resource": "" }
q251315
SynchronizationMode.init
validation
static function init() { if (self::$initialized == false) { self::$UPDATE = new SynchronizationMode(1); self::$IGNORE = new SynchronizationMode(2); self::$initialized = true; } }
php
{ "resource": "" }
q251316
StringHelper.controlCharacterOOXML2PHP
validation
public static function controlCharacterOOXML2PHP($value) { self::buildCharacterSets(); return str_replace(array_keys(self::$controlCharacters), array_values(self::$controlCharacters), $value); }
php
{ "resource": "" }
q251317
StringHelper.controlCharacterPHP2OOXML
validation
public static function controlCharacterPHP2OOXML($value) { self::buildCharacterSets(); return str_replace(array_values(self::$controlCharacters), array_keys(self::$controlCharacters), $value); }
php
{ "resource": "" }
q251318
StringHelper.sanitizeUTF8
validation
public static function sanitizeUTF8($value) { if (self::getIsIconvEnabled()) { $value = @iconv('UTF-8', 'UTF-8', $value); return $value; } $value = mb_convert_encoding($value, 'UTF-8', 'UTF-8'); return $value; }
php
{ "resource": "" }
q251319
StringHelper.convertEncoding
validation
public static function convertEncoding($value, $to, $from) { if (self::getIsIconvEnabled()) { $result = iconv($from, $to . '//IGNORE//TRANSLIT', $value); if (false !== $result) { return $result; } } return mb_convert_encoding($value, $to, ...
php
{ "resource": "" }
q251320
StringHelper.strCaseReverse
validation
public static function strCaseReverse($pValue) { $characters = self::mbStrSplit($pValue); foreach ($characters as &$character) { if (self::mbIsUpper($character)) { $character = mb_strtolower($character, 'UTF-8'); } else { $character = mb_strtou...
php
{ "resource": "" }
q251321
StringHelper.getCurrencyCode
validation
public static function getCurrencyCode() { if (!empty(self::$currencyCode)) { return self::$currencyCode; } self::$currencyCode = '$'; $localeconv = localeconv(); if (!empty($localeconv['currency_symbol'])) { self::$currencyCode = $localeconv['currency...
php
{ "resource": "" }
q251322
AujaServiceProvider.registerManager
validation
protected function registerManager() { $this->app->singleton('auja', function ($app) { $config = $app['config']['auja-laravel'] ?: $app['config']['auja-laravel::config']; return new Auja($app, $app['auja.configurator'], $config['models']); }); $this->app->bind('Label...
php
{ "resource": "" }
q251323
AujaServiceProvider.registerConfigurator
validation
protected function registerConfigurator() { $this->app->singleton('auja.database', function($app) { $config = $app['config']['auja-laravel'] ?: $app['config']['auja-laravel::config']; switch ($config['database']) { case 'mysql': return new MySQLD...
php
{ "resource": "" }
q251324
AujaServiceProvider.registerRouter
validation
protected function registerRouter() { $this->app->singleton('auja.router', function($app) { $config = $app['config']['auja-laravel'] ?: $app['config']['auja-laravel::config']; return new AujaRouter($app['auja'], $app['router'], $config['route']); }); $this->app->bi...
php
{ "resource": "" }
q251325
Cli.write
validation
protected function write( $stream, $text ) { $fp = fopen( $stream, 'a' ); fwrite( $fp, $text ); fclose( $fp ); }
php
{ "resource": "" }
q251326
Cli.setMapping
validation
public function setMapping( $severity, $pipe ) { if ( !isset( $this->mapping[$severity] ) ) { throw new \RuntimeException( "Unknown severity: " . $severity ); } if ( ( $pipe !== self::SILENCE ) && ( $pipe !== self::STDOUT ) && ( $pipe !== self::...
php
{ "resource": "" }
q251327
Logger.writeDebugLog
validation
public function writeDebugLog(...$args) { // Only write the debug log if logging is enabled if ($this->writeDebugLog) { $message = implode($args); $cellReference = implode(' -> ', $this->cellStack->showStack()); if ($this->echoDebugLog) { echo $...
php
{ "resource": "" }
q251328
Ods.createZip
validation
private function createZip($pFilename) { // Create new ZIP file and open it for writing $zip = new ZipArchive(); if (file_exists($pFilename)) { unlink($pFilename); } // Try opening the ZIP file if ($zip->open($pFilename, ZipArchive::OVERWRITE) !== true) {...
php
{ "resource": "" }
q251329
Transaction.addAttachmentFromBinaryData
validation
function addAttachmentFromBinaryData($filename, $mimetype, $contents) { $attachment = new Attachment($filename, $mimetype, base64_encode($contents)); $this->attachments[] = $attachment; }
php
{ "resource": "" }
q251330
Transaction.addAttachmentFromBase64Data
validation
function addAttachmentFromBase64Data($filename, $mimetype, $contents) { $attachment = new Attachment($filename, $mimetype, $contents); $this->attachments[] = $attachment; }
php
{ "resource": "" }
q251331
Services_Libravatar.getUrl
validation
public function getUrl($identifier, $options = array()) { // If no identifier has been passed, set it to a null. // This way, there'll always be something returned. if (!$identifier) { $identifier = null; } else { $identifier = $this->normalizeIdentifier($iden...
php
{ "resource": "" }
q251332
Services_Libravatar.checkOptionsArray
validation
protected function checkOptionsArray($options) { //this short options are deprecated! if (isset($options['s'])) { $options['size'] = $options['s']; unset($options['s']); } if (isset($options['d'])) { $options['default'] = $options['d']; ...
php
{ "resource": "" }
q251333
Services_Libravatar.identifierHash
validation
protected function identifierHash($identifier, $hash = 'md5') { if (filter_var($identifier, FILTER_VALIDATE_EMAIL) || $identifier === null) { // If email, we can select our algorithm. Default to md5 for // gravatar fallback. return hash($hash, $identifier); } ...
php
{ "resource": "" }
q251334
Services_Libravatar.domainGet
validation
protected function domainGet($identifier) { if ($identifier === null) { return null; } // What are we, email or openid? Split ourself up and get the // important bit out. if (filter_var($identifier, FILTER_VALIDATE_EMAIL)) { $email = explode('@', $ide...
php
{ "resource": "" }
q251335
Services_Libravatar.srvGet
validation
protected function srvGet($domain, $https = false) { // Are we going secure? Set up a fallback too. if (isset($https) && $https === true) { $subdomain = '_avatars-sec._tcp.'; $fallback = 'seccdn.'; $port = 443; } else { $subdomain = '_ava...
php
{ "resource": "" }
q251336
Services_Libravatar.processDefault
validation
protected function processDefault($url) { if ($url === null) { return $url; } $url = (string)$url; switch ($url) { case '404': case 'mm': case 'identicon': case 'monsterid': case 'wavatar': case 'retro': break;...
php
{ "resource": "" }
q251337
Services_Libravatar.processSize
validation
protected function processSize($size) { if ($size === null) { return $size; } $size = (int)$size; if ($size <= 0) { throw new InvalidArgumentException('Size has to be larger than 0'); } return (int)$size; }
php
{ "resource": "" }
q251338
Worksheet.writeBIFF8CellRangeAddressFixed
validation
private function writeBIFF8CellRangeAddressFixed($range) { $explodes = explode(':', $range); // extract first cell, e.g. 'A1' $firstCell = $explodes[0]; // extract last cell, e.g. 'B6' if (count($explodes) == 1) { $lastCell = $firstCell; } else { ...
php
{ "resource": "" }
q251339
Worksheet.setOutline
validation
public function setOutline($visible = true, $symbols_below = true, $symbols_right = true, $auto_style = false) { $this->outlineOn = $visible; $this->outlineBelow = $symbols_below; $this->outlineRight = $symbols_right; $this->outlineStyle = $auto_style; // Ensure this is a bo...
php
{ "resource": "" }
q251340
Worksheet.writeString
validation
private function writeString($row, $col, $str, $xfIndex) { $this->writeLabelSst($row, $col, $str, $xfIndex); }
php
{ "resource": "" }
q251341
Worksheet.writeRichTextString
validation
private function writeRichTextString($row, $col, $str, $xfIndex, $arrcRun) { $record = 0x00FD; // Record identifier $length = 0x000A; // Bytes to follow $str = StringHelper::UTF8toBIFF8UnicodeShort($str, $arrcRun); // check if string is already present if (!isset($this->stri...
php
{ "resource": "" }
q251342
Worksheet.writeStringRecord
validation
private function writeStringRecord($stringValue) { $record = 0x0207; // Record identifier $data = StringHelper::UTF8toBIFF8UnicodeLong($stringValue); $length = strlen($data); $header = pack('vv', $record, $length); $this->append($header . $data); }
php
{ "resource": "" }
q251343
Worksheet.writeUrlInternal
validation
public function writeUrlInternal($row1, $col1, $row2, $col2, $url) { $record = 0x01B8; // Record identifier $length = 0x00000; // Bytes to follow // Strip URL type $url = preg_replace('/^internal:/', '', $url); // Pack the undocumented parts of the hyperlink stream ...
php
{ "resource": "" }
q251344
Worksheet.writeDimensions
validation
private function writeDimensions() { $record = 0x0200; // Record identifier $length = 0x000E; $data = pack('VVvvv', $this->firstRowIndex, $this->lastRowIndex + 1, $this->firstColumnIndex, $this->lastColumnIndex + 1, 0x0000); // reserved $header = pack('vv', $record, $length); ...
php
{ "resource": "" }
q251345
Worksheet.writeWindow2
validation
private function writeWindow2() { $record = 0x023E; // Record identifier $length = 0x0012; $grbit = 0x00B6; // Option flags $rwTop = 0x0000; // Top row visible in window $colLeft = 0x0000; // Leftmost column visible in window // The options flags that comprise $grbi...
php
{ "resource": "" }
q251346
Worksheet.writeDefaultRowHeight
validation
private function writeDefaultRowHeight() { $defaultRowHeight = $this->phpSheet->getDefaultRowDimension()->getRowHeight(); if ($defaultRowHeight < 0) { return; } // convert to twips $defaultRowHeight = (int) 20 * $defaultRowHeight; $record = 0x0225; // R...
php
{ "resource": "" }
q251347
Worksheet.writeDefcol
validation
private function writeDefcol() { $defaultColWidth = 8; $record = 0x0055; // Record identifier $length = 0x0002; // Number of bytes to follow $header = pack('vv', $record, $length); $data = pack('v', $defaultColWidth); $this->append($header . $data); }
php
{ "resource": "" }
q251348
Worksheet.writeColinfo
validation
private function writeColinfo($col_array) { if (isset($col_array[0])) { $colFirst = $col_array[0]; } if (isset($col_array[1])) { $colLast = $col_array[1]; } if (isset($col_array[2])) { $coldx = $col_array[2]; } else { $c...
php
{ "resource": "" }
q251349
Worksheet.writeSelection
validation
private function writeSelection() { // look up the selected cell range $selectedCells = Coordinate::splitRange($this->phpSheet->getSelectedCells()); $selectedCells = $selectedCells[0]; if (count($selectedCells) == 2) { list($first, $last) = $selectedCells; } else ...
php
{ "resource": "" }
q251350
Worksheet.writeMergedCells
validation
private function writeMergedCells() { $mergeCells = $this->phpSheet->getMergeCells(); $countMergeCells = count($mergeCells); if ($countMergeCells == 0) { return; } // maximum allowed number of merged cells per record $maxCountMergeCellsPerRecord = 1027; ...
php
{ "resource": "" }
q251351
Worksheet.writeSheetLayout
validation
private function writeSheetLayout() { if (!$this->phpSheet->isTabColorSet()) { return; } $recordData = pack( 'vvVVVvv', 0x0862, 0x0000, // unused 0x00000000, // unused 0x00000000, // unused 0x00000014, // si...
php
{ "resource": "" }
q251352
Worksheet.writeSheetProtection
validation
private function writeSheetProtection() { // record identifier $record = 0x0867; // prepare options $options = (int) !$this->phpSheet->getProtection()->getObjects() | (int) !$this->phpSheet->getProtection()->getScenarios() << 1 | (int) !$this-...
php
{ "resource": "" }
q251353
Worksheet.writeRangeProtection
validation
private function writeRangeProtection() { foreach ($this->phpSheet->getProtectedCells() as $range => $password) { // number of ranges, e.g. 'A1:B3 C20:D25' $cellRanges = explode(' ', $range); $cref = count($cellRanges); $recordData = pack( 'vv...
php
{ "resource": "" }
q251354
Worksheet.writeSetup
validation
private function writeSetup() { $record = 0x00A1; // Record identifier $length = 0x0022; // Number of bytes to follow $iPaperSize = $this->phpSheet->getPageSetup()->getPaperSize(); // Paper size $iScale = $this->phpSheet->getPageSetup()->getScale() ? $this->phpSheet->ge...
php
{ "resource": "" }
q251355
Worksheet.writeHeader
validation
private function writeHeader() { $record = 0x0014; // Record identifier /* removing for now // need to fix character count (multibyte!) if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) { $str = $this->phpSheet->getHeaderFooter()->getOddHeader()...
php
{ "resource": "" }
q251356
Worksheet.writeFooter
validation
private function writeFooter() { $record = 0x0015; // Record identifier /* removing for now // need to fix character count (multibyte!) if (strlen($this->phpSheet->getHeaderFooter()->getOddFooter()) <= 255) { $str = $this->phpSheet->getHeaderFooter()->getOddFooter(); ...
php
{ "resource": "" }
q251357
Worksheet.writeHcenter
validation
private function writeHcenter() { $record = 0x0083; // Record identifier $length = 0x0002; // Bytes to follow $fHCenter = $this->phpSheet->getPageSetup()->getHorizontalCentered() ? 1 : 0; // Horizontal centering $header = pack('vv', $record, $length); $data = pack('v', $fHC...
php
{ "resource": "" }
q251358
Worksheet.writeVcenter
validation
private function writeVcenter() { $record = 0x0084; // Record identifier $length = 0x0002; // Bytes to follow $fVCenter = $this->phpSheet->getPageSetup()->getVerticalCentered() ? 1 : 0; // Horizontal centering $header = pack('vv', $record, $length); $data = pack('v', $fVCen...
php
{ "resource": "" }
q251359
Worksheet.writeMarginLeft
validation
private function writeMarginLeft() { $record = 0x0026; // Record identifier $length = 0x0008; // Bytes to follow $margin = $this->phpSheet->getPageMargins()->getLeft(); // Margin in inches $header = pack('vv', $record, $length); $data = pack('d', $margin); if (self:...
php
{ "resource": "" }
q251360
Worksheet.writeMarginRight
validation
private function writeMarginRight() { $record = 0x0027; // Record identifier $length = 0x0008; // Bytes to follow $margin = $this->phpSheet->getPageMargins()->getRight(); // Margin in inches $header = pack('vv', $record, $length); $data = pack('d', $margin); if (sel...
php
{ "resource": "" }
q251361
Worksheet.writeMarginTop
validation
private function writeMarginTop() { $record = 0x0028; // Record identifier $length = 0x0008; // Bytes to follow $margin = $this->phpSheet->getPageMargins()->getTop(); // Margin in inches $header = pack('vv', $record, $length); $data = pack('d', $margin); if (self::g...
php
{ "resource": "" }
q251362
Worksheet.writeMarginBottom
validation
private function writeMarginBottom() { $record = 0x0029; // Record identifier $length = 0x0008; // Bytes to follow $margin = $this->phpSheet->getPageMargins()->getBottom(); // Margin in inches $header = pack('vv', $record, $length); $data = pack('d', $margin); if (s...
php
{ "resource": "" }
q251363
Worksheet.writePrintHeaders
validation
private function writePrintHeaders() { $record = 0x002a; // Record identifier $length = 0x0002; // Bytes to follow $fPrintRwCol = $this->printHeaders; // Boolean flag $header = pack('vv', $record, $length); $data = pack('v', $fPrintRwCol); $this->append($header . $d...
php
{ "resource": "" }
q251364
Worksheet.writePrintGridlines
validation
private function writePrintGridlines() { $record = 0x002b; // Record identifier $length = 0x0002; // Bytes to follow $fPrintGrid = $this->phpSheet->getPrintGridlines() ? 1 : 0; // Boolean flag $header = pack('vv', $record, $length); $data = pack('v', $fPrintGrid); $...
php
{ "resource": "" }
q251365
Worksheet.writeGridset
validation
private function writeGridset() { $record = 0x0082; // Record identifier $length = 0x0002; // Bytes to follow $fGridSet = !$this->phpSheet->getPrintGridlines(); // Boolean flag $header = pack('vv', $record, $length); $data = pack('v', $fGridSet); $this->append($head...
php
{ "resource": "" }
q251366
Worksheet.writeAutoFilterInfo
validation
private function writeAutoFilterInfo() { $record = 0x009D; // Record identifier $length = 0x0002; // Bytes to follow $rangeBounds = Coordinate::rangeBoundaries($this->phpSheet->getAutoFilter()->getRange()); $iNumFilters = 1 + $rangeBounds[1][0] - $rangeBounds[0][0]; $header...
php
{ "resource": "" }
q251367
Worksheet.writeGuts
validation
private function writeGuts() { $record = 0x0080; // Record identifier $length = 0x0008; // Bytes to follow $dxRwGut = 0x0000; // Size of row gutter $dxColGut = 0x0000; // Size of col gutter // determine maximum row outline level $maxRowOutlineLevel = 0; fore...
php
{ "resource": "" }
q251368
Worksheet.writeWsbool
validation
private function writeWsbool() { $record = 0x0081; // Record identifier $length = 0x0002; // Bytes to follow $grbit = 0x0000; // The only option that is of interest is the flag for fit to page. So we // set all the options in one go. // // Set the option flag...
php
{ "resource": "" }
q251369
Worksheet.writeBreaks
validation
private function writeBreaks() { // initialize $vbreaks = []; $hbreaks = []; foreach ($this->phpSheet->getBreaks() as $cell => $breakType) { // Fetch coordinates $coordinates = Coordinate::coordinateFromString($cell); // Decide what to do by the ...
php
{ "resource": "" }
q251370
Worksheet.writeProtect
validation
private function writeProtect() { // Exit unless sheet protection has been specified if (!$this->phpSheet->getProtection()->getSheet()) { return; } $record = 0x0012; // Record identifier $length = 0x0002; // Bytes to follow $fLock = 1; // Worksheet is pr...
php
{ "resource": "" }
q251371
Worksheet.writeScenProtect
validation
private function writeScenProtect() { // Exit if sheet protection is not active if (!$this->phpSheet->getProtection()->getSheet()) { return; } // Exit if scenarios are not protected if (!$this->phpSheet->getProtection()->getScenarios()) { return; ...
php
{ "resource": "" }
q251372
Worksheet.writeObjectProtect
validation
private function writeObjectProtect() { // Exit if sheet protection is not active if (!$this->phpSheet->getProtection()->getSheet()) { return; } // Exit if objects are not protected if (!$this->phpSheet->getProtection()->getObjects()) { return; ...
php
{ "resource": "" }
q251373
Worksheet.writePassword
validation
private function writePassword() { // Exit unless sheet protection and password have been specified if (!$this->phpSheet->getProtection()->getSheet() || !$this->phpSheet->getProtection()->getPassword()) { return; } $record = 0x0013; // Record identifier $length =...
php
{ "resource": "" }
q251374
Worksheet.insertBitmap
validation
public function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) { $bitmap_array = (is_resource($bitmap) ? $this->processBitmapGd($bitmap) : $this->processBitmap($bitmap)); list($width, $height, $size, $data) = $bitmap_array; // Scale the frame of the image. ...
php
{ "resource": "" }
q251375
Worksheet.positionImage
validation
public function positionImage($col_start, $row_start, $x1, $y1, $width, $height) { // Initialise end cell to the same as the start cell $col_end = $col_start; // Col containing lower right corner of object $row_end = $row_start; // Row containing bottom right corner of object // Zer...
php
{ "resource": "" }
q251376
Worksheet.processBitmapGd
validation
public function processBitmapGd($image) { $width = imagesx($image); $height = imagesy($image); $data = pack('Vvvvv', 0x000c, $width, $height, 0x01, 0x18); for ($j = $height; --$j;) { for ($i = 0; $i < $width; ++$i) { $color = imagecolorsforindex($image, i...
php
{ "resource": "" }
q251377
Worksheet.writeZoom
validation
private function writeZoom() { // If scale is 100 we don't need to write a record if ($this->phpSheet->getSheetView()->getZoomScale() == 100) { return; } $record = 0x00A0; // Record identifier $length = 0x0004; // Bytes to follow $header = pack('vv', $re...
php
{ "resource": "" }
q251378
Worksheet.writeMsoDrawing
validation
private function writeMsoDrawing() { // write the Escher stream if necessary if (isset($this->escher)) { $writer = new Escher($this->escher); $data = $writer->close(); $spOffsets = $writer->getSpOffsets(); $spTypes = $writer->getSpTypes(); ...
php
{ "resource": "" }
q251379
Worksheet.writePageLayoutView
validation
private function writePageLayoutView() { $record = 0x088B; // Record identifier $length = 0x0010; // Bytes to follow $rt = 0x088B; // 2 $grbitFrt = 0x0000; // 2 $reserved = 0x0000000000000000; // 8 $wScalvePLV = $this->phpSheet->getSheetView()->getZoomScale(); // 2 ...
php
{ "resource": "" }
q251380
Worksheet.writeCFHeader
validation
private function writeCFHeader() { $record = 0x01B0; // Record identifier $length = 0x0016; // Bytes to follow $numColumnMin = null; $numColumnMax = null; $numRowMin = null; $numRowMax = null; $arrConditional = []; foreach ($this->phpSheet->getConditi...
php
{ "resource": "" }
q251381
Xls.readRecordData
validation
private function readRecordData($data, $pos, $len) { $data = substr($data, $pos, $len); // File not encrypted, or record before encryption start point if ($this->encryption == self::MS_BIFF_CRYPTO_NONE || $pos < $this->encryptionStartPos) { return $data; } $reco...
php
{ "resource": "" }
q251382
Xls.loadOLE
validation
private function loadOLE($pFilename) { // OLE reader $ole = new OLERead(); // get excel data, $ole->read($pFilename); // Get workbook data: workbook stream + sheet streams $this->data = $ole->getStream($ole->wrkbook); // Get summary information data $t...
php
{ "resource": "" }
q251383
Xls.readDefault
validation
private function readDefault() { $length = self::getUInt2d($this->data, $this->pos + 2); // move stream pointer to next record $this->pos += 4 + $length; }
php
{ "resource": "" }
q251384
Xls.readTextObject
validation
private function readTextObject() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if ($this->readDataOnly) { ret...
php
{ "resource": "" }
q251385
Xls.readBof
validation
private function readBof() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = substr($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; // offset: 2; size: 2; type of the following data $subst...
php
{ "resource": "" }
q251386
Xls.makeKey
validation
private function makeKey($block, $valContext) { $pwarray = str_repeat("\0", 64); for ($i = 0; $i < 5; ++$i) { $pwarray[$i] = $valContext[$i]; } $pwarray[5] = chr($block & 0xff); $pwarray[6] = chr(($block >> 8) & 0xff); $pwarray[7] = chr(($block >> 16) & ...
php
{ "resource": "" }
q251387
Xls.readStyle
validation
private function readStyle() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if (!$this->readDataOnly) { // offs...
php
{ "resource": "" }
q251388
Xls.readPalette
validation
private function readPalette() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if (!$this->readDataOnly) { // of...
php
{ "resource": "" }
q251389
Xls.readMsoDrawingGroup
validation
private function readMsoDrawingGroup() { $length = self::getUInt2d($this->data, $this->pos + 2); // get spliced record data $splicedRecordData = $this->getSplicedRecordData(); $recordData = $splicedRecordData['recordData']; $this->drawingGroupData .= $recordData; }
php
{ "resource": "" }
q251390
Xls.readPrintGridlines
validation
private function readPrintGridlines() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if ($this->version == self::XLS_BIFF8 ...
php
{ "resource": "" }
q251391
Xls.readHeader
validation
private function readHeader() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if (!$this->readDataOnly) { // off...
php
{ "resource": "" }
q251392
Xls.readFooter
validation
private function readFooter() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if (!$this->readDataOnly) { // off...
php
{ "resource": "" }
q251393
Xls.readHcenter
validation
private function readHcenter() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if (!$this->readDataOnly) { // of...
php
{ "resource": "" }
q251394
Xls.readVcenter
validation
private function readVcenter() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if (!$this->readDataOnly) { // of...
php
{ "resource": "" }
q251395
Xls.readPageSetup
validation
private function readPageSetup() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if (!$this->readDataOnly) { // ...
php
{ "resource": "" }
q251396
Xls.readMulRk
validation
private function readMulRk() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; // offset: 0; size: 2; index to row $ro...
php
{ "resource": "" }
q251397
Xls.readSharedFmla
validation
private function readSharedFmla() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; // offset: 0, size: 6; cell range address ...
php
{ "resource": "" }
q251398
Xls.readBoolErr
validation
private function readBoolErr() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; // offset: 0; size: 2; row index $row...
php
{ "resource": "" }
q251399
Xls.readMulBlank
validation
private function readMulBlank() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; // offset: 0; size: 2; index to row ...
php
{ "resource": "" }