gwm
2
.env
@ -20,7 +20,7 @@
|
||||
# APP
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
app.baseURL = 'http://localhost/donation/'
|
||||
# app.baseURL = 'http://localhost/donation/'
|
||||
# app.forceGlobalSecureRequests = false
|
||||
|
||||
# app.sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'
|
||||
|
||||
@ -22,8 +22,40 @@ class App extends BaseConfig
|
||||
|
|
||||
*/
|
||||
|
||||
public $baseURL = 'http://localhost/donation/';
|
||||
public $baseURL;
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
if ('development' == $_ENV['CI_ENVIRONMENT'])
|
||||
{
|
||||
$this->baseURL = 'http://localhost/donation/';
|
||||
}
|
||||
else
|
||||
{
|
||||
$allowed_domains = array('domain1.co.uk', 'domain1.com', 'domain1-preview.host.co.uk');
|
||||
$default_domain = 'domain1.co.uk';
|
||||
|
||||
if (in_array($_SERVER['HTTP_HOST'], $allowed_domains, true))
|
||||
{
|
||||
$domain = $_SERVER['HTTP_HOST'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$domain = $default_domain;
|
||||
}
|
||||
|
||||
if (!empty($_SERVER['HTTPS']))
|
||||
{
|
||||
$this->baseURL = 'https://' . $domain;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->baseURL = 'http://' . $domain;
|
||||
}
|
||||
}
|
||||
parent::__construct();
|
||||
}
|
||||
// public $baseURL = BASE;
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Index File
|
||||
|
||||
@ -46,7 +46,7 @@ class Email extends BaseConfig
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $SMTPHost = 'smtp.googlemail.com';
|
||||
public $SMTPHost = 'ssl://smtp.gmail.com';
|
||||
|
||||
/**
|
||||
* SMTP Username
|
||||
|
||||
@ -38,14 +38,22 @@ $routes->match(['get','post'],'fetch_state','Donor_controller::fetch_state');
|
||||
$routes->match(['get','post'],'fetch_city','Donor_controller::fetch_city');
|
||||
|
||||
$routes->match(['get','post'],'receipt','Dashboard::generate_receipts');
|
||||
$routes->match(['get','post'],'update_receipt','Dashboard::update_receipt');
|
||||
$routes->match(['get','post'],'transaction','Dashboard::transaction_upload');
|
||||
$routes->match(['get','post'],'donation_data','Dashboard::donation_data_upload');
|
||||
$routes->match(['get','post'],'donor_register','My_controller::donor_register');
|
||||
|
||||
$routes->match(['get'],'fetch_donor_id','Dashboard::fetch_donor_id');
|
||||
$routes->match(['get'],'edit_donor_id','Dashboard::edit_donor_id');
|
||||
$routes->match(['get'],'fetch_cause_name','Dashboard::fetch_cause_name');
|
||||
$routes->match(['get','post'],'add_donation_cause','Dashboard::add_donation_cause');
|
||||
$routes->match(['get'],'htmlToPDF','PdfController::htmlToPDF');
|
||||
$routes->match(['get'],'active_cause','Dashboard::active_cause');
|
||||
$routes->match(['get'],'inactive_cause','Dashboard::inactive_cause');
|
||||
|
||||
|
||||
$routes->match(['get','post'],'donation_data_excel','PhpspreadsheetController::import_donation_data');
|
||||
$routes->match(['get','post'],'transaction_data_excel','PhpspreadsheetController::import_transaction_data');
|
||||
// $routes->add('register','Donation::register');
|
||||
// $routes->add('list','Donation::edit_view');
|
||||
// $routes->add('store','Home::store');
|
||||
|
||||
@ -45,6 +45,11 @@ class Dashboard extends BaseController
|
||||
function fetch_donor_id()
|
||||
{
|
||||
echo $this->MyModel->fetch_donor_id();
|
||||
}
|
||||
function edit_donor_id($receipt_id)
|
||||
{
|
||||
echo $receipt_id; die();
|
||||
echo $this->MyModel->edit_donor_id();
|
||||
}
|
||||
function fetch_cause_name()
|
||||
{
|
||||
@ -60,8 +65,7 @@ class Dashboard extends BaseController
|
||||
}
|
||||
|
||||
$name= session()->get('logged_user');
|
||||
//$data['donor']=$this->MyModel->fetch_donor_id();
|
||||
//$data2['donor']=$this->MyModel->fetch_donor_id();
|
||||
|
||||
echo view('templates/header');
|
||||
echo view('receipts');
|
||||
echo view('templates/footer');
|
||||
@ -74,19 +78,68 @@ class Dashboard extends BaseController
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$model = new Receipt_model();
|
||||
|
||||
$donor_id=$this->request->getVar('donor_id');
|
||||
$mymodel = new My_model();
|
||||
$donor = $mymodel->find($donor_id);
|
||||
$donor_name = $donor['name'];
|
||||
|
||||
$cause_id=$this->request->getVar('cause_id');
|
||||
$causemodel = new Donation_cause();
|
||||
$cause = $causemodel->find($cause_id);
|
||||
$cause_name = $cause['cause_name'];
|
||||
|
||||
$receiptData=[
|
||||
'receipt_no' =>$this->request->getVar('receipt_no'),
|
||||
|
||||
'date' =>$this->request->getVar('date'),
|
||||
'donor_id' =>$this->request->getVar('donor_id'),
|
||||
'donor_name' =>$donor_name,
|
||||
'amount' =>$this->request->getVar('amount'),
|
||||
'mode_of_receipt' =>$this->request->getVar('mode_of_receipt'),
|
||||
'receipt_details' =>$this->request->getVar('receipt_details'),
|
||||
'cause_name' =>$this->request->getVar('cause_name'),
|
||||
'cause_id' =>$this->request->getVar('cause_id'),
|
||||
'cause_name' =>$cause_name,
|
||||
'remarks' =>$this->request->getVar('remarks'),
|
||||
];
|
||||
$model->save($receiptData);
|
||||
return redirect()->to(base_url().'/Dashboard/last_receipt/');
|
||||
$model = new Receipt_model();
|
||||
$model->save($receiptData);
|
||||
return redirect()->to(base_url().'/Dashboard/last_receipt');
|
||||
}
|
||||
function update_receipt()
|
||||
{
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
$receipt_id=$this->request->getVar('receipt_id');
|
||||
|
||||
$donor_id=$this->request->getVar('donor_id');
|
||||
$mymodel = new My_model();
|
||||
$donor = $mymodel->find($donor_id);
|
||||
$donor_name = $donor['name'];
|
||||
|
||||
$cause_id=$this->request->getVar('cause_id');
|
||||
$causemodel = new Donation_cause();
|
||||
$cause = $causemodel->find($cause_id);
|
||||
$cause_name = $cause['cause_name'];
|
||||
|
||||
$receiptData=[
|
||||
|
||||
'date' =>$this->request->getVar('date'),
|
||||
'donor_id' =>$this->request->getVar('donor_id'),
|
||||
'donor_name' =>$donor_name,
|
||||
'amount' =>$this->request->getVar('amount'),
|
||||
'mode_of_receipt' =>$this->request->getVar('mode_of_receipt'),
|
||||
'receipt_details' =>$this->request->getVar('receipt_details'),
|
||||
'cause_id' =>$this->request->getVar('cause_id'),
|
||||
'cause_name' =>$cause_name,
|
||||
'remarks' =>$this->request->getVar('remarks'),
|
||||
];
|
||||
$model = new Receipt_model();
|
||||
$model->update($receipt_id , $receiptData);
|
||||
return redirect()->to(base_url().'/Dashboard/all_receipt');
|
||||
|
||||
}
|
||||
|
||||
public function all_receipt()
|
||||
@ -108,19 +161,25 @@ class Dashboard extends BaseController
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$model = new Receipt_model();
|
||||
$receipt_data=$model->find($receipt_id);
|
||||
$data= [ 'post'=>$receipt_data ];
|
||||
|
||||
if($this->request->getMethod() == 'post')
|
||||
{
|
||||
$model = new Receipt_model();
|
||||
$_POST['receipt_id'] = $receipt_id;
|
||||
$model->save($_POST);
|
||||
return redirect()->to(base_url()."/Dashboard/all_receipt");
|
||||
}
|
||||
echo view('templates/header',$data);
|
||||
echo view('receipt_edit');
|
||||
$receipt_model = new Receipt_model();
|
||||
$receipt_data=$receipt_model->find($receipt_id);
|
||||
|
||||
$donor_model = new My_model();
|
||||
$donor_data=$donor_model->findAll();
|
||||
|
||||
$cause_model = new Donation_cause();
|
||||
$cause_data=$cause_model->findAll();
|
||||
|
||||
$data= [ 'post'=>$receipt_data , 'donor'=>$donor_data , 'cause'=>$cause_data ];
|
||||
// if($this->request->getMethod() == 'post')
|
||||
// {
|
||||
// $model = new Receipt_model();
|
||||
// $_POST['receipt_id'] = $receipt_id;
|
||||
// $model->save($_POST);
|
||||
// return redirect()->to(base_url()."/Dashboard/all_receipt");
|
||||
// }
|
||||
echo view('templates/header');
|
||||
echo view('receipt_edit',$data);
|
||||
echo view('templates/footer');
|
||||
|
||||
}
|
||||
@ -161,7 +220,7 @@ class Dashboard extends BaseController
|
||||
$receipt_id=$receiptid;
|
||||
$receipt_data=$rmodel->find($receipt_id);
|
||||
$donorid = $receipt_data['donor_id'];
|
||||
$causeid = $receipt_data['cause_name'];
|
||||
$causeid = $receipt_data['cause_id'];
|
||||
// donation cause
|
||||
$causemodel = new Donation_cause();
|
||||
$cause_id=$causeid;
|
||||
@ -201,14 +260,13 @@ class Dashboard extends BaseController
|
||||
$transactionData=[
|
||||
'date' =>$this->request->getVar('date'),
|
||||
'ref_1' =>$this->request->getVar('ref_1'),
|
||||
'ref_2' =>$this->request->getVar('ref_2'),
|
||||
'remarks' =>$this->request->getVar('remarks'),
|
||||
'amount' =>$this->request->getVar('amount'),
|
||||
'donation_ref' =>$this->request->getVar('donation_ref'),
|
||||
|
||||
];
|
||||
$model->save($transactionData);
|
||||
return redirect()->to(base_url().'/Dashboard');
|
||||
return redirect()->to(base_url().'/Dashboard/all_transaction');
|
||||
}
|
||||
public function all_transaction()
|
||||
{
|
||||
@ -318,13 +376,23 @@ class Dashboard extends BaseController
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
|
||||
$data['donationcause']=$this->dcModel->all_donation_cause();
|
||||
echo view('templates/header',$data);
|
||||
echo view('add_donation_cause');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
public function all_donation_cause()
|
||||
{
|
||||
$data = [];
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$data['donationcause']=$this->dcModel->all_donation_cause();
|
||||
echo view('templates/header',$data);
|
||||
echo view('all_donation_cause');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
public function add_donation_cause()
|
||||
{
|
||||
if(!session()->has('logged_user'))
|
||||
@ -332,11 +400,12 @@ class Dashboard extends BaseController
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$model = new Donation_cause();
|
||||
$active="Active";
|
||||
$donationCause=[
|
||||
'cause_name' =>$this->request->getVar('cause_name'),
|
||||
'from_date' =>$this->request->getVar('from_date'),
|
||||
'to_date' =>$this->request->getVar('to_date'),
|
||||
'status' =>1,
|
||||
'status' =>$active,
|
||||
];
|
||||
$model->save($donationCause);
|
||||
return redirect()->to(base_url()."/Dashboard/donation_cause");
|
||||
@ -362,5 +431,43 @@ class Dashboard extends BaseController
|
||||
echo view('donation_cause_edit');
|
||||
echo view('templates/footer');
|
||||
|
||||
}
|
||||
function inactive_cause($cause_id)
|
||||
{ $id = $cause_id;
|
||||
$inactive="Inactive";
|
||||
$donationCause=['status' =>$inactive,];
|
||||
$model = new Donation_cause();
|
||||
$model->update($id , $donationCause);
|
||||
return redirect()->to(base_url()."/Dashboard/all_donation_cause");
|
||||
|
||||
}
|
||||
function active_cause($cause_id)
|
||||
{ $id = $cause_id;
|
||||
$active="Active";
|
||||
$donationCause=['status' =>$active,];
|
||||
$model = new Donation_cause();
|
||||
$model->update($id , $donationCause);
|
||||
return redirect()->to(base_url()."/Dashboard/all_donation_cause");
|
||||
|
||||
}
|
||||
|
||||
function donation_data_excel()
|
||||
{
|
||||
$validation = \Confic\Services::validation();
|
||||
$valid=$this->validate(
|
||||
[
|
||||
'fileimport' =>[
|
||||
'lable' => 'input file',
|
||||
'rules' => 'uploaded[fileimport]|ext_in[fileimport,xls & xlsx]',
|
||||
'errors' => [
|
||||
'uploaded' => '{field} error',
|
||||
'ext_in' => '{field} error excel',
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -55,12 +55,14 @@ class Donor_controller extends BaseController
|
||||
|
||||
public function register()
|
||||
{
|
||||
$data['country']=$this->Dashboard_model->fetch_country();
|
||||
helper(['form']);
|
||||
|
||||
|
||||
$data['country']=$this->Dashboard_model->fetch_country();
|
||||
helper(['form']);
|
||||
|
||||
if($this->request->getmethod() == 'post')
|
||||
{
|
||||
// validate
|
||||
//validate
|
||||
$rules=[
|
||||
'name' =>'required|min_length[3]|max_length[20]',
|
||||
'phone' =>'required|min_length[3]|max_length[20]',
|
||||
@ -77,12 +79,30 @@ class Donor_controller extends BaseController
|
||||
'gstin' =>'required|min_length[3]|max_length[20]',
|
||||
'password' =>'required|min_length[8]|max_length[200]',
|
||||
'password_confirm' =>'matches[password]',
|
||||
//'userfile' => 'ext_in[fileimport,jpg & png]',image/jpg,image/jpeg,image/gif,
|
||||
'userfile' => [
|
||||
'uploaded[userfile]',
|
||||
'mime_in[userfile,image/png]',
|
||||
'max_size[userfile,1000]',
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
if(! $this->validate($rules))
|
||||
{
|
||||
$data['validation'] = $this->validator;
|
||||
}else{
|
||||
|
||||
$path="public/assets/uploads";
|
||||
if($img = $this->request->getFile('userfile'))
|
||||
{
|
||||
if ($img->isValid() && ! $img->hasMoved())
|
||||
{
|
||||
$newName = $img->getRandomName();
|
||||
$img->move($path, $newName);
|
||||
$signature="public/assets/uploads/".$newName.".jpeg";
|
||||
}
|
||||
}
|
||||
//store the donor in database
|
||||
$model = new Donor_model();
|
||||
$donorData=[
|
||||
@ -101,6 +121,8 @@ class Donor_controller extends BaseController
|
||||
'gstin' =>$this->request->getVar('gstin'),
|
||||
'foreign_key' =>$this->request->getVar('email'),
|
||||
'password' =>$this->request->getVar('password'),
|
||||
'signature' =>$signature,
|
||||
|
||||
|
||||
];
|
||||
$model->save($donorData);
|
||||
@ -110,11 +132,12 @@ class Donor_controller extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo view('templates/header',$data);
|
||||
echo view('register');
|
||||
echo view('templates/footer');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function fetch_country()
|
||||
{
|
||||
|
||||
@ -39,7 +39,7 @@ class PdfController extends Controller
|
||||
$receipt_id=$receiptid;
|
||||
$receipt_data=$rmodel->find($receipt_id);
|
||||
$donorid = $receipt_data['donor_id'];
|
||||
$causeid = $receipt_data['cause_name'];
|
||||
$causeid = $receipt_data['cause_id'];
|
||||
// donation cause
|
||||
$causemodel = new Donation_cause();
|
||||
$cause_id=$causeid;
|
||||
@ -50,12 +50,17 @@ class PdfController extends Controller
|
||||
$Donor_data=$model->find($donor_id);
|
||||
// array for receipt
|
||||
$data= [ 'donordata'=>$Donor_data , 'admindata' =>$admin_data , 'receipt'=>$receipt_data , 'causedata'=>$cause_data];
|
||||
|
||||
//echo view('sample',$data); die();
|
||||
$html = view('sample',$data);
|
||||
$dompdf = new \Dompdf\Dompdf();
|
||||
$dompdf->loadHtml(view('download_receipt',$data));
|
||||
//$dompdf->loadHtml(view('download_receipt',$data));
|
||||
$dompdf->loadHtml($html);
|
||||
$dompdf->setPaper('A4', 'portrait');
|
||||
$dompdf->render();
|
||||
$dompdf->stream();
|
||||
$pdfContent = $dompdf->output();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
246
app/Controllers/PhpspreadsheetController.php
Normal file
@ -0,0 +1,246 @@
|
||||
<?php namespace App\Controllers;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
|
||||
use App\Models\Transaction_model;
|
||||
use App\Models\Donation_data_model;
|
||||
|
||||
|
||||
class PhpspreadsheetController extends BaseController
|
||||
{
|
||||
|
||||
public $session;
|
||||
public function __construct()
|
||||
{
|
||||
$this->session = session();
|
||||
$this->Donation_data_model = new Donation_data_model();
|
||||
$this->Transaction_model = new Transaction_model();
|
||||
|
||||
}
|
||||
|
||||
public function import_donation_data()
|
||||
{
|
||||
|
||||
|
||||
if($this->request->getmethod() == 'post')
|
||||
{
|
||||
//validate
|
||||
$rules=[
|
||||
|
||||
'upload_file' => [
|
||||
'rules'=>'uploaded[upload_file]|max_size[upload_file,1024]|ext_in[upload_file,xlsx]',
|
||||
'lable'=>'upload file'
|
||||
|
||||
]
|
||||
|
||||
];
|
||||
|
||||
if(! $this->validate($rules))
|
||||
{
|
||||
$data['validation'] = $this->validator;
|
||||
}else{
|
||||
|
||||
$file= $this->request->getFile('upload_file');
|
||||
//echo $file->getName();exit();
|
||||
$ext=$file->getClientExtension();
|
||||
if($ext == 'xls'){
|
||||
$render = new \PhpOffice\PhpSpreadsheet\Reader\Xls();
|
||||
} else {
|
||||
$render = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
|
||||
}
|
||||
$spreadsheet = $render->load($file);
|
||||
$allDataInSheet = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);
|
||||
$arrayCount = count($allDataInSheet);
|
||||
|
||||
$flag = 0;
|
||||
$createArray = array('DATE', 'CAUSE_NAME', 'AMOUNT', 'PAYMENT_MODE' , 'REF' , 'DONATION_REF');
|
||||
|
||||
$makeArray = array('DATE' => 'DATE', 'CAUSE_NAME' => 'CAUSE_NAME', 'AMOUNT' => 'AMOUNT', 'PAYMENT_MODE' => 'PAYMENT_MODE', 'REF' => 'REF', 'DONATION_REF' => 'DONATION_REF');
|
||||
|
||||
$SheetDataKey = array();
|
||||
|
||||
foreach ($allDataInSheet as $dataInSheet) {
|
||||
foreach ($dataInSheet as $key => $value) {
|
||||
|
||||
if (in_array(trim($value), $createArray)) {
|
||||
|
||||
$value = preg_replace('/\s+/', '', $value);
|
||||
$SheetDataKey[trim($value)] = $key;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$dataDiff = array_diff_key($makeArray, $SheetDataKey);
|
||||
|
||||
if (empty($dataDiff)) {
|
||||
$flag = 1;
|
||||
}
|
||||
// match excel sheet column
|
||||
if ($flag == 1)
|
||||
{
|
||||
for ($i = 2; $i <= $arrayCount; $i++)
|
||||
{
|
||||
|
||||
$date = $SheetDataKey['DATE'];
|
||||
$cause_name = $SheetDataKey['CAUSE_NAME'];
|
||||
$amount = $SheetDataKey['AMOUNT'];
|
||||
$payment_mode = $SheetDataKey['PAYMENT_MODE'];
|
||||
$ref = $SheetDataKey['REF'];
|
||||
$donation_ref = $SheetDataKey['DONATION_REF'];
|
||||
|
||||
|
||||
$date = filter_var(trim($allDataInSheet[$i][$date]), FILTER_SANITIZE_STRING);
|
||||
$cause_name = filter_var(trim($allDataInSheet[$i][$cause_name]), FILTER_SANITIZE_STRING);
|
||||
$amount = filter_var(trim($allDataInSheet[$i][$amount]), FILTER_SANITIZE_EMAIL);
|
||||
$payment_mode = filter_var(trim($allDataInSheet[$i][$payment_mode]), FILTER_SANITIZE_STRING);
|
||||
$ref = filter_var(trim($allDataInSheet[$i][$ref]), FILTER_SANITIZE_EMAIL);
|
||||
$donation_ref = filter_var(trim($allDataInSheet[$i][$donation_ref]), FILTER_SANITIZE_STRING);
|
||||
|
||||
$fetchData= array('date' => $date, 'cause_name' => $cause_name, 'amount' => $amount, 'mode_of_payment' => $payment_mode, 'ref_1' => $ref, 'donation_ref' => $donation_ref);
|
||||
|
||||
|
||||
$model = new Donation_data_model();
|
||||
$model->save($fetchData);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
echo '<script>alert("Please import correct file, did not match excel sheet column")</script>';
|
||||
//echo "Please import correct file, did not match excel sheet column";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
echo view('templates/header');
|
||||
echo view('donation_data');
|
||||
echo view('templates/footer');
|
||||
// $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
|
||||
// if(isset($_FILES['upload_file']['name']) && in_array($_FILES['upload_file']['type'], $file_mimes))
|
||||
// {
|
||||
// $arr_file = explode('.', $_FILES['upload_file']['name']);
|
||||
// $extension = end($arr_file);
|
||||
// if('csv' == $extension){
|
||||
// $reader = new \PhpOffice\PhpSpreadsheet\Reader\Csv();
|
||||
// } else {
|
||||
// $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
|
||||
// }
|
||||
// $spreadsheet = $reader->load($_FILES['upload_file']['tmp_name']);
|
||||
// $sheetData = $spreadsheet->getActiveSheet()->toArray();
|
||||
// echo "<pre>";
|
||||
// print_r($sheetData);
|
||||
// }
|
||||
}
|
||||
|
||||
public function import_transaction_data()
|
||||
{
|
||||
|
||||
|
||||
if($this->request->getmethod() == 'post')
|
||||
{
|
||||
//validate
|
||||
$rules=[
|
||||
|
||||
'transacton_upload' => [
|
||||
'rules'=>'uploaded[transacton_upload]|max_size[transacton_upload,1024]|ext_in[transacton_upload,xlsx]',
|
||||
'lable'=>'upload file'
|
||||
|
||||
]
|
||||
|
||||
];
|
||||
|
||||
if(! $this->validate($rules))
|
||||
{
|
||||
$data['validation'] = $this->validator;
|
||||
}else{
|
||||
|
||||
$file= $this->request->getFile('transacton_upload');
|
||||
//echo $file->getName();exit();
|
||||
$ext=$file->getClientExtension();
|
||||
if($ext == 'xls'){
|
||||
$render = new \PhpOffice\PhpSpreadsheet\Reader\Xls();
|
||||
} else {
|
||||
$render = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
|
||||
}
|
||||
$spreadsheet = $render->load($file);
|
||||
$allDataInSheet = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);
|
||||
$arrayCount = count($allDataInSheet);
|
||||
|
||||
$flag = 0;
|
||||
$createArray = array('DATE', 'REF_1', 'REF_2', 'REMARKS' , 'AMOUNT' , 'DONATION_REF');
|
||||
|
||||
$makeArray = array('DATE' => 'DATE', 'REF_1' => 'REF_1', 'REF_2' => 'REF_2', 'REMARKS' => 'REMARKS', 'AMOUNT' => 'AMOUNT', 'DONATION_REF' => 'DONATION_REF');
|
||||
|
||||
$SheetDataKey = array();
|
||||
|
||||
foreach ($allDataInSheet as $dataInSheet) {
|
||||
foreach ($dataInSheet as $key => $value) {
|
||||
|
||||
if (in_array(trim($value), $createArray)) {
|
||||
|
||||
$value = preg_replace('/\s+/', '', $value);
|
||||
$SheetDataKey[trim($value)] = $key;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$dataDiff = array_diff_key($makeArray, $SheetDataKey);
|
||||
|
||||
if (empty($dataDiff)) {
|
||||
$flag = 1;
|
||||
}
|
||||
// match excel sheet column
|
||||
if ($flag == 1)
|
||||
{
|
||||
for ($i = 2; $i <= $arrayCount; $i++)
|
||||
{
|
||||
|
||||
$date = $SheetDataKey['DATE'];
|
||||
$ref_1 = $SheetDataKey['REF_1'];
|
||||
$ref_2 = $SheetDataKey['REF_2'];
|
||||
$remarks = $SheetDataKey['REMARKS'];
|
||||
$amount = $SheetDataKey['AMOUNT'];
|
||||
$donation_ref = $SheetDataKey['DONATION_REF'];
|
||||
|
||||
|
||||
$date = filter_var(trim($allDataInSheet[$i][$date]), FILTER_SANITIZE_STRING);
|
||||
$ref_1 = filter_var(trim($allDataInSheet[$i][$ref_1]), FILTER_SANITIZE_STRING);
|
||||
$ref_2 = filter_var(trim($allDataInSheet[$i][$ref_2]), FILTER_SANITIZE_EMAIL);
|
||||
$remarks = filter_var(trim($allDataInSheet[$i][$remarks]), FILTER_SANITIZE_STRING);
|
||||
$amount = filter_var(trim($allDataInSheet[$i][$amount]), FILTER_SANITIZE_EMAIL);
|
||||
$donation_ref = filter_var(trim($allDataInSheet[$i][$donation_ref]), FILTER_SANITIZE_STRING);
|
||||
|
||||
$fetchData= array('date' => $date, 'ref_1' => $ref_1, 'ref_2' => $ref_2, 'remarks' => $remarks, 'amount' => $amount, 'donation_ref' => $donation_ref);
|
||||
|
||||
//print_r($fetchData); exit();
|
||||
$model = new Transaction_model();
|
||||
$model->save($fetchData);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
echo '<script>alert("Please import correct file, did not match excel sheet column")</script>';
|
||||
//echo "Please import correct file, did not match excel sheet column";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
echo view('templates/header');
|
||||
echo view('transaction_upload');
|
||||
echo view('templates/footer');
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -9,10 +9,11 @@ class Sendmail extends Controller
|
||||
{
|
||||
return view('form_view');
|
||||
}
|
||||
function Mail_to_donor() {
|
||||
function Mail_to_donor()
|
||||
{
|
||||
|
||||
$to = 'gowthamceline46@gmail.com';
|
||||
$subject = 'Test';
|
||||
$to = 'gowthamceline46@gmail.com';
|
||||
$subject = "hai";
|
||||
$message = 'CI4';
|
||||
|
||||
$email = \Config\Services::email();
|
||||
|
||||
@ -13,15 +13,31 @@ class Donation_cause extends Model
|
||||
function all_donation_cause()
|
||||
{
|
||||
$builder = $this->db->table('donation_cause');
|
||||
$builder->where('status',1);
|
||||
// $builder->where('status','Active');
|
||||
$result = $builder->get();
|
||||
$output = $result->getResultArray();
|
||||
return $output;
|
||||
}
|
||||
function inactive_donation_cause()
|
||||
{
|
||||
$builder = $this->db->table('donation_cause');
|
||||
$builder->where('status','Inactive');
|
||||
$result = $builder->get();
|
||||
$output = $result->getResultArray();
|
||||
return $output;
|
||||
}
|
||||
// function inactive_cause($id)
|
||||
// {
|
||||
// $builder=$this->db->query("UPDATE donation_cause SET status = Inactive WHERE id = ".$id);
|
||||
// }
|
||||
// function active_cause($id)
|
||||
// {
|
||||
// $builder=$this->db->query("UPDATE donation_cause SET status ='Active' WHERE id = ".$id);
|
||||
// }
|
||||
function fetch_cause_name()
|
||||
{
|
||||
$builder = $this->db->table('donation_cause');
|
||||
$builder->where('status',1);
|
||||
$builder->where('status','Active');
|
||||
$query = $builder->get();
|
||||
$output = '<option value="">Select Cause Name</option>';
|
||||
foreach($query->getResult() as $row)
|
||||
|
||||
@ -7,7 +7,7 @@ class Donor_model extends Model
|
||||
protected $table = 'user_management';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $allowedFields = ['name', 'phone','email','pan', 'address','country','state','city','pin_code','date_of_birth','gender', 'org_name','gstin','foreign_key', 'password','updated_at'];
|
||||
protected $allowedFields = ['name', 'phone','email','pan', 'address','country','state','city','pin_code','date_of_birth','gender', 'org_name','gstin','foreign_key', 'password','signature','updated_at'];
|
||||
|
||||
protected $beforeInsert = ['beforeInsert'];
|
||||
protected $beforeUpdate = ['beforeUpdate'];
|
||||
|
||||
@ -31,6 +31,19 @@ function fetch_donor_id()
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
function edit_donor_id()
|
||||
{
|
||||
|
||||
$builder = $this->db->table('donar_management');
|
||||
$query = $builder->get();
|
||||
//print_r($query);die();
|
||||
$output = '<option value="">hai</option>';
|
||||
foreach($query->getResult() as $row)
|
||||
{
|
||||
$output .= '<option value="'.$row->id.'">'.$row->name.'</option>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
// protected $returnType = 'array';
|
||||
// protected $useSoftDeletes = true;
|
||||
|
||||
@ -6,7 +6,7 @@ class Receipt_model extends Model
|
||||
{
|
||||
protected $table = 'receipts';
|
||||
protected $primaryKey = 'receipt_id';
|
||||
protected $allowedFields = ['receipt_no', 'date','donor_id','amount', 'mode_of_receipt','receipt_details','cause_name', 'remarks'];
|
||||
protected $allowedFields = ['date','donor_id','donor_name','amount', 'mode_of_receipt','receipt_details','cause_id','cause_name', 'remarks'];
|
||||
|
||||
|
||||
|
||||
|
||||
@ -49,39 +49,4 @@
|
||||
</div>
|
||||
</div></div>
|
||||
</br></br>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Donation Cause List</h2>
|
||||
</div></div></br>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<table class="table" id="cause_table">
|
||||
<tr>
|
||||
|
||||
<th> Cause Name</th>
|
||||
<th> From Date</th>
|
||||
<th> To Date</th>
|
||||
<th> Action</th>
|
||||
|
||||
</tr>
|
||||
<?php foreach ($donationcause as $row)
|
||||
{ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['cause_name'];?></td>
|
||||
<td><?php echo $row['from_date'];?></td>
|
||||
<td><?php echo $row['to_date'];?></td>
|
||||
|
||||
<td><a href="<?= base_url() ?>/Dashboard/edit_donation_cause/<?php echo $row['id'];?>">Edit</a></td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
42
app/Views/all_donation_cause.php
Normal file
@ -0,0 +1,42 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Donation Cause List</h2>
|
||||
</div></div></br>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<table class="table" id="cause_table">
|
||||
<tr>
|
||||
|
||||
<th> Cause Name</th>
|
||||
<th> From Date</th>
|
||||
<th> To Date</th>
|
||||
<th> status</th>
|
||||
<th> Action</th>
|
||||
|
||||
</tr>
|
||||
<?php foreach ($donationcause as $row)
|
||||
{ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['cause_name'];?></td>
|
||||
<td><?php echo $row['from_date'];?></td>
|
||||
<td><?php echo $row['to_date'];?></td>
|
||||
<td><?php echo $row['status'];?></td>
|
||||
<?php if($row['status'] == 'Active'){?>
|
||||
<td><a href="<?= base_url() ?>/Dashboard/inactive_cause/<?php echo $row['id'];?>">Deactive</a>
|
||||
<?php } else { ?>
|
||||
<td><a href="<?= base_url() ?>/Dashboard/active_cause/<?php echo $row['id'];?>">Activate</a>
|
||||
<?php } ?>
|
||||
<a href="<?= base_url() ?>/Dashboard/edit_donation_cause/<?php echo $row['id'];?>">Edit</a></td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -7,6 +7,7 @@
|
||||
<h4>Mobile:<?= $userdata->phone;?></h4></br>
|
||||
<h4>Email :<?= $userdata->email;?></h4></br>
|
||||
<h4>Organization Name :<?= $userdata->org_name;?></h4></br>
|
||||
<a href="<?= base_url()?>/Sendmail/Mail_to_donor">send mail</a>
|
||||
<h4></h4></br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -6,62 +6,89 @@
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Donation Date upload</h2>
|
||||
<h2>Donation Data upload</h2>
|
||||
</div></div></br>
|
||||
<div class="form">
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="<?= base_url()."/donation_data"; ?>" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="AMOUNT" name="amount" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select name="cause_name" id="cause_name" class="form-control ">
|
||||
<option value="">Select Cause Name</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<select class="form-control" name="mode_of_payment" required>
|
||||
<!----<form class="" method="post" action="<?= base_url()."/donation_data"; ?>" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Date</h4></label>
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Donation cause</h4></label>
|
||||
<select name="cause_name" id="cause_name" class="form-control ">
|
||||
<option value="">Select Cause Name</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Amount</h4></label>
|
||||
<input type="text" class="form-control" name="amount" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Payment Mode</h4></label>
|
||||
<select class="form-control" name="mode_of_payment" required>
|
||||
<option value="">Mode of Payment</option>
|
||||
<option value="Case">Case</option>
|
||||
<option value="Case">Cash</option>
|
||||
<option value="Check">Check</option>
|
||||
<option value="Card">Card</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Payment Mode Referal" name="ref_1" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Donation Referal" name="donation_ref" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Payment Mode Referance</h4></label>
|
||||
<input type="text" class="form-control" name="ref_1" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Donation referance</h4></label>
|
||||
<input type="text" class="form-control" name="donation_ref" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div></div>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>---->
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<form class="" method="post" action="<?= base_url()."/donation_data_excel"; ?>" enctype="multipart/form-data" >
|
||||
<input type="file" name="upload_file" value="" >
|
||||
<button type="submit">SUBMIT</button>
|
||||
</form></div></div>
|
||||
<?php if(isset($validation)): ?>
|
||||
<center>
|
||||
<div class="alert alert-danger" role="aler">
|
||||
<?= $validation->listErrors() ?>
|
||||
</div>
|
||||
</center>
|
||||
<?php endif; ?>
|
||||
@ -12,43 +12,63 @@
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value="<?= $post['date'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="AMOUNT" name="amount" value="<?= $post['amount'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="CAUSE NAME" name="cause_name" value="<?= $post['cause_name'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="PAYMENT MODE" name="mode_of_payment" value="<?= $post['mode_of_payment'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="REF 1" name="ref_1" value="<?= $post['ref_1'] ?>"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Donation Referal" name="donation_ref" value="<?= $post['donation_ref'] ?>"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Date</h4></label>
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value="<?= $post['date'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Donation cause</h4></label>
|
||||
<select name="cause_name" id="cause_name" class="form-control ">
|
||||
<option value="<?= $post['cause_name'] ?>"><?= $post['cause_name'] ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Amount</h4></label>
|
||||
<input type="text" class="form-control" name="amount" value="<?= $post['amount'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Payment Mode</h4></label>
|
||||
<select class="form-control" name="mode_of_payment" required>
|
||||
<option value="<?= $post['mode_of_payment'] ?>"><?= $post['mode_of_payment'] ?></option>
|
||||
<option value="Case">Cash</option>
|
||||
<option value="Check">Check</option>
|
||||
<option value="Card">Card</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Payment Mode Referance</h4></label>
|
||||
<input type="text" class="form-control" name="ref_1" value="<?= $post['ref_1'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Donation referance</h4></label>
|
||||
<input type="text" class="form-control" name="donation_ref" value="<?= $post['donation_ref'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
<h3> REGISTER </h3>
|
||||
|
||||
<form class="" method="post" action="<?= base_url()."/donor_register"; ?>" >
|
||||
<form class="" method="post" action="<?= base_url()."/donor_register"; ?>" enctype="multipart/form-data" >
|
||||
<div class="">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@ -135,6 +135,7 @@
|
||||
|
||||
</br>
|
||||
|
||||
|
||||
<?php if(isset($validation)): ?>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-danger" role="aler">
|
||||
|
||||
@ -1,3 +1,14 @@
|
||||
<style>
|
||||
table {
|
||||
|
||||
width: 80% ;
|
||||
}
|
||||
td {
|
||||
width: 25% ;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
@ -9,11 +20,11 @@
|
||||
<div class="col-md-2">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<table class="table">
|
||||
<table class="table table-bordered" id="dataTable" cellspacing="0">
|
||||
<tr>
|
||||
<th> Name</th>
|
||||
<th> Phone</th>
|
||||
<th> Email</th>
|
||||
<th > Email</th>
|
||||
<th> Pan </th>
|
||||
<th> Address</th>
|
||||
<th> DOB</th>
|
||||
@ -28,7 +39,7 @@
|
||||
<tr>
|
||||
<td><?php echo $row['name'];?></td>
|
||||
<td><?php echo $row['phone'];?></td>
|
||||
<td><?php echo $row['email'];?></td>
|
||||
<td ><?php echo $row['email'];?></td>
|
||||
<td><?php echo $row['pan'];?></td>
|
||||
<td><?php echo $row['address'];?></td>
|
||||
<td><?php echo $row['date_of_birth'];?></td>
|
||||
|
||||
@ -1,187 +1,135 @@
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>A simple, clean, and responsive HTML invoice template</title>
|
||||
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
table, td, th {
|
||||
border: px solid black;
|
||||
table{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
height: 70px;
|
||||
}
|
||||
.donation {
|
||||
|
||||
|
||||
.donation {
|
||||
font-size: 30px;
|
||||
}
|
||||
.date{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 20%;
|
||||
}
|
||||
.receiptno{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 12%;
|
||||
}
|
||||
.donatedby{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 75%;
|
||||
}
|
||||
.address{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 72%;
|
||||
}
|
||||
.city{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 31%;
|
||||
}
|
||||
.state{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 26%;
|
||||
}
|
||||
.pincode{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 13%;
|
||||
}
|
||||
.amt{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 50%;
|
||||
}
|
||||
.amtinword{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 71%;
|
||||
}
|
||||
.cause{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 58%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<table class="table">
|
||||
<tr class="heading">
|
||||
|
||||
|
||||
<tr>
|
||||
<td >
|
||||
<p class="donation">DONATION RECEIPT</p>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
Receipt No #: <?= $receipt['receipt_id'] ?><br>
|
||||
Date :<?= $receipt['date'] ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
<tr class="heading">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<?= ucfirst($admindata['org_name']); ?><br>
|
||||
<?= $admindata['address'] ?>,<?= $admindata['city'] ?>,<br>
|
||||
<?= $admindata['state'] ?>-<?= $admindata['pin_code'] ?>.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Email :<?= $admindata['email'] ?><br>
|
||||
Phone :<?= $admindata['phone'] ?>.<br>
|
||||
|
||||
</td>
|
||||
</tr></tr>
|
||||
|
||||
<tr class="heading">
|
||||
<td>
|
||||
Donor
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $donordata['name'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="details">
|
||||
<td>
|
||||
Address
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $donordata['address'] ?>,<?= $donordata['city'] ?>,<?= $donordata['state'] ?>,<?= $donordata['country'] ?>-<?= $donordata['pin_code'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="heading">
|
||||
<td>
|
||||
Donation Cause
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $causedata['cause_name']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="item">
|
||||
<td>
|
||||
Donation Cause Validity
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $causedata['from_date']; ?>-to-<?= $causedata['to_date']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="heading">
|
||||
<td>
|
||||
Amount
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $receipt['amount'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="item">
|
||||
<td>
|
||||
Amount in Words
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<!-- call the function here -->
|
||||
|
||||
<div class="invoice-box">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
</br>
|
||||
<center> <img src="<?=base_url()?>/public/assets/logo.png" alt="Girl in a jacket" width="100" height="100"></center> </br>
|
||||
<center> <h3><?= $admindata['org_name'] ?></h3></center>
|
||||
<center> <?= $admindata['address'] ?>,<?= $admindata['city'] ?>,</center>
|
||||
<center> <?= $admindata['state'] ?>-<?= $admindata['pin_code'] ?>.</center>
|
||||
<center class="mailfont"> Email :<?= $admindata['email'] ?></center>
|
||||
<center class="mailfont"> GSTIN :<?= $admindata['gstin'] ?></center>
|
||||
</td>
|
||||
|
||||
<td class="tabletd">
|
||||
<center> <h3>Donation Receipt</h3></center></br>
|
||||
Date : <input type="text" class="date" value="<?= $receipt['date'] ?>" readonly>
|
||||
|
||||
|
||||
Receipt No : <input type="text" class="receiptno" value=" <?= $receipt['receipt_id'] ?>" readonly> </br></br>
|
||||
Donated by : <input type="text" class="donatedby" value=" <?= $donordata['name'] ?>" readonly></br>
|
||||
Street Address : <input type="text" class="address" value=" <?= $donordata['address'] ?>" readonly> </br>
|
||||
City :
|
||||
<input type="text" class="city" value="<?= $donordata['city'] ?>" readonly>
|
||||
State : <input type="text" class="state" value="<?= $donordata['state'] ?>" readonly>
|
||||
Pin : <input type="text" class="pincode" value="<?= $donordata['pin_code'] ?>" readonly></br>
|
||||
Amount Received By Charity :
|
||||
<input type="text" class="amt" value=" <?= $receipt['amount'] ?>" readonly></br>
|
||||
|
||||
Amount in Words :
|
||||
<!-- call the function here -->
|
||||
<?php $amt_words= $receipt['amount'];
|
||||
// nummeric value in variable
|
||||
|
||||
$get_amount= AmountInWords($amt_words);
|
||||
echo $get_amount;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="heading">
|
||||
<td>
|
||||
Payment Mode
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $receipt['mode_of_receipt'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="item">
|
||||
<td>
|
||||
Payment Mode Referal
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?= $receipt['receipt_details'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<!--<tr class="item">
|
||||
<td>
|
||||
Hosting (3 months)
|
||||
</td>
|
||||
|
||||
<td>
|
||||
$75.00
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="item last">
|
||||
<td>
|
||||
Domain name (1 year)
|
||||
</td>
|
||||
|
||||
<td>
|
||||
$10.00
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="total">
|
||||
<td></td>
|
||||
|
||||
<td>
|
||||
Total: $385.00
|
||||
</td>
|
||||
</tr>---->
|
||||
</table>
|
||||
|
||||
// nummeric value in variable
|
||||
$get_amount= numberTowords($amt_words);
|
||||
?><input type="text" class="amtinword" value="<?= $get_amount ?>" readonly> </br>
|
||||
Discription of Donation :
|
||||
<input type="text" class="cause" value="<?= $causedata['cause_name']; ?>" readonly></br></br>
|
||||
Authorized Signature :
|
||||
</br></br>
|
||||
<center class="mailfont">"Thank You For Your Donation"</center>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -223,6 +171,96 @@ function AmountInWords(float $amount)
|
||||
$get_paise = ($amount_after_decimal > 0) ? "And " . ($change_words[$amount_after_decimal / 10] . "
|
||||
" . $change_words[$amount_after_decimal % 10]) . ' Paise' : '';
|
||||
return ($implode_to_Rupees ? $implode_to_Rupees . 'Rupees ' : '') . $get_paise;
|
||||
}?>
|
||||
|
||||
<?php
|
||||
function numberTowords($num)
|
||||
{
|
||||
|
||||
$ones = array(
|
||||
0 =>"ZERO",
|
||||
1 => "ONE",
|
||||
2 => "TWO",
|
||||
3 => "THREE",
|
||||
4 => "FOUR",
|
||||
5 => "FIVE",
|
||||
6 => "SIX",
|
||||
7 => "SEVEN",
|
||||
8 => "EIGHT",
|
||||
9 => "NINE",
|
||||
10 => "TEN",
|
||||
11 => "ELEVEN",
|
||||
12 => "TWELVE",
|
||||
13 => "THIRTEEN",
|
||||
14 => "FOURTEEN",
|
||||
15 => "FIFTEEN",
|
||||
16 => "SIXTEEN",
|
||||
17 => "SEVENTEEN",
|
||||
18 => "EIGHTEEN",
|
||||
19 => "NINETEEN",
|
||||
"014" => "FOURTEEN"
|
||||
);
|
||||
$tens = array(
|
||||
0 => "ZERO",
|
||||
1 => "TEN",
|
||||
2 => "TWENTY",
|
||||
3 => "THIRTY",
|
||||
4 => "FORTY",
|
||||
5 => "FIFTY",
|
||||
6 => "SIXTY",
|
||||
7 => "SEVENTY",
|
||||
8 => "EIGHTY",
|
||||
9 => "NINETY"
|
||||
);
|
||||
$hundreds = array(
|
||||
"HUNDRED",
|
||||
"THOUSAND",
|
||||
"MILLION",
|
||||
"BILLION",
|
||||
"TRILLION",
|
||||
"QUARDRILLION"
|
||||
); /*limit t quadrillion */
|
||||
$num = number_format($num,2,".",",");
|
||||
$num_arr = explode(".",$num);
|
||||
$wholenum = $num_arr[0];
|
||||
$decnum = $num_arr[1];
|
||||
$whole_arr = array_reverse(explode(",",$wholenum));
|
||||
krsort($whole_arr,1);
|
||||
$rettxt = "";
|
||||
foreach($whole_arr as $key => $i){
|
||||
|
||||
while(substr($i,0,1)=="0")
|
||||
$i=substr($i,1,5);
|
||||
if($i < 20){
|
||||
/* echo "getting:".$i; */
|
||||
$rettxt .= $ones[$i];
|
||||
}elseif($i < 100){
|
||||
if(substr($i,0,1)!="0") $rettxt .= $tens[substr($i,0,1)];
|
||||
if(substr($i,1,1)!="0") $rettxt .= " ".$ones[substr($i,1,1)];
|
||||
}else{
|
||||
if(substr($i,0,1)!="0") $rettxt .= $ones[substr($i,0,1)]." ".$hundreds[0];
|
||||
if(substr($i,1,1)!="0")$rettxt .= " ".$tens[substr($i,1,1)];
|
||||
if(substr($i,2,1)!="0")$rettxt .= " ".$ones[substr($i,2,1)];
|
||||
}
|
||||
if($key > 0){
|
||||
$rettxt .= " ".$hundreds[$key]." ";
|
||||
}
|
||||
}
|
||||
if($decnum > 0){
|
||||
$rettxt .= " and ";
|
||||
if($decnum < 20){
|
||||
$rettxt .= $ones[$decnum];
|
||||
}elseif($decnum < 100){
|
||||
$rettxt .= $tens[substr($decnum,0,1)];
|
||||
$rettxt .= " ".$ones[substr($decnum,1,1)];
|
||||
}
|
||||
}
|
||||
return $rettxt;
|
||||
}
|
||||
extract($_POST);
|
||||
if(isset($convert))
|
||||
{
|
||||
echo "<p align=''>".numberTowords("$num")."</p>";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@ -11,18 +11,22 @@
|
||||
<div class="form">
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="" >
|
||||
<form class="" method="post" action="<?= base_url()."/update_receipt"; ?>" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<input type="hidden" class="form-control" name="receipt_id" value="<?= $post['receipt_id'] ?>"/>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="RECEIPT NUMBER" name="receipt_no" value="<?= $post['receipt_no'] ?>"/>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<select name="donor_id" id="donor_id" class="form-control ">
|
||||
<option value="<?= $post['donor_id'] ?>">Select Donor Id</option>
|
||||
<select name="donor_id" id="" class="form-control ">
|
||||
<option value="<?= $post['donor_id'] ?>"><?= $post['donor_name'] ?></option>
|
||||
<?php foreach($donor as $value){ ?>
|
||||
<option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -42,16 +46,19 @@
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select class="form-control" name="mode_of_receipt" required>
|
||||
<option value="<?= $post['mode_of_receipt'] ?>">MODE OF RECEIPT</option>
|
||||
<option value="Case">Case</option>
|
||||
<option value="<?= $post['mode_of_receipt'] ?>"><?= $post['mode_of_receipt'] ?></option>
|
||||
<option value="Cash">Cash</option>
|
||||
<option value="Check">Check</option>
|
||||
<option value="Card">Card</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<select name="cause_name" id="cause_name" class="form-control ">
|
||||
<option value="<?= $post['cause_name'] ?>">Select Cause Name</option>
|
||||
<select name="cause_id" id="" class="form-control ">
|
||||
<option value="<?= $post['cause_id'] ?>"><?= $post['cause_name'] ?></option>
|
||||
<?php foreach($cause as $val){ ?>
|
||||
<option value="<?php echo $val['id']; ?>"><?php echo $val['cause_name']; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -12,57 +12,75 @@
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="<?= base_url()."/receipt"; ?>" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="RECEIPT NUMBER" name="receipt_no" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<select name="donor_id" id="donor_id" class="form-control ">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Date</h4></label>
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Select Donor</h4></label>
|
||||
<select name="donor_id" id="donor_id" class="form-control ">
|
||||
<option value="">Select Donor Id</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="AMOUNT" name="amount" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select class="form-control" name="mode_of_receipt" required>
|
||||
<option value="">MODE OF RECEIPT</option>
|
||||
<option value="Case">Case</option>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Amount</h4></label>
|
||||
<input type="text" class="form-control" name="amount" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Receipt Mode</h4></label>
|
||||
<select class="form-control" name="mode_of_receipt" required>
|
||||
<option value="">Mode of Receipt</option>
|
||||
<option value="Cash">Cash</option>
|
||||
<option value="Check">Check</option>
|
||||
<option value="Card">Card</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<select name="cause_name" id="cause_name" class="form-control ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Receipt Details</h4></label>
|
||||
<input type="text" class="form-control" name="receipt_details" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Select Cause</h4></label>
|
||||
<select name="cause_id" id="cause_name" class="form-control ">
|
||||
<option value="">Select Cause Name</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="RECEIPT DETAILS" name="receipt_details" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="REMARKS" name="remarks" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Remarks</h4></label>
|
||||
<input type="text" class="form-control" name="remarks" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<tr>
|
||||
<th> Receipt No</th>
|
||||
<th> Date</th>
|
||||
<th> Donor Id</th>
|
||||
<th> Donor </th>
|
||||
<th> Amount</th>
|
||||
<th> Mode</th>
|
||||
<th> Details</th>
|
||||
@ -25,9 +25,9 @@
|
||||
<?php foreach ($receiptdata as $row)
|
||||
{ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['receipt_no'];?></td>
|
||||
<td><?php echo $row['receipt_id'];?></td>
|
||||
<td><?php echo $row['date'];?></td>
|
||||
<td><?php echo $row['donor_id'];?></td>
|
||||
<td><?php echo $row['donor_name'];?></td>
|
||||
<td><?php echo $row['amount'];?></td>
|
||||
<td><?php echo $row['mode_of_receipt'];?></td>
|
||||
<td><?php echo $row['receipt_details'];?></td>
|
||||
@ -37,7 +37,7 @@
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<table>
|
||||
<a href="<?= base_url() ?>/Sendmail/Mail_to_donor">Edit</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
<h3> REGISTER </h3>
|
||||
|
||||
<form class="" method="post" action="<?= base_url()."/register"; ?>" >
|
||||
<form class="" method="post" action="<?= base_url()."/register"; ?>" enctype="multipart/form-data">
|
||||
<div class="">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
@ -95,18 +95,24 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Org Name</h4></label>
|
||||
<input type="text" class="form-control" name="org_name" id="org_name" value="<?= set_value('org_name') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>GSTIN</h4></label>
|
||||
<input type="text" class="form-control" name="gstin" id="gstin" value="<?= set_value('gstin') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Upload Signature</h4></label>
|
||||
<input type="file" name="userfile" class="form-control" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
217
app/Views/sample.php
Normal file
@ -0,0 +1,217 @@
|
||||
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<!------ Include the above in your HEAD tag ---------->
|
||||
|
||||
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
|
||||
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
|
||||
<!------ Include the above in your HEAD tag ---------->
|
||||
<style>
|
||||
.text-danger strong {
|
||||
color: #9f181c;
|
||||
}
|
||||
.receipt-main {
|
||||
background: #ffffff none repeat scroll 0 0;
|
||||
border-bottom: 12px solid #333333;
|
||||
border-top: 12px solid #9f181c;
|
||||
margin-top: 50px;
|
||||
margin-bottom: 50px;
|
||||
padding: 40px 30px !important;
|
||||
position: relative;
|
||||
box-shadow: 0 1px 21px #acacac;
|
||||
color: #333333;
|
||||
font-family: open sans;
|
||||
}
|
||||
.receipt-main p {
|
||||
color: #333333;
|
||||
font-family: open sans;
|
||||
line-height: 1.42857;
|
||||
}
|
||||
.receipt-footer h1 {
|
||||
font-size: 15px;
|
||||
font-weight: 400 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
.receipt-main::after {
|
||||
background: #414143 none repeat scroll 0 0;
|
||||
content: "";
|
||||
height: 5px;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: -13px;
|
||||
}
|
||||
.receipt-main thead {
|
||||
background: #414143 none repeat scroll 0 0;
|
||||
}
|
||||
.receipt-main thead th {
|
||||
color:#fff;
|
||||
}
|
||||
.receipt-right h5 {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin: 0 0 7px 0;
|
||||
}
|
||||
.receipt-right p {
|
||||
font-size: 12px;
|
||||
margin: 0px;
|
||||
}
|
||||
.receipt-right p i {
|
||||
text-align: center;
|
||||
width: 18px;
|
||||
}
|
||||
.receipt-main td {
|
||||
padding: 9px 20px !important;
|
||||
}
|
||||
.receipt-main th {
|
||||
padding: 13px 20px !important;
|
||||
}
|
||||
.receipt-main td {
|
||||
font-size: 13px;
|
||||
font-weight: initial !important;
|
||||
}
|
||||
.receipt-main td p:last-child {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.receipt-main td h2 {
|
||||
font-size: 20px;
|
||||
font-weight: 900;
|
||||
margin: 0;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.receipt-header-mid .receipt-left h1 {
|
||||
font-weight: 100;
|
||||
margin: 34px 0 0;
|
||||
text-align: right;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.receipt-header-mid {
|
||||
margin: 24px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#container {
|
||||
background-color: #dcdcdc;
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
<div class="receipt-main col-xs-10 col-sm-10 col-md-6 col-xs-offset-1 col-sm-offset-1 col-md-offset-3">
|
||||
<div class="row">
|
||||
<div class="receipt-header">
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="receipt-left">
|
||||
<img class="img-responsive" alt="iamgurdeeposahan" src="https://bootsnipp.com/img/avatars/dd4fd3c4041773aa43677000341478ae587cbfad.jpg" style="width: 71px; border-radius: 43px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6 text-right">
|
||||
<div class="receipt-right">
|
||||
<h5>TechiTouch.</h5>
|
||||
<p>+91 12345-6789 <i class="fa fa-phone"></i></p>
|
||||
<p>info@gmail.com <i class="fa fa-envelope-o"></i></p>
|
||||
<p>Australia <i class="fa fa-location-arrow"></i></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="receipt-header receipt-header-mid">
|
||||
<div class="col-xs-8 col-sm-8 col-md-8 text-left">
|
||||
<div class="receipt-right">
|
||||
<h5>Gurdeep Singh <small> | Lucky Number : 156</small></h5>
|
||||
<p><b>Mobile :</b> +91 12345-6789</p>
|
||||
<p><b>Email :</b> info@gmail.com</p>
|
||||
<p><b>Address :</b> Australia</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4">
|
||||
<div class="receipt-left">
|
||||
<h1>Receipt</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-9">Payment for August 2016</td>
|
||||
<td class="col-md-3"><i class="fa fa-inr"></i> 15,000/-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-9">Payment for June 2016</td>
|
||||
<td class="col-md-3"><i class="fa fa-inr"></i> 6,00/-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-9">Payment for May 2016</td>
|
||||
<td class="col-md-3"><i class="fa fa-inr"></i> 35,00/-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right">
|
||||
<p>
|
||||
<strong>Total Amount: </strong>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Late Fees: </strong>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Payable Amount: </strong>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Balance Due: </strong>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<strong><i class="fa fa-inr"></i> 65,500/-</strong>
|
||||
</p>
|
||||
<p>
|
||||
<strong><i class="fa fa-inr"></i> 500/-</strong>
|
||||
</p>
|
||||
<p>
|
||||
<strong><i class="fa fa-inr"></i> 1300/-</strong>
|
||||
</p>
|
||||
<p>
|
||||
<strong><i class="fa fa-inr"></i> 9500/-</strong>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td class="text-right"><h2><strong>Total: </strong></h2></td>
|
||||
<td class="text-left text-danger"><h2><strong><i class="fa fa-inr"></i> 31.566/-</strong></h2></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="receipt-header receipt-header-mid receipt-footer">
|
||||
<div class="col-xs-8 col-sm-8 col-md-8 text-left">
|
||||
<div class="receipt-right">
|
||||
<p><b>Date :</b> 15 Aug 2016</p>
|
||||
<h5 style="color: rgb(140, 140, 140);">Thank you for your business!</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4">
|
||||
<div class="receipt-left">
|
||||
<h1>Signature</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -2,6 +2,7 @@
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<style>
|
||||
|
||||
input[type="date"]::-webkit-datetime-edit, input[type="date"]::-webkit-inner-spin-button, input[type="date"]::-webkit-clear-button
|
||||
{
|
||||
color: #fff;
|
||||
@ -32,6 +33,9 @@ input[type="date"]::-webkit-datetime-edit-day-field{
|
||||
left: 4px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.my_navbar{
|
||||
height : 50px;
|
||||
}
|
||||
@ -404,6 +408,8 @@ $.ajax({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
url:"<?= base_url(); ?>/fetch_cause_name",
|
||||
method:"GET",
|
||||
@ -543,7 +549,8 @@ $(document).ready(function(){
|
||||
<a href="#"><i class="fa fa-pencil-square-o fa-lg"></i>Donation Cause <span class="arrow"></span></a>
|
||||
</li>
|
||||
<ul class="sub-menu collapse" id="donation_cause">
|
||||
<li><a href="<?= base_url() ?>/dashboard/donation_cause">Add/Edit Donation Cause</a></li>
|
||||
<li><a href="<?= base_url() ?>/dashboard/donation_cause">Add Donation Cause</a></li>
|
||||
<li><a href="<?= base_url() ?>/dashboard/all_donation_cause">All Donation Cause</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
@ -12,43 +12,50 @@
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value="<?= $post['date'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Referal 2" name="ref_2" value="<?= $post['ref_2'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Referal 1" name="ref_1" value="<?= $post['ref_1'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Remarks" name="remarks" value="<?= $post['remarks'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Amount" name="amount" value="<?= $post['amount'] ?>"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Donation Referal" name="donation_ref" value="<?= $post['donation_ref'] ?>"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Date</h4></label>
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value="<?= $post['date'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Transaction referance</h4></label>
|
||||
<input type="text" class="form-control" name="ref_1" value="<?= $post['ref_1'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Amount</h4></label>
|
||||
<input type="text" class="form-control" name="amount" value="<?= $post['amount'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Remarks</h4></label>
|
||||
<input type="text" class="form-control" name="remarks" value="<?= $post['remarks'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Donation referance</h4></label>
|
||||
<input type="text" class="form-control" name="donation_ref" value="<?= $post['donation_ref'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th> Transaction Date</th>
|
||||
<th> Reference 1</th>
|
||||
<th> Reference 1</th>
|
||||
<th> Reference</th>
|
||||
|
||||
<th> Remarks</th>
|
||||
<th> Amount</th>
|
||||
<th> Donation Ref</th>
|
||||
@ -25,7 +25,7 @@
|
||||
<tr>
|
||||
<td><?php echo $row['date'];?></td>
|
||||
<td><?php echo $row['ref_1'];?></td>
|
||||
<td><?php echo $row['ref_2'];?></td>
|
||||
|
||||
<td><?php echo $row['remarks'];?></td>
|
||||
<td><?php echo $row['amount'];?></td>
|
||||
<td><?php echo $row['donation_ref'];?></td>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
<!----
|
||||
<div class="container">
|
||||
|
||||
<div class="container register-form">
|
||||
@ -13,44 +13,48 @@
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="<?= base_url()."/transaction"; ?>" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value=""/>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Referal 2" name="ref_2" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Referal 1" name="ref_1" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Remarks" name="remarks" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Amount" name="amount" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Donation Referal" name="donation_ref" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Date</h4></label>
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Transaction referance</h4></label>
|
||||
<input type="text" class="form-control" name="ref_1" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Amount</h4></label>
|
||||
<input type="text" class="form-control" name="amount" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Remarks</h4></label>
|
||||
<input type="text" class="form-control" name="remarks" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Donation referance</h4></label>
|
||||
<input type="text" class="form-control" name="donation_ref" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
@ -59,7 +63,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>---->
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Transaction data upload</h2>
|
||||
</div></div></br>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<form class="" method="post" action="<?= base_url()."/transaction_data_excel"; ?>" enctype="multipart/form-data" >
|
||||
<input type="file" name="transacton_upload" value="" >
|
||||
<button type="submit">SUBMIT</button>
|
||||
</form></div></div>
|
||||
<?php if(isset($validation)): ?>
|
||||
<center>
|
||||
<div class="alert alert-danger" role="aler">
|
||||
<?= $validation->listErrors() ?>
|
||||
</div>
|
||||
</center>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<center><h2>RECEIPT</h2></center>
|
||||
<div class="hover-btn">
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-2"><a href="<?= base_url() ?>/Dashboard/edit_receipt/<?= $receipt['receipt_id'] ?>">
|
||||
<button class="btn btn-one">Edit Receipt</button></a></div>
|
||||
<div class="col-md-2"><a href="<?= base_url() ?>/PdfController/download_receipt/<?= $receipt['receipt_id'] ?>">
|
||||
@ -12,11 +12,7 @@
|
||||
<button class="btn btn-four">Exit</button></a></div>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
@ -53,6 +49,9 @@
|
||||
|
||||
.btn-four{
|
||||
background: #58cadb;
|
||||
}
|
||||
.mailfont{
|
||||
font-size: 15px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
@ -69,244 +68,116 @@
|
||||
margin-left: 30%;
|
||||
}
|
||||
|
||||
.invoice-box table {
|
||||
width: 100%;
|
||||
line-height: inherit;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.invoice-box table td {
|
||||
padding: 5px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.invoice-box table tr td:nth-child(2) {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.invoice-box table tr.top table td {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.invoice-box table tr.top table td.title {
|
||||
font-size: 45px;
|
||||
line-height: 45px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.invoice-box table tr.information table td {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.invoice-box table tr.heading td {
|
||||
background: #eee;
|
||||
border-bottom: 1px solid #ddd;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.invoice-box table tr.details td {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.invoice-box table tr.item td{
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.invoice-box table tr.item.last td {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.invoice-box table tr.total td:nth-child(2) {
|
||||
border-top: 2px solid #eee;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 600px) {
|
||||
.invoice-box table tr.top table td {
|
||||
width: 100%;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.invoice-box table tr.information table td {
|
||||
width: 100%;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
/** RTL **/
|
||||
.rtl {
|
||||
direction: rtl;
|
||||
font-family: Tahoma, 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
.rtl table {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.rtl table tr td:nth-child(2) {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.donation {
|
||||
font-size: 30px;
|
||||
}
|
||||
.date{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 20%;
|
||||
}
|
||||
.receiptno{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 12%;
|
||||
}
|
||||
.donatedby{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 75%;
|
||||
}
|
||||
.address{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 72%;
|
||||
}
|
||||
.city{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 31%;
|
||||
}
|
||||
.state{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 26%;
|
||||
}
|
||||
.pincode{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 13%;
|
||||
}
|
||||
.amt{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 50%;
|
||||
}
|
||||
.amtinword{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 71%;
|
||||
}
|
||||
.cause{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #000000;
|
||||
width: 58%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="invoice-box">
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr class="top">
|
||||
<td colspan="2">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="title">
|
||||
<p class="donation">DONATION RECEIPT</p>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
Receipt No #: <?= $receipt['receipt_id'] ?><br>
|
||||
Date :<?= $receipt['date'] ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="information">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<?= ucfirst($admindata['org_name']); ?><br>
|
||||
<?= $admindata['address'] ?>,<?= $admindata['city'] ?>,<br>
|
||||
<?= $admindata['state'] ?>-<?= $admindata['pin_code'] ?>.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Email :<?= $admindata['email'] ?><br>
|
||||
Phone :<?= $admindata['phone'] ?>.<br>
|
||||
|
||||
</td>
|
||||
</tr></tr>
|
||||
|
||||
<tr class="heading">
|
||||
<td>
|
||||
Donor
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $donordata['name'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="details">
|
||||
<td>
|
||||
Address
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $donordata['address'] ?>,<?= $donordata['city'] ?>,<?= $donordata['state'] ?>,<?= $donordata['country'] ?>-<?= $donordata['pin_code'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="heading">
|
||||
<td>
|
||||
Donation Cause
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $causedata['cause_name']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="item">
|
||||
<td>
|
||||
Donation Cause Validity
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $causedata['from_date']; ?>-to-<?= $causedata['to_date']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="heading">
|
||||
<td>
|
||||
Amount
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $receipt['amount'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="item">
|
||||
<td>
|
||||
Amount in Words
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<!-- call the function here -->
|
||||
|
||||
<div class="invoice-box">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</br>
|
||||
<center> <img src="<?=base_url()?>/public/assets/logo.png" alt="Girl in a jacket" width="100" height="100"></center> </br>
|
||||
<center> <h3><?= $admindata['org_name'] ?></h3></center>
|
||||
<center> <?= $admindata['address'] ?>,<?= $admindata['city'] ?>,</center>
|
||||
<center> <?= $admindata['state'] ?>-<?= $admindata['pin_code'] ?>.</center>
|
||||
<center class="mailfont"> Email :<?= $admindata['email'] ?></center>
|
||||
<center class="mailfont"> GSTIN :<?= $admindata['gstin'] ?></center>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<center> <h3>Donation Receipt</h3></center></br>
|
||||
Date : <input type="text" class="date" value="<?= $receipt['date'] ?>" readonly>
|
||||
|
||||
|
||||
Receipt No : <input type="text" class="receiptno" value=" <?= $receipt['receipt_id'] ?>" readonly> </br></br>
|
||||
Donated by : <input type="text" class="donatedby" value=" <?= $donordata['name'] ?>" readonly></br>
|
||||
Street Address : <input type="text" class="address" value=" <?= $donordata['address'] ?>" readonly> </br>
|
||||
City :
|
||||
<input type="text" class="city" value="<?= $donordata['city'] ?>" readonly>
|
||||
State : <input type="text" class="state" value="<?= $donordata['state'] ?>" readonly>
|
||||
Pin : <input type="text" class="pincode" value="<?= $donordata['pin_code'] ?>" readonly></br>
|
||||
Amount Received By Charity :
|
||||
<input type="text" class="amt" value=" <?= $receipt['amount'] ?>" readonly></br>
|
||||
|
||||
Amount in Words :
|
||||
<!-- call the function here -->
|
||||
<?php $amt_words= $receipt['amount'];
|
||||
// nummeric value in variable
|
||||
|
||||
$get_amount= AmountInWords($amt_words);
|
||||
echo $get_amount;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="heading">
|
||||
<td>
|
||||
Payment Mode
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?= $receipt['mode_of_receipt'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="item">
|
||||
<td>
|
||||
Payment Mode Referal
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?= $receipt['receipt_details'] ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<!--<tr class="item">
|
||||
<td>
|
||||
Hosting (3 months)
|
||||
</td>
|
||||
|
||||
<td>
|
||||
$75.00
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="item last">
|
||||
<td>
|
||||
Domain name (1 year)
|
||||
</td>
|
||||
|
||||
<td>
|
||||
$10.00
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="total">
|
||||
<td></td>
|
||||
|
||||
<td>
|
||||
Total: $385.00
|
||||
</td>
|
||||
</tr>---->
|
||||
</table>
|
||||
</div>
|
||||
// nummeric value in variable
|
||||
$get_amount= numberTowords($amt_words);
|
||||
?><input type="text" class="amtinword" value="<?= $get_amount ?>" readonly> </br>
|
||||
Discription of Donation :
|
||||
<input type="text" class="cause" value="<?= $causedata['cause_name']; ?>" readonly></br></br>
|
||||
Authorized Signature : <img src="<?=base_url()?>/<?=$admindata['signature']?>.png" alt="Girl in a jacket" width="100" height="20">
|
||||
</br></br>
|
||||
<center class="mailfont">"Thank You For Your Donation"</center>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -348,6 +219,96 @@ function AmountInWords(float $amount)
|
||||
$get_paise = ($amount_after_decimal > 0) ? "And " . ($change_words[$amount_after_decimal / 10] . "
|
||||
" . $change_words[$amount_after_decimal % 10]) . ' Paise' : '';
|
||||
return ($implode_to_Rupees ? $implode_to_Rupees . 'Rupees ' : '') . $get_paise;
|
||||
}?>
|
||||
|
||||
<?php
|
||||
function numberTowords($num)
|
||||
{
|
||||
|
||||
$ones = array(
|
||||
0 =>"ZERO",
|
||||
1 => "ONE",
|
||||
2 => "TWO",
|
||||
3 => "THREE",
|
||||
4 => "FOUR",
|
||||
5 => "FIVE",
|
||||
6 => "SIX",
|
||||
7 => "SEVEN",
|
||||
8 => "EIGHT",
|
||||
9 => "NINE",
|
||||
10 => "TEN",
|
||||
11 => "ELEVEN",
|
||||
12 => "TWELVE",
|
||||
13 => "THIRTEEN",
|
||||
14 => "FOURTEEN",
|
||||
15 => "FIFTEEN",
|
||||
16 => "SIXTEEN",
|
||||
17 => "SEVENTEEN",
|
||||
18 => "EIGHTEEN",
|
||||
19 => "NINETEEN",
|
||||
"014" => "FOURTEEN"
|
||||
);
|
||||
$tens = array(
|
||||
0 => "ZERO",
|
||||
1 => "TEN",
|
||||
2 => "TWENTY",
|
||||
3 => "THIRTY",
|
||||
4 => "FORTY",
|
||||
5 => "FIFTY",
|
||||
6 => "SIXTY",
|
||||
7 => "SEVENTY",
|
||||
8 => "EIGHTY",
|
||||
9 => "NINETY"
|
||||
);
|
||||
$hundreds = array(
|
||||
"HUNDRED",
|
||||
"THOUSAND",
|
||||
"MILLION",
|
||||
"BILLION",
|
||||
"TRILLION",
|
||||
"QUARDRILLION"
|
||||
); /*limit t quadrillion */
|
||||
$num = number_format($num,2,".",",");
|
||||
$num_arr = explode(".",$num);
|
||||
$wholenum = $num_arr[0];
|
||||
$decnum = $num_arr[1];
|
||||
$whole_arr = array_reverse(explode(",",$wholenum));
|
||||
krsort($whole_arr,1);
|
||||
$rettxt = "";
|
||||
foreach($whole_arr as $key => $i){
|
||||
|
||||
while(substr($i,0,1)=="0")
|
||||
$i=substr($i,1,5);
|
||||
if($i < 20){
|
||||
/* echo "getting:".$i; */
|
||||
$rettxt .= $ones[$i];
|
||||
}elseif($i < 100){
|
||||
if(substr($i,0,1)!="0") $rettxt .= $tens[substr($i,0,1)];
|
||||
if(substr($i,1,1)!="0") $rettxt .= " ".$ones[substr($i,1,1)];
|
||||
}else{
|
||||
if(substr($i,0,1)!="0") $rettxt .= $ones[substr($i,0,1)]." ".$hundreds[0];
|
||||
if(substr($i,1,1)!="0")$rettxt .= " ".$tens[substr($i,1,1)];
|
||||
if(substr($i,2,1)!="0")$rettxt .= " ".$ones[substr($i,2,1)];
|
||||
}
|
||||
if($key > 0){
|
||||
$rettxt .= " ".$hundreds[$key]." ";
|
||||
}
|
||||
}
|
||||
if($decnum > 0){
|
||||
$rettxt .= " and ";
|
||||
if($decnum < 20){
|
||||
$rettxt .= $ones[$decnum];
|
||||
}elseif($decnum < 100){
|
||||
$rettxt .= $tens[substr($decnum,0,1)];
|
||||
$rettxt .= " ".$ones[substr($decnum,1,1)];
|
||||
}
|
||||
}
|
||||
return $rettxt;
|
||||
}
|
||||
extract($_POST);
|
||||
if(isset($convert))
|
||||
{
|
||||
echo "<p align=''>".numberTowords("$num")."</p>";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@ -7,7 +7,8 @@
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"codeigniter4/framework": "^4",
|
||||
"dompdf/dompdf": "^0.8.6"
|
||||
"dompdf/dompdf": "^0.8.6",
|
||||
"phpoffice/phpspreadsheet": "^1.15"
|
||||
},
|
||||
"require-dev": {
|
||||
"fzaninotto/faker": "^1.9@dev",
|
||||
|
||||
699
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "2b4574ab618335dcb406d7416cebbdfb",
|
||||
"content-hash": "79e1aa187a9e68d7c58b009b1981db99",
|
||||
"packages": [
|
||||
{
|
||||
"name": "codeigniter4/framework",
|
||||
@ -293,6 +293,310 @@
|
||||
],
|
||||
"time": "2020-09-14T14:23:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "maennchen/zipstream-php",
|
||||
"version": "2.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/maennchen/ZipStream-PHP.git",
|
||||
"reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/c4c5803cc1f93df3d2448478ef79394a5981cc58",
|
||||
"reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"myclabs/php-enum": "^1.5",
|
||||
"php": ">= 7.1",
|
||||
"psr/http-message": "^1.0",
|
||||
"symfony/polyfill-mbstring": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-zip": "*",
|
||||
"guzzlehttp/guzzle": ">= 6.3",
|
||||
"mikey179/vfsstream": "^1.6",
|
||||
"phpunit/phpunit": ">= 7.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"ZipStream\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Paul Duncan",
|
||||
"email": "pabs@pablotron.org"
|
||||
},
|
||||
{
|
||||
"name": "Jonatan Männchen",
|
||||
"email": "jonatan@maennchen.ch"
|
||||
},
|
||||
{
|
||||
"name": "Jesse Donat",
|
||||
"email": "donatj@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "András Kolesár",
|
||||
"email": "kolesar@kolesar.hu"
|
||||
}
|
||||
],
|
||||
"description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
|
||||
"keywords": [
|
||||
"stream",
|
||||
"zip"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
|
||||
"source": "https://github.com/maennchen/ZipStream-PHP/tree/master"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://opencollective.com/zipstream",
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2020-05-30T13:11:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "markbaker/complex",
|
||||
"version": "2.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/MarkBaker/PHPComplex.git",
|
||||
"reference": "9999f1432fae467bc93c53f357105b4c31bb994c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/9999f1432fae467bc93c53f357105b4c31bb994c",
|
||||
"reference": "9999f1432fae467bc93c53f357105b4c31bb994c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
|
||||
"phpcompatibility/php-compatibility": "^9.0",
|
||||
"phpdocumentor/phpdocumentor": "2.*",
|
||||
"phploc/phploc": "^4.0",
|
||||
"phpmd/phpmd": "2.*",
|
||||
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.3",
|
||||
"sebastian/phpcpd": "^4.0",
|
||||
"squizlabs/php_codesniffer": "^3.4"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Complex\\": "classes/src/"
|
||||
},
|
||||
"files": [
|
||||
"classes/src/functions/abs.php",
|
||||
"classes/src/functions/acos.php",
|
||||
"classes/src/functions/acosh.php",
|
||||
"classes/src/functions/acot.php",
|
||||
"classes/src/functions/acoth.php",
|
||||
"classes/src/functions/acsc.php",
|
||||
"classes/src/functions/acsch.php",
|
||||
"classes/src/functions/argument.php",
|
||||
"classes/src/functions/asec.php",
|
||||
"classes/src/functions/asech.php",
|
||||
"classes/src/functions/asin.php",
|
||||
"classes/src/functions/asinh.php",
|
||||
"classes/src/functions/atan.php",
|
||||
"classes/src/functions/atanh.php",
|
||||
"classes/src/functions/conjugate.php",
|
||||
"classes/src/functions/cos.php",
|
||||
"classes/src/functions/cosh.php",
|
||||
"classes/src/functions/cot.php",
|
||||
"classes/src/functions/coth.php",
|
||||
"classes/src/functions/csc.php",
|
||||
"classes/src/functions/csch.php",
|
||||
"classes/src/functions/exp.php",
|
||||
"classes/src/functions/inverse.php",
|
||||
"classes/src/functions/ln.php",
|
||||
"classes/src/functions/log2.php",
|
||||
"classes/src/functions/log10.php",
|
||||
"classes/src/functions/negative.php",
|
||||
"classes/src/functions/pow.php",
|
||||
"classes/src/functions/rho.php",
|
||||
"classes/src/functions/sec.php",
|
||||
"classes/src/functions/sech.php",
|
||||
"classes/src/functions/sin.php",
|
||||
"classes/src/functions/sinh.php",
|
||||
"classes/src/functions/sqrt.php",
|
||||
"classes/src/functions/tan.php",
|
||||
"classes/src/functions/tanh.php",
|
||||
"classes/src/functions/theta.php",
|
||||
"classes/src/operations/add.php",
|
||||
"classes/src/operations/subtract.php",
|
||||
"classes/src/operations/multiply.php",
|
||||
"classes/src/operations/divideby.php",
|
||||
"classes/src/operations/divideinto.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mark Baker",
|
||||
"email": "mark@lange.demon.co.uk"
|
||||
}
|
||||
],
|
||||
"description": "PHP Class for working with complex numbers",
|
||||
"homepage": "https://github.com/MarkBaker/PHPComplex",
|
||||
"keywords": [
|
||||
"complex",
|
||||
"mathematics"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/MarkBaker/PHPComplex/issues",
|
||||
"source": "https://github.com/MarkBaker/PHPComplex/tree/PHP8"
|
||||
},
|
||||
"time": "2020-08-26T10:42:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "markbaker/matrix",
|
||||
"version": "2.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/MarkBaker/PHPMatrix.git",
|
||||
"reference": "9567d9c4c519fbe40de01dbd1e4469dbbb66f46a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/9567d9c4c519fbe40de01dbd1e4469dbbb66f46a",
|
||||
"reference": "9567d9c4c519fbe40de01dbd1e4469dbbb66f46a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
|
||||
"phpcompatibility/php-compatibility": "^9.0",
|
||||
"phpdocumentor/phpdocumentor": "2.*",
|
||||
"phploc/phploc": "^4.0",
|
||||
"phpmd/phpmd": "2.*",
|
||||
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.3",
|
||||
"sebastian/phpcpd": "^4.0",
|
||||
"squizlabs/php_codesniffer": "^3.4"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Matrix\\": "classes/src/"
|
||||
},
|
||||
"files": [
|
||||
"classes/src/functions/adjoint.php",
|
||||
"classes/src/functions/antidiagonal.php",
|
||||
"classes/src/functions/cofactors.php",
|
||||
"classes/src/functions/determinant.php",
|
||||
"classes/src/functions/diagonal.php",
|
||||
"classes/src/functions/identity.php",
|
||||
"classes/src/functions/inverse.php",
|
||||
"classes/src/functions/minors.php",
|
||||
"classes/src/functions/trace.php",
|
||||
"classes/src/functions/transpose.php",
|
||||
"classes/src/operations/add.php",
|
||||
"classes/src/operations/directsum.php",
|
||||
"classes/src/operations/subtract.php",
|
||||
"classes/src/operations/multiply.php",
|
||||
"classes/src/operations/divideby.php",
|
||||
"classes/src/operations/divideinto.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mark Baker",
|
||||
"email": "mark@demon-angel.eu"
|
||||
}
|
||||
],
|
||||
"description": "PHP Class for working with matrices",
|
||||
"homepage": "https://github.com/MarkBaker/PHPMatrix",
|
||||
"keywords": [
|
||||
"mathematics",
|
||||
"matrix",
|
||||
"vector"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/MarkBaker/PHPMatrix/issues",
|
||||
"source": "https://github.com/MarkBaker/PHPMatrix/tree/PHP8"
|
||||
},
|
||||
"time": "2020-08-28T17:11:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/php-enum",
|
||||
"version": "1.7.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/myclabs/php-enum.git",
|
||||
"reference": "d178027d1e679832db9f38248fcc7200647dc2b7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7",
|
||||
"reference": "d178027d1e679832db9f38248fcc7200647dc2b7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7",
|
||||
"squizlabs/php_codesniffer": "1.*",
|
||||
"vimeo/psalm": "^3.8"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"MyCLabs\\Enum\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP Enum contributors",
|
||||
"homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"description": "PHP Enum implementation",
|
||||
"homepage": "http://github.com/myclabs/php-enum",
|
||||
"keywords": [
|
||||
"enum"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/myclabs/php-enum/issues",
|
||||
"source": "https://github.com/myclabs/php-enum/tree/1.7.7"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/mnapoli",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-11-14T18:14:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phenx/php-font-lib",
|
||||
"version": "0.5.2",
|
||||
@ -370,6 +674,266 @@
|
||||
"homepage": "https://github.com/PhenX/php-svg-lib",
|
||||
"time": "2019-09-11T20:02:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoffice/phpspreadsheet",
|
||||
"version": "1.15.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
|
||||
"reference": "a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f",
|
||||
"reference": "a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-ctype": "*",
|
||||
"ext-dom": "*",
|
||||
"ext-fileinfo": "*",
|
||||
"ext-gd": "*",
|
||||
"ext-iconv": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-xml": "*",
|
||||
"ext-xmlreader": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"ext-zip": "*",
|
||||
"ext-zlib": "*",
|
||||
"maennchen/zipstream-php": "^2.1",
|
||||
"markbaker/complex": "^1.5|^2.0",
|
||||
"markbaker/matrix": "^1.2|^2.0",
|
||||
"php": "^7.2|^8.0",
|
||||
"psr/http-client": "^1.0",
|
||||
"psr/http-factory": "^1.0",
|
||||
"psr/simple-cache": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"dompdf/dompdf": "^0.8.5",
|
||||
"friendsofphp/php-cs-fixer": "^2.16",
|
||||
"jpgraph/jpgraph": "^4.0",
|
||||
"mpdf/mpdf": "^8.0",
|
||||
"phpcompatibility/php-compatibility": "^9.3",
|
||||
"phpunit/phpunit": "^8.5|^9.3",
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"tecnickcom/tcpdf": "^6.3"
|
||||
},
|
||||
"suggest": {
|
||||
"dompdf/dompdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)",
|
||||
"jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
|
||||
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
|
||||
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Maarten Balliauw",
|
||||
"homepage": "https://blog.maartenballiauw.be"
|
||||
},
|
||||
{
|
||||
"name": "Mark Baker",
|
||||
"homepage": "https://markbakeruk.net"
|
||||
},
|
||||
{
|
||||
"name": "Franck Lefevre",
|
||||
"homepage": "https://rootslabs.net"
|
||||
},
|
||||
{
|
||||
"name": "Erik Tilt"
|
||||
},
|
||||
{
|
||||
"name": "Adrien Crivelli"
|
||||
}
|
||||
],
|
||||
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
|
||||
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
|
||||
"keywords": [
|
||||
"OpenXML",
|
||||
"excel",
|
||||
"gnumeric",
|
||||
"ods",
|
||||
"php",
|
||||
"spreadsheet",
|
||||
"xls",
|
||||
"xlsx"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
|
||||
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.15.0"
|
||||
},
|
||||
"time": "2020-10-11T13:20:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-client",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-client.git",
|
||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0 || ^8.0",
|
||||
"psr/http-message": "^1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Http\\Client\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for HTTP clients",
|
||||
"homepage": "https://github.com/php-fig/http-client",
|
||||
"keywords": [
|
||||
"http",
|
||||
"http-client",
|
||||
"psr",
|
||||
"psr-18"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-client/tree/master"
|
||||
},
|
||||
"time": "2020-06-29T06:28:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-factory",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-factory.git",
|
||||
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
|
||||
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0.0",
|
||||
"psr/http-message": "^1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Http\\Message\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interfaces for PSR-7 HTTP message factories",
|
||||
"keywords": [
|
||||
"factory",
|
||||
"http",
|
||||
"message",
|
||||
"psr",
|
||||
"psr-17",
|
||||
"psr-7",
|
||||
"request",
|
||||
"response"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-factory/tree/master"
|
||||
},
|
||||
"time": "2019-04-30T12:38:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-message",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-message.git",
|
||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Http\\Message\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for HTTP messages",
|
||||
"homepage": "https://github.com/php-fig/http-message",
|
||||
"keywords": [
|
||||
"http",
|
||||
"http-message",
|
||||
"psr",
|
||||
"psr-7",
|
||||
"request",
|
||||
"response"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-message/tree/master"
|
||||
},
|
||||
"time": "2016-08-06T14:39:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.1.3",
|
||||
@ -417,6 +981,57 @@
|
||||
],
|
||||
"time": "2020-03-23T09:12:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/simple-cache",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/simple-cache.git",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\SimpleCache\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interfaces for simple caching",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching",
|
||||
"psr",
|
||||
"psr-16",
|
||||
"simple-cache"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/simple-cache/tree/master"
|
||||
},
|
||||
"time": "2017-10-23T01:57:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sabberworm/php-css-parser",
|
||||
"version": "8.3.1",
|
||||
@ -461,6 +1076,86 @@
|
||||
"stylesheet"
|
||||
],
|
||||
"time": "2020-06-01T09:10:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.20.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
|
||||
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.20-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
},
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for the Mbstring extension",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"mbstring",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-10-23T14:02:19+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
@ -2140,5 +2835,5 @@
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "1.1.0"
|
||||
"plugin-api-version": "2.0.0"
|
||||
}
|
||||
|
||||
BIN
public/assets/logo.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
public/assets/uploads/1608370984_17683e2fb43eeb7d2976.xlsx
Normal file
BIN
public/assets/uploads/1608479506_023522a14f6d9cad7194.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
public/assets/uploads/1608480988_10b73cc98ac8ff56599e.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
public/uploads/1608364196_e8cdacad750dca8b086e.jpeg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
public/uploads/1608364212_a58d77fddb32b309d0a8.jpeg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
public/uploads/1608364293_27fbf2368874efd247c6.jpeg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
public/uploads/1608364313_f003a02467287ade1e05.jpeg
Normal file
|
After Width: | Height: | Size: 34 KiB |
0
public/uploads/index.html
Normal file
BIN
sample.pdf
Normal file
4
vendor/composer/ClassLoader.php
vendored
@ -37,8 +37,8 @@ namespace Composer\Autoload;
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see http://www.php-fig.org/psr/psr-0/
|
||||
* @see http://www.php-fig.org/psr/psr-4/
|
||||
* @see https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
|
||||
671
vendor/composer/InstalledVersions.php
vendored
Normal file
@ -0,0 +1,671 @@
|
||||
<?php
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class InstalledVersions
|
||||
{
|
||||
private static $installed = array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '564771da7a8141a515df1af578a2f793f6b03d37',
|
||||
'name' => 'codeigniter4/appstarter',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'codeigniter4/appstarter' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '564771da7a8141a515df1af578a2f793f6b03d37',
|
||||
),
|
||||
'codeigniter4/framework' =>
|
||||
array (
|
||||
'pretty_version' => 'v4.0.4',
|
||||
'version' => '4.0.4.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1edcf84f77ff794640fddbfc59a10a024cd15b50',
|
||||
),
|
||||
'doctrine/instantiator' =>
|
||||
array (
|
||||
'pretty_version' => '1.3.1',
|
||||
'version' => '1.3.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'f350df0268e904597e3bd9c4685c53e0e333feea',
|
||||
),
|
||||
'dompdf/dompdf' =>
|
||||
array (
|
||||
'pretty_version' => 'v0.8.6',
|
||||
'version' => '0.8.6.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'db91d81866c69a42dad1d2926f61515a1e3f42c5',
|
||||
),
|
||||
'fzaninotto/faker' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
0 => '1.9.x-dev',
|
||||
),
|
||||
'reference' => 'ac73e5287024f5e98dd6d0bf10e6a6f7877b7513',
|
||||
),
|
||||
'kint-php/kint' =>
|
||||
array (
|
||||
'pretty_version' => '3.3',
|
||||
'version' => '3.3.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '335ac1bcaf04d87df70d8aa51e8887ba2c6d203b',
|
||||
),
|
||||
'laminas/laminas-escaper' =>
|
||||
array (
|
||||
'pretty_version' => '2.6.1',
|
||||
'version' => '2.6.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '25f2a053eadfa92ddacb609dcbbc39362610da70',
|
||||
),
|
||||
'laminas/laminas-zendframework-bridge' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '6ede70583e101030bcace4dcddd648f760ddf642',
|
||||
),
|
||||
'maennchen/zipstream-php' =>
|
||||
array (
|
||||
'pretty_version' => '2.1.0',
|
||||
'version' => '2.1.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'c4c5803cc1f93df3d2448478ef79394a5981cc58',
|
||||
),
|
||||
'markbaker/complex' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.0',
|
||||
'version' => '2.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '9999f1432fae467bc93c53f357105b4c31bb994c',
|
||||
),
|
||||
'markbaker/matrix' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.0',
|
||||
'version' => '2.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '9567d9c4c519fbe40de01dbd1e4469dbbb66f46a',
|
||||
),
|
||||
'mikey179/vfsstream' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.6.8',
|
||||
'version' => '1.6.8.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '231c73783ebb7dd9ec77916c10037eff5a2b6efe',
|
||||
),
|
||||
'myclabs/deep-copy' =>
|
||||
array (
|
||||
'pretty_version' => '1.10.1',
|
||||
'version' => '1.10.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '969b211f9a51aa1f6c01d1d2aef56d3bd91598e5',
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '1.10.1',
|
||||
),
|
||||
),
|
||||
'myclabs/php-enum' =>
|
||||
array (
|
||||
'pretty_version' => '1.7.7',
|
||||
'version' => '1.7.7.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'd178027d1e679832db9f38248fcc7200647dc2b7',
|
||||
),
|
||||
'phar-io/manifest' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.3',
|
||||
'version' => '1.0.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '7761fcacf03b4d4f16e7ccb606d4879ca431fcf4',
|
||||
),
|
||||
'phar-io/version' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.1',
|
||||
'version' => '2.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '45a2ec53a73c70ce41d55cedef9063630abaf1b6',
|
||||
),
|
||||
'phenx/php-font-lib' =>
|
||||
array (
|
||||
'pretty_version' => '0.5.2',
|
||||
'version' => '0.5.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'ca6ad461f032145fff5971b5985e5af9e7fa88d8',
|
||||
),
|
||||
'phenx/php-svg-lib' =>
|
||||
array (
|
||||
'pretty_version' => 'v0.3.3',
|
||||
'version' => '0.3.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '5fa61b65e612ce1ae15f69b3d223cb14ecc60e32',
|
||||
),
|
||||
'phpdocumentor/reflection-common' =>
|
||||
array (
|
||||
'pretty_version' => '2.2.0',
|
||||
'version' => '2.2.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b',
|
||||
),
|
||||
'phpdocumentor/reflection-docblock' =>
|
||||
array (
|
||||
'pretty_version' => '5.2.2',
|
||||
'version' => '5.2.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '069a785b2141f5bcf49f3e353548dc1cce6df556',
|
||||
),
|
||||
'phpdocumentor/type-resolver' =>
|
||||
array (
|
||||
'pretty_version' => '1.4.0',
|
||||
'version' => '1.4.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0',
|
||||
),
|
||||
'phpoffice/phpspreadsheet' =>
|
||||
array (
|
||||
'pretty_version' => '1.15.0',
|
||||
'version' => '1.15.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f',
|
||||
),
|
||||
'phpspec/prophecy' =>
|
||||
array (
|
||||
'pretty_version' => '1.12.1',
|
||||
'version' => '1.12.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '8ce87516be71aae9b956f81906aaf0338e0d8a2d',
|
||||
),
|
||||
'phpunit/php-code-coverage' =>
|
||||
array (
|
||||
'pretty_version' => '7.0.10',
|
||||
'version' => '7.0.10.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'f1884187926fbb755a9aaf0b3836ad3165b478bf',
|
||||
),
|
||||
'phpunit/php-file-iterator' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.2',
|
||||
'version' => '2.0.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '050bedf145a257b1ff02746c31894800e5122946',
|
||||
),
|
||||
'phpunit/php-text-template' =>
|
||||
array (
|
||||
'pretty_version' => '1.2.1',
|
||||
'version' => '1.2.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '31f8b717e51d9a2afca6c9f046f5d69fc27c8686',
|
||||
),
|
||||
'phpunit/php-timer' =>
|
||||
array (
|
||||
'pretty_version' => '2.1.2',
|
||||
'version' => '2.1.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1038454804406b0b5f5f520358e78c1c2f71501e',
|
||||
),
|
||||
'phpunit/php-token-stream' =>
|
||||
array (
|
||||
'pretty_version' => '3.1.1',
|
||||
'version' => '3.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '995192df77f63a59e47f025390d2d1fdf8f425ff',
|
||||
),
|
||||
'phpunit/phpunit' =>
|
||||
array (
|
||||
'pretty_version' => '8.5.8',
|
||||
'version' => '8.5.8.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '34c18baa6a44f1d1fbf0338907139e9dce95b997',
|
||||
),
|
||||
'psr/http-client' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
|
||||
),
|
||||
'psr/http-factory' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be',
|
||||
),
|
||||
'psr/http-message' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
|
||||
),
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.3',
|
||||
'version' => '1.1.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
|
||||
),
|
||||
'sabberworm/php-css-parser' =>
|
||||
array (
|
||||
'pretty_version' => '8.3.1',
|
||||
'version' => '8.3.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'd217848e1396ef962fb1997cf3e2421acba7f796',
|
||||
),
|
||||
'sebastian/code-unit-reverse-lookup' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '4419fcdb5eabb9caa61a27c7a1db532a6b55dd18',
|
||||
),
|
||||
'sebastian/comparator' =>
|
||||
array (
|
||||
'pretty_version' => '3.0.2',
|
||||
'version' => '3.0.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '5de4fc177adf9bce8df98d8d141a7559d7ccf6da',
|
||||
),
|
||||
'sebastian/diff' =>
|
||||
array (
|
||||
'pretty_version' => '3.0.2',
|
||||
'version' => '3.0.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '720fcc7e9b5cf384ea68d9d930d480907a0c1a29',
|
||||
),
|
||||
'sebastian/environment' =>
|
||||
array (
|
||||
'pretty_version' => '4.2.3',
|
||||
'version' => '4.2.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '464c90d7bdf5ad4e8a6aea15c091fec0603d4368',
|
||||
),
|
||||
'sebastian/exporter' =>
|
||||
array (
|
||||
'pretty_version' => '3.1.2',
|
||||
'version' => '3.1.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '68609e1261d215ea5b21b7987539cbfbe156ec3e',
|
||||
),
|
||||
'sebastian/global-state' =>
|
||||
array (
|
||||
'pretty_version' => '3.0.0',
|
||||
'version' => '3.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4',
|
||||
),
|
||||
'sebastian/object-enumerator' =>
|
||||
array (
|
||||
'pretty_version' => '3.0.3',
|
||||
'version' => '3.0.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '7cfd9e65d11ffb5af41198476395774d4c8a84c5',
|
||||
),
|
||||
'sebastian/object-reflector' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '773f97c67f28de00d397be301821b06708fca0be',
|
||||
),
|
||||
'sebastian/recursion-context' =>
|
||||
array (
|
||||
'pretty_version' => '3.0.0',
|
||||
'version' => '3.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8',
|
||||
),
|
||||
'sebastian/resource-operations' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.1',
|
||||
'version' => '2.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '4d7a795d35b889bf80a0cc04e08d77cedfa917a9',
|
||||
),
|
||||
'sebastian/type' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.3',
|
||||
'version' => '1.1.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '3aaaa15fa71d27650d62a948be022fe3b48541a3',
|
||||
),
|
||||
'sebastian/version' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.1',
|
||||
'version' => '2.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '99732be0ddb3361e16ad77b68ba41efc8e979019',
|
||||
),
|
||||
'symfony/polyfill-ctype' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.18.1',
|
||||
'version' => '1.18.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1c302646f6efc070cd46856e600e5e0684d6b454',
|
||||
),
|
||||
'symfony/polyfill-mbstring' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.20.0',
|
||||
'version' => '1.20.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '39d483bdf39be819deabf04ec872eb0b2410b531',
|
||||
),
|
||||
'theseer/tokenizer' =>
|
||||
array (
|
||||
'pretty_version' => '1.2.0',
|
||||
'version' => '1.2.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '75a63c33a8577608444246075ea0af0d052e452a',
|
||||
),
|
||||
'webmozart/assert' =>
|
||||
array (
|
||||
'pretty_version' => '1.9.1',
|
||||
'version' => '1.9.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'bafc69caeb4d49c39fd0779086c03a3738cbb389',
|
||||
),
|
||||
'zendframework/zend-escaper' =>
|
||||
array (
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '2.6.1',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
return array_keys(self::$installed['versions']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function isInstalled($packageName)
|
||||
{
|
||||
return isset(self::$installed['versions'][$packageName]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
if (!isset(self::$installed['versions'][$packageName])) {
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset(self::$installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = self::$installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', self::$installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', self::$installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', self::$installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
if (!isset(self::$installed['versions'][$packageName])) {
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
if (!isset(self::$installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return self::$installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
if (!isset(self::$installed['versions'][$packageName])) {
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return self::$installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
if (!isset(self::$installed['versions'][$packageName])) {
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
if (!isset(self::$installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return self::$installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRootPackage()
|
||||
{
|
||||
return self::$installed['root'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRawData()
|
||||
{
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
}
|
||||
}
|
||||
1
vendor/composer/autoload_classmap.php
vendored
@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'Dompdf\\Cpdf' => $vendorDir . '/dompdf/dompdf/lib/Cpdf.php',
|
||||
'HTML5_Data' => $vendorDir . '/dompdf/dompdf/lib/html5lib/Data.php',
|
||||
'HTML5_InputStream' => $vendorDir . '/dompdf/dompdf/lib/html5lib/InputStream.php',
|
||||
|
||||
59
vendor/composer/autoload_files.php
vendored
@ -8,6 +8,65 @@ $baseDir = dirname($vendorDir);
|
||||
return array(
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'3917c79c5052b270641b5a200963dbc2' => $vendorDir . '/kint-php/kint/init.php',
|
||||
'abede361264e2ae69ec1eee813a101af' => $vendorDir . '/markbaker/complex/classes/src/functions/abs.php',
|
||||
'21a5860fbef5be28db5ddfbc3cca67c4' => $vendorDir . '/markbaker/complex/classes/src/functions/acos.php',
|
||||
'1546e3f9d127f2a9bb2d1b6c31c26ef1' => $vendorDir . '/markbaker/complex/classes/src/functions/acosh.php',
|
||||
'd2516f7f4fba5ea5905f494b4a8262e0' => $vendorDir . '/markbaker/complex/classes/src/functions/acot.php',
|
||||
'4511163d560956219b96882c0980b65e' => $vendorDir . '/markbaker/complex/classes/src/functions/acoth.php',
|
||||
'c361f5616dc2a8da4fa3e137077cd4ea' => $vendorDir . '/markbaker/complex/classes/src/functions/acsc.php',
|
||||
'02d68920fc98da71991ce569c91df0f6' => $vendorDir . '/markbaker/complex/classes/src/functions/acsch.php',
|
||||
'88e19525eae308b4a6aa3419364875d3' => $vendorDir . '/markbaker/complex/classes/src/functions/argument.php',
|
||||
'60e8e2d0827b58bfc904f13957e51849' => $vendorDir . '/markbaker/complex/classes/src/functions/asec.php',
|
||||
'13d2f040713999eab66c359b4d79871d' => $vendorDir . '/markbaker/complex/classes/src/functions/asech.php',
|
||||
'838ab38beb32c68a79d3cd2c007d5a04' => $vendorDir . '/markbaker/complex/classes/src/functions/asin.php',
|
||||
'bb28eccd0f8f008333a1b3c163d604ac' => $vendorDir . '/markbaker/complex/classes/src/functions/asinh.php',
|
||||
'9e483de83558c98f7d3feaa402c78cb3' => $vendorDir . '/markbaker/complex/classes/src/functions/atan.php',
|
||||
'36b74b5b765ded91ee58c8ee3c0e85e3' => $vendorDir . '/markbaker/complex/classes/src/functions/atanh.php',
|
||||
'05c15ee9510da7fd6bf6136f436500c0' => $vendorDir . '/markbaker/complex/classes/src/functions/conjugate.php',
|
||||
'd3208dfbce2505e370788f9f22f6785f' => $vendorDir . '/markbaker/complex/classes/src/functions/cos.php',
|
||||
'141cf1fb3a3046f8b64534b0ebab33ca' => $vendorDir . '/markbaker/complex/classes/src/functions/cosh.php',
|
||||
'be660df75fd0dbe7fa7c03b7434b3294' => $vendorDir . '/markbaker/complex/classes/src/functions/cot.php',
|
||||
'01e31ea298a51bc9e91517e3ce6b9e76' => $vendorDir . '/markbaker/complex/classes/src/functions/coth.php',
|
||||
'803ddd97f7b1da68982a7b087c3476f6' => $vendorDir . '/markbaker/complex/classes/src/functions/csc.php',
|
||||
'3001cdfd101ec3c32da34ee43c2e149b' => $vendorDir . '/markbaker/complex/classes/src/functions/csch.php',
|
||||
'77b2d7629ef2a93fabb8c56754a91051' => $vendorDir . '/markbaker/complex/classes/src/functions/exp.php',
|
||||
'4a4471296dec796c21d4f4b6552396a9' => $vendorDir . '/markbaker/complex/classes/src/functions/inverse.php',
|
||||
'c3e9897e1744b88deb56fcdc39d34d85' => $vendorDir . '/markbaker/complex/classes/src/functions/ln.php',
|
||||
'a83cacf2de942cff288de15a83afd26d' => $vendorDir . '/markbaker/complex/classes/src/functions/log2.php',
|
||||
'6a861dacc9ee2f3061241d4c7772fa21' => $vendorDir . '/markbaker/complex/classes/src/functions/log10.php',
|
||||
'4d2522d968c8ba78d6c13548a1b4200e' => $vendorDir . '/markbaker/complex/classes/src/functions/negative.php',
|
||||
'fd587ca933fc0447fa5ab4843bdd97f7' => $vendorDir . '/markbaker/complex/classes/src/functions/pow.php',
|
||||
'383ef01c62028fc78cd4388082fce3c2' => $vendorDir . '/markbaker/complex/classes/src/functions/rho.php',
|
||||
'150fbd1b95029dc47292da97ecab9375' => $vendorDir . '/markbaker/complex/classes/src/functions/sec.php',
|
||||
'549abd9bae174286d660bdaa07407c68' => $vendorDir . '/markbaker/complex/classes/src/functions/sech.php',
|
||||
'6bfbf5eaea6b17a0ed85cb21ba80370c' => $vendorDir . '/markbaker/complex/classes/src/functions/sin.php',
|
||||
'22efe13f1a497b8e199540ae2d9dc59c' => $vendorDir . '/markbaker/complex/classes/src/functions/sinh.php',
|
||||
'e90135ab8e787795a509ed7147de207d' => $vendorDir . '/markbaker/complex/classes/src/functions/sqrt.php',
|
||||
'bb0a7923ffc6a90919cd64ec54ff06bc' => $vendorDir . '/markbaker/complex/classes/src/functions/tan.php',
|
||||
'2d302f32ce0fd4e433dd91c5bb404a28' => $vendorDir . '/markbaker/complex/classes/src/functions/tanh.php',
|
||||
'24dd4658a952171a4ee79218c4f9fd06' => $vendorDir . '/markbaker/complex/classes/src/functions/theta.php',
|
||||
'e49b7876281d6f5bc39536dde96d1f4a' => $vendorDir . '/markbaker/complex/classes/src/operations/add.php',
|
||||
'47596e02b43cd6da7700134fd08f88cf' => $vendorDir . '/markbaker/complex/classes/src/operations/subtract.php',
|
||||
'883af48563631547925fa4c3b48ead07' => $vendorDir . '/markbaker/complex/classes/src/operations/multiply.php',
|
||||
'f190e3308e6ca23234a2875edc985c03' => $vendorDir . '/markbaker/complex/classes/src/operations/divideby.php',
|
||||
'ac9e33ce6841aa5bf5d16d465a2f03a7' => $vendorDir . '/markbaker/complex/classes/src/operations/divideinto.php',
|
||||
'9d8e013a5160a09477beb8e44f8ae97b' => $vendorDir . '/markbaker/matrix/classes/src/functions/adjoint.php',
|
||||
'6e78d1bdea6248d6aa117229efae50f2' => $vendorDir . '/markbaker/matrix/classes/src/functions/antidiagonal.php',
|
||||
'4623d87924d94f5412fe5afbf1cef31d' => $vendorDir . '/markbaker/matrix/classes/src/functions/cofactors.php',
|
||||
'901fd1f6950a637ca85f66b701a45e13' => $vendorDir . '/markbaker/matrix/classes/src/functions/determinant.php',
|
||||
'83057abc0e4acc99ba80154ee5d02a49' => $vendorDir . '/markbaker/matrix/classes/src/functions/diagonal.php',
|
||||
'07b7fd7a434451149b4fd477fca0ce06' => $vendorDir . '/markbaker/matrix/classes/src/functions/identity.php',
|
||||
'c8d43b340583e07ae89f2a3baef2cf89' => $vendorDir . '/markbaker/matrix/classes/src/functions/inverse.php',
|
||||
'499bb10ed7a3aee2ba4c09a31a85e8d1' => $vendorDir . '/markbaker/matrix/classes/src/functions/minors.php',
|
||||
'1cad2e6414d652e8b1c64e8967f6f37d' => $vendorDir . '/markbaker/matrix/classes/src/functions/trace.php',
|
||||
'95a7f134ac17161d07def442b3b737e8' => $vendorDir . '/markbaker/matrix/classes/src/functions/transpose.php',
|
||||
'b3a6bc628377118d4b4b8ba08d1eb949' => $vendorDir . '/markbaker/matrix/classes/src/operations/add.php',
|
||||
'5fef6d0e407f3f8887266dfa4a6c534c' => $vendorDir . '/markbaker/matrix/classes/src/operations/directsum.php',
|
||||
'684ba247e1385946e3babdaa054119de' => $vendorDir . '/markbaker/matrix/classes/src/operations/subtract.php',
|
||||
'aa53dcba601214d17ad405b7c291b7e8' => $vendorDir . '/markbaker/matrix/classes/src/operations/multiply.php',
|
||||
'75c79eb1b25749b05a47976f32b0d8a2' => $vendorDir . '/markbaker/matrix/classes/src/operations/divideby.php',
|
||||
'6ab8ad87a734f276a6bcd5a0fe1289be' => $vendorDir . '/markbaker/matrix/classes/src/operations/divideinto.php',
|
||||
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
||||
);
|
||||
|
||||
9
vendor/composer/autoload_psr4.php
vendored
@ -7,12 +7,20 @@ $baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src'),
|
||||
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
|
||||
'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),
|
||||
'Tests\\Support\\' => array($baseDir . '/tests/_support'),
|
||||
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
|
||||
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
|
||||
'Svg\\' => array($vendorDir . '/phenx/php-svg-lib/src/Svg'),
|
||||
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
||||
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
|
||||
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
|
||||
'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src/Prophecy'),
|
||||
'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
|
||||
'MyCLabs\\Enum\\' => array($vendorDir . '/myclabs/php-enum/src'),
|
||||
'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'),
|
||||
'Laminas\\ZendFrameworkBridge\\' => array($vendorDir . '/laminas/laminas-zendframework-bridge/src'),
|
||||
'Laminas\\Escaper\\' => array($vendorDir . '/laminas/laminas-escaper/src'),
|
||||
'Kint\\' => array($vendorDir . '/kint-php/kint/src'),
|
||||
@ -21,5 +29,6 @@ return array(
|
||||
'Dompdf\\' => array($vendorDir . '/dompdf/dompdf/src'),
|
||||
'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'),
|
||||
'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'),
|
||||
'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'),
|
||||
'CodeIgniter\\' => array($vendorDir . '/codeigniter4/framework/system'),
|
||||
);
|
||||
|
||||
4
vendor/composer/autoload_real.php
vendored
@ -22,13 +22,15 @@ class ComposerAutoloaderInitbbfefea263758c542cf1b7e1de76aa47
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
require __DIR__ . '/platform_check.php';
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitbbfefea263758c542cf1b7e1de76aa47', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitbbfefea263758c542cf1b7e1de76aa47', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitbbfefea263758c542cf1b7e1de76aa47::getInitializer($loader));
|
||||
} else {
|
||||
|
||||
112
vendor/composer/autoload_static.php
vendored
@ -9,7 +9,66 @@ class ComposerStaticInitbbfefea263758c542cf1b7e1de76aa47
|
||||
public static $files = array (
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'3917c79c5052b270641b5a200963dbc2' => __DIR__ . '/..' . '/kint-php/kint/init.php',
|
||||
'abede361264e2ae69ec1eee813a101af' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/abs.php',
|
||||
'21a5860fbef5be28db5ddfbc3cca67c4' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acos.php',
|
||||
'1546e3f9d127f2a9bb2d1b6c31c26ef1' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acosh.php',
|
||||
'd2516f7f4fba5ea5905f494b4a8262e0' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acot.php',
|
||||
'4511163d560956219b96882c0980b65e' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acoth.php',
|
||||
'c361f5616dc2a8da4fa3e137077cd4ea' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acsc.php',
|
||||
'02d68920fc98da71991ce569c91df0f6' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acsch.php',
|
||||
'88e19525eae308b4a6aa3419364875d3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/argument.php',
|
||||
'60e8e2d0827b58bfc904f13957e51849' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asec.php',
|
||||
'13d2f040713999eab66c359b4d79871d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asech.php',
|
||||
'838ab38beb32c68a79d3cd2c007d5a04' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asin.php',
|
||||
'bb28eccd0f8f008333a1b3c163d604ac' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asinh.php',
|
||||
'9e483de83558c98f7d3feaa402c78cb3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/atan.php',
|
||||
'36b74b5b765ded91ee58c8ee3c0e85e3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/atanh.php',
|
||||
'05c15ee9510da7fd6bf6136f436500c0' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/conjugate.php',
|
||||
'd3208dfbce2505e370788f9f22f6785f' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cos.php',
|
||||
'141cf1fb3a3046f8b64534b0ebab33ca' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cosh.php',
|
||||
'be660df75fd0dbe7fa7c03b7434b3294' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cot.php',
|
||||
'01e31ea298a51bc9e91517e3ce6b9e76' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/coth.php',
|
||||
'803ddd97f7b1da68982a7b087c3476f6' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/csc.php',
|
||||
'3001cdfd101ec3c32da34ee43c2e149b' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/csch.php',
|
||||
'77b2d7629ef2a93fabb8c56754a91051' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/exp.php',
|
||||
'4a4471296dec796c21d4f4b6552396a9' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/inverse.php',
|
||||
'c3e9897e1744b88deb56fcdc39d34d85' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/ln.php',
|
||||
'a83cacf2de942cff288de15a83afd26d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/log2.php',
|
||||
'6a861dacc9ee2f3061241d4c7772fa21' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/log10.php',
|
||||
'4d2522d968c8ba78d6c13548a1b4200e' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/negative.php',
|
||||
'fd587ca933fc0447fa5ab4843bdd97f7' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/pow.php',
|
||||
'383ef01c62028fc78cd4388082fce3c2' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/rho.php',
|
||||
'150fbd1b95029dc47292da97ecab9375' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sec.php',
|
||||
'549abd9bae174286d660bdaa07407c68' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sech.php',
|
||||
'6bfbf5eaea6b17a0ed85cb21ba80370c' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sin.php',
|
||||
'22efe13f1a497b8e199540ae2d9dc59c' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sinh.php',
|
||||
'e90135ab8e787795a509ed7147de207d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sqrt.php',
|
||||
'bb0a7923ffc6a90919cd64ec54ff06bc' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/tan.php',
|
||||
'2d302f32ce0fd4e433dd91c5bb404a28' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/tanh.php',
|
||||
'24dd4658a952171a4ee79218c4f9fd06' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/theta.php',
|
||||
'e49b7876281d6f5bc39536dde96d1f4a' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/add.php',
|
||||
'47596e02b43cd6da7700134fd08f88cf' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/subtract.php',
|
||||
'883af48563631547925fa4c3b48ead07' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/multiply.php',
|
||||
'f190e3308e6ca23234a2875edc985c03' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideby.php',
|
||||
'ac9e33ce6841aa5bf5d16d465a2f03a7' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideinto.php',
|
||||
'9d8e013a5160a09477beb8e44f8ae97b' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/adjoint.php',
|
||||
'6e78d1bdea6248d6aa117229efae50f2' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/antidiagonal.php',
|
||||
'4623d87924d94f5412fe5afbf1cef31d' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/cofactors.php',
|
||||
'901fd1f6950a637ca85f66b701a45e13' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/determinant.php',
|
||||
'83057abc0e4acc99ba80154ee5d02a49' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/diagonal.php',
|
||||
'07b7fd7a434451149b4fd477fca0ce06' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/identity.php',
|
||||
'c8d43b340583e07ae89f2a3baef2cf89' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/inverse.php',
|
||||
'499bb10ed7a3aee2ba4c09a31a85e8d1' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/minors.php',
|
||||
'1cad2e6414d652e8b1c64e8967f6f37d' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/trace.php',
|
||||
'95a7f134ac17161d07def442b3b737e8' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/transpose.php',
|
||||
'b3a6bc628377118d4b4b8ba08d1eb949' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/add.php',
|
||||
'5fef6d0e407f3f8887266dfa4a6c534c' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/directsum.php',
|
||||
'684ba247e1385946e3babdaa054119de' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/subtract.php',
|
||||
'aa53dcba601214d17ad405b7c291b7e8' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/multiply.php',
|
||||
'75c79eb1b25749b05a47976f32b0d8a2' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/divideby.php',
|
||||
'6ab8ad87a734f276a6bcd5a0fe1289be' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/divideinto.php',
|
||||
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
||||
);
|
||||
|
||||
@ -18,6 +77,10 @@ class ComposerStaticInitbbfefea263758c542cf1b7e1de76aa47
|
||||
array (
|
||||
'phpDocumentor\\Reflection\\' => 25,
|
||||
),
|
||||
'Z' =>
|
||||
array (
|
||||
'ZipStream\\' => 10,
|
||||
),
|
||||
'W' =>
|
||||
array (
|
||||
'Webmozart\\Assert\\' => 17,
|
||||
@ -28,13 +91,23 @@ class ComposerStaticInitbbfefea263758c542cf1b7e1de76aa47
|
||||
),
|
||||
'S' =>
|
||||
array (
|
||||
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
||||
'Symfony\\Polyfill\\Ctype\\' => 23,
|
||||
'Svg\\' => 4,
|
||||
),
|
||||
'P' =>
|
||||
array (
|
||||
'Psr\\SimpleCache\\' => 16,
|
||||
'Psr\\Log\\' => 8,
|
||||
'Psr\\Http\\Message\\' => 17,
|
||||
'Psr\\Http\\Client\\' => 16,
|
||||
'Prophecy\\' => 9,
|
||||
'PhpOffice\\PhpSpreadsheet\\' => 25,
|
||||
),
|
||||
'M' =>
|
||||
array (
|
||||
'MyCLabs\\Enum\\' => 13,
|
||||
'Matrix\\' => 7,
|
||||
),
|
||||
'L' =>
|
||||
array (
|
||||
@ -58,6 +131,7 @@ class ComposerStaticInitbbfefea263758c542cf1b7e1de76aa47
|
||||
),
|
||||
'C' =>
|
||||
array (
|
||||
'Complex\\' => 8,
|
||||
'CodeIgniter\\' => 12,
|
||||
),
|
||||
);
|
||||
@ -69,6 +143,10 @@ class ComposerStaticInitbbfefea263758c542cf1b7e1de76aa47
|
||||
1 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src',
|
||||
2 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src',
|
||||
),
|
||||
'ZipStream\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/maennchen/zipstream-php/src',
|
||||
),
|
||||
'Webmozart\\Assert\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/webmozart/assert/src',
|
||||
@ -77,6 +155,10 @@ class ComposerStaticInitbbfefea263758c542cf1b7e1de76aa47
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/tests/_support',
|
||||
),
|
||||
'Symfony\\Polyfill\\Mbstring\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
|
||||
),
|
||||
'Symfony\\Polyfill\\Ctype\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
|
||||
@ -85,14 +167,39 @@ class ComposerStaticInitbbfefea263758c542cf1b7e1de76aa47
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/phenx/php-svg-lib/src/Svg',
|
||||
),
|
||||
'Psr\\SimpleCache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
|
||||
),
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
||||
),
|
||||
'Psr\\Http\\Message\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/http-factory/src',
|
||||
1 => __DIR__ . '/..' . '/psr/http-message/src',
|
||||
),
|
||||
'Psr\\Http\\Client\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/http-client/src',
|
||||
),
|
||||
'Prophecy\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/phpspec/prophecy/src/Prophecy',
|
||||
),
|
||||
'PhpOffice\\PhpSpreadsheet\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet',
|
||||
),
|
||||
'MyCLabs\\Enum\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/myclabs/php-enum/src',
|
||||
),
|
||||
'Matrix\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/markbaker/matrix/classes/src',
|
||||
),
|
||||
'Laminas\\ZendFrameworkBridge\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src',
|
||||
@ -125,6 +232,10 @@ class ComposerStaticInitbbfefea263758c542cf1b7e1de76aa47
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy',
|
||||
),
|
||||
'Complex\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/markbaker/complex/classes/src',
|
||||
),
|
||||
'CodeIgniter\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/codeigniter4/framework/system',
|
||||
@ -149,6 +260,7 @@ class ComposerStaticInitbbfefea263758c542cf1b7e1de76aa47
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
'Dompdf\\Cpdf' => __DIR__ . '/..' . '/dompdf/dompdf/lib/Cpdf.php',
|
||||
'HTML5_Data' => __DIR__ . '/..' . '/dompdf/dompdf/lib/html5lib/Data.php',
|
||||
'HTML5_InputStream' => __DIR__ . '/..' . '/dompdf/dompdf/lib/html5lib/InputStream.php',
|
||||
|
||||
5113
vendor/composer/installed.json
vendored
486
vendor/composer/installed.php
vendored
Normal file
@ -0,0 +1,486 @@
|
||||
<?php return array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '564771da7a8141a515df1af578a2f793f6b03d37',
|
||||
'name' => 'codeigniter4/appstarter',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'codeigniter4/appstarter' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '564771da7a8141a515df1af578a2f793f6b03d37',
|
||||
),
|
||||
'codeigniter4/framework' =>
|
||||
array (
|
||||
'pretty_version' => 'v4.0.4',
|
||||
'version' => '4.0.4.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1edcf84f77ff794640fddbfc59a10a024cd15b50',
|
||||
),
|
||||
'doctrine/instantiator' =>
|
||||
array (
|
||||
'pretty_version' => '1.3.1',
|
||||
'version' => '1.3.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'f350df0268e904597e3bd9c4685c53e0e333feea',
|
||||
),
|
||||
'dompdf/dompdf' =>
|
||||
array (
|
||||
'pretty_version' => 'v0.8.6',
|
||||
'version' => '0.8.6.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'db91d81866c69a42dad1d2926f61515a1e3f42c5',
|
||||
),
|
||||
'fzaninotto/faker' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
0 => '1.9.x-dev',
|
||||
),
|
||||
'reference' => 'ac73e5287024f5e98dd6d0bf10e6a6f7877b7513',
|
||||
),
|
||||
'kint-php/kint' =>
|
||||
array (
|
||||
'pretty_version' => '3.3',
|
||||
'version' => '3.3.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '335ac1bcaf04d87df70d8aa51e8887ba2c6d203b',
|
||||
),
|
||||
'laminas/laminas-escaper' =>
|
||||
array (
|
||||
'pretty_version' => '2.6.1',
|
||||
'version' => '2.6.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '25f2a053eadfa92ddacb609dcbbc39362610da70',
|
||||
),
|
||||
'laminas/laminas-zendframework-bridge' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '6ede70583e101030bcace4dcddd648f760ddf642',
|
||||
),
|
||||
'maennchen/zipstream-php' =>
|
||||
array (
|
||||
'pretty_version' => '2.1.0',
|
||||
'version' => '2.1.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'c4c5803cc1f93df3d2448478ef79394a5981cc58',
|
||||
),
|
||||
'markbaker/complex' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.0',
|
||||
'version' => '2.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '9999f1432fae467bc93c53f357105b4c31bb994c',
|
||||
),
|
||||
'markbaker/matrix' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.0',
|
||||
'version' => '2.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '9567d9c4c519fbe40de01dbd1e4469dbbb66f46a',
|
||||
),
|
||||
'mikey179/vfsstream' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.6.8',
|
||||
'version' => '1.6.8.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '231c73783ebb7dd9ec77916c10037eff5a2b6efe',
|
||||
),
|
||||
'myclabs/deep-copy' =>
|
||||
array (
|
||||
'pretty_version' => '1.10.1',
|
||||
'version' => '1.10.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '969b211f9a51aa1f6c01d1d2aef56d3bd91598e5',
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '1.10.1',
|
||||
),
|
||||
),
|
||||
'myclabs/php-enum' =>
|
||||
array (
|
||||
'pretty_version' => '1.7.7',
|
||||
'version' => '1.7.7.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'd178027d1e679832db9f38248fcc7200647dc2b7',
|
||||
),
|
||||
'phar-io/manifest' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.3',
|
||||
'version' => '1.0.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '7761fcacf03b4d4f16e7ccb606d4879ca431fcf4',
|
||||
),
|
||||
'phar-io/version' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.1',
|
||||
'version' => '2.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '45a2ec53a73c70ce41d55cedef9063630abaf1b6',
|
||||
),
|
||||
'phenx/php-font-lib' =>
|
||||
array (
|
||||
'pretty_version' => '0.5.2',
|
||||
'version' => '0.5.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'ca6ad461f032145fff5971b5985e5af9e7fa88d8',
|
||||
),
|
||||
'phenx/php-svg-lib' =>
|
||||
array (
|
||||
'pretty_version' => 'v0.3.3',
|
||||
'version' => '0.3.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '5fa61b65e612ce1ae15f69b3d223cb14ecc60e32',
|
||||
),
|
||||
'phpdocumentor/reflection-common' =>
|
||||
array (
|
||||
'pretty_version' => '2.2.0',
|
||||
'version' => '2.2.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b',
|
||||
),
|
||||
'phpdocumentor/reflection-docblock' =>
|
||||
array (
|
||||
'pretty_version' => '5.2.2',
|
||||
'version' => '5.2.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '069a785b2141f5bcf49f3e353548dc1cce6df556',
|
||||
),
|
||||
'phpdocumentor/type-resolver' =>
|
||||
array (
|
||||
'pretty_version' => '1.4.0',
|
||||
'version' => '1.4.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0',
|
||||
),
|
||||
'phpoffice/phpspreadsheet' =>
|
||||
array (
|
||||
'pretty_version' => '1.15.0',
|
||||
'version' => '1.15.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f',
|
||||
),
|
||||
'phpspec/prophecy' =>
|
||||
array (
|
||||
'pretty_version' => '1.12.1',
|
||||
'version' => '1.12.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '8ce87516be71aae9b956f81906aaf0338e0d8a2d',
|
||||
),
|
||||
'phpunit/php-code-coverage' =>
|
||||
array (
|
||||
'pretty_version' => '7.0.10',
|
||||
'version' => '7.0.10.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'f1884187926fbb755a9aaf0b3836ad3165b478bf',
|
||||
),
|
||||
'phpunit/php-file-iterator' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.2',
|
||||
'version' => '2.0.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '050bedf145a257b1ff02746c31894800e5122946',
|
||||
),
|
||||
'phpunit/php-text-template' =>
|
||||
array (
|
||||
'pretty_version' => '1.2.1',
|
||||
'version' => '1.2.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '31f8b717e51d9a2afca6c9f046f5d69fc27c8686',
|
||||
),
|
||||
'phpunit/php-timer' =>
|
||||
array (
|
||||
'pretty_version' => '2.1.2',
|
||||
'version' => '2.1.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1038454804406b0b5f5f520358e78c1c2f71501e',
|
||||
),
|
||||
'phpunit/php-token-stream' =>
|
||||
array (
|
||||
'pretty_version' => '3.1.1',
|
||||
'version' => '3.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '995192df77f63a59e47f025390d2d1fdf8f425ff',
|
||||
),
|
||||
'phpunit/phpunit' =>
|
||||
array (
|
||||
'pretty_version' => '8.5.8',
|
||||
'version' => '8.5.8.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '34c18baa6a44f1d1fbf0338907139e9dce95b997',
|
||||
),
|
||||
'psr/http-client' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
|
||||
),
|
||||
'psr/http-factory' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be',
|
||||
),
|
||||
'psr/http-message' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
|
||||
),
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.3',
|
||||
'version' => '1.1.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
|
||||
),
|
||||
'sabberworm/php-css-parser' =>
|
||||
array (
|
||||
'pretty_version' => '8.3.1',
|
||||
'version' => '8.3.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'd217848e1396ef962fb1997cf3e2421acba7f796',
|
||||
),
|
||||
'sebastian/code-unit-reverse-lookup' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '4419fcdb5eabb9caa61a27c7a1db532a6b55dd18',
|
||||
),
|
||||
'sebastian/comparator' =>
|
||||
array (
|
||||
'pretty_version' => '3.0.2',
|
||||
'version' => '3.0.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '5de4fc177adf9bce8df98d8d141a7559d7ccf6da',
|
||||
),
|
||||
'sebastian/diff' =>
|
||||
array (
|
||||
'pretty_version' => '3.0.2',
|
||||
'version' => '3.0.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '720fcc7e9b5cf384ea68d9d930d480907a0c1a29',
|
||||
),
|
||||
'sebastian/environment' =>
|
||||
array (
|
||||
'pretty_version' => '4.2.3',
|
||||
'version' => '4.2.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '464c90d7bdf5ad4e8a6aea15c091fec0603d4368',
|
||||
),
|
||||
'sebastian/exporter' =>
|
||||
array (
|
||||
'pretty_version' => '3.1.2',
|
||||
'version' => '3.1.2.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '68609e1261d215ea5b21b7987539cbfbe156ec3e',
|
||||
),
|
||||
'sebastian/global-state' =>
|
||||
array (
|
||||
'pretty_version' => '3.0.0',
|
||||
'version' => '3.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4',
|
||||
),
|
||||
'sebastian/object-enumerator' =>
|
||||
array (
|
||||
'pretty_version' => '3.0.3',
|
||||
'version' => '3.0.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '7cfd9e65d11ffb5af41198476395774d4c8a84c5',
|
||||
),
|
||||
'sebastian/object-reflector' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '773f97c67f28de00d397be301821b06708fca0be',
|
||||
),
|
||||
'sebastian/recursion-context' =>
|
||||
array (
|
||||
'pretty_version' => '3.0.0',
|
||||
'version' => '3.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8',
|
||||
),
|
||||
'sebastian/resource-operations' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.1',
|
||||
'version' => '2.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '4d7a795d35b889bf80a0cc04e08d77cedfa917a9',
|
||||
),
|
||||
'sebastian/type' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.3',
|
||||
'version' => '1.1.3.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '3aaaa15fa71d27650d62a948be022fe3b48541a3',
|
||||
),
|
||||
'sebastian/version' =>
|
||||
array (
|
||||
'pretty_version' => '2.0.1',
|
||||
'version' => '2.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '99732be0ddb3361e16ad77b68ba41efc8e979019',
|
||||
),
|
||||
'symfony/polyfill-ctype' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.18.1',
|
||||
'version' => '1.18.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1c302646f6efc070cd46856e600e5e0684d6b454',
|
||||
),
|
||||
'symfony/polyfill-mbstring' =>
|
||||
array (
|
||||
'pretty_version' => 'v1.20.0',
|
||||
'version' => '1.20.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '39d483bdf39be819deabf04ec872eb0b2410b531',
|
||||
),
|
||||
'theseer/tokenizer' =>
|
||||
array (
|
||||
'pretty_version' => '1.2.0',
|
||||
'version' => '1.2.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '75a63c33a8577608444246075ea0af0d052e452a',
|
||||
),
|
||||
'webmozart/assert' =>
|
||||
array (
|
||||
'pretty_version' => '1.9.1',
|
||||
'version' => '1.9.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'bafc69caeb4d49c39fd0779086c03a3738cbb389',
|
||||
),
|
||||
'zendframework/zend-escaper' =>
|
||||
array (
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '2.6.1',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
26
vendor/composer/platform_check.php
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
// platform_check.php @generated by Composer
|
||||
|
||||
$issues = array();
|
||||
|
||||
if (!(PHP_VERSION_ID >= 70200)) {
|
||||
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.0". You are running ' . PHP_VERSION . '.';
|
||||
}
|
||||
|
||||
if ($issues) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
||||
} elseif (!headers_sent()) {
|
||||
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
1
vendor/maennchen/zipstream-php/.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
open_collective: zipstream
|
||||
12
vendor/maennchen/zipstream-php/.github/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# Description of the problem
|
||||
|
||||
Please be very descriptive and include as much details as possible.
|
||||
|
||||
# Example code
|
||||
|
||||
# Informations
|
||||
|
||||
* ZipStream-PHP version:
|
||||
* PHP version:
|
||||
|
||||
Please include any supplemental information you deem relevant to this issue.
|
||||
6
vendor/maennchen/zipstream-php/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
clover.xml
|
||||
composer.lock
|
||||
coverage.clover
|
||||
.idea
|
||||
phpunit.xml
|
||||
vendor
|
||||
12
vendor/maennchen/zipstream-php/.travis.yml
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
language: php
|
||||
dist: trusty
|
||||
sudo: false
|
||||
php:
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.3
|
||||
install: composer install
|
||||
script: ./vendor/bin/phpunit --coverage-clover=coverage.clover
|
||||
after_script:
|
||||
- wget https://scrutinizer-ci.com/ocular.phar
|
||||
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
|
||||
51
vendor/maennchen/zipstream-php/CHANGELOG.md
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
# CHANGELOG for ZipStream-PHP
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2.1.0] - 2020-06-01
|
||||
### Changed
|
||||
- Don't execute ob_flush() when output buffering is not enabled (#152)
|
||||
- Fix inconsistent return type on 32-bit systems (#149) Fix #144
|
||||
- Use mbstring polyfill (#151)
|
||||
- Promote 7zip usage over unzip to avoid UTF-8 issues (#147)
|
||||
|
||||
## [2.0.0] - 2020-02-22
|
||||
### Breaking change
|
||||
- Only the self opened streams will be closed (#139)
|
||||
If you were relying on ZipStream to close streams that the library didn't open,
|
||||
you'll need to close them yourself now.
|
||||
|
||||
### Changed
|
||||
- Minor change to data descriptor (#136)
|
||||
|
||||
## [1.2.0] - 2019-07-11
|
||||
|
||||
### Added
|
||||
- Option to flush output buffer after every write (#122)
|
||||
|
||||
## [1.1.0] - 2019-04-30
|
||||
|
||||
### Fixed
|
||||
- Honor last-modified timestamps set via `ZipStream\Option\File::setTime()` (#106)
|
||||
- Documentation regarding output of HTTP headers
|
||||
- Test warnings with PHPUnit (#109)
|
||||
|
||||
### Added
|
||||
- Test for FileNotReadableException (#114)
|
||||
- Size attribute to File options (#113)
|
||||
- Tests on PHP 7.3 (#108)
|
||||
|
||||
## [1.0.0] - 2019-04-17
|
||||
|
||||
### Breaking changes
|
||||
- Mininum PHP version is now 7.1
|
||||
- Options are now passed to the ZipStream object via the Option\Archive object. See the wiki for available options and code examples
|
||||
|
||||
### Added
|
||||
- Add large file support with Zip64 headers
|
||||
|
||||
### Changed
|
||||
- Major refactoring and code cleanup
|
||||
25
vendor/maennchen/zipstream-php/CONTRIBUTING.md
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
# ZipStream Readme for Contributors
|
||||
## Code styling
|
||||
### Indention
|
||||
For spaces are used to indent code. The convention is [K&R](http://en.wikipedia.org/wiki/Indent_style#K&R)
|
||||
|
||||
### Comments
|
||||
Double Slashes are used for an one line comment.
|
||||
|
||||
Classes, Variables, Methods etc:
|
||||
|
||||
```php
|
||||
/**
|
||||
* My comment
|
||||
*
|
||||
* @myanotation like @param etc.
|
||||
*/
|
||||
```
|
||||
|
||||
## Pull requests
|
||||
Feel free to submit pull requests.
|
||||
|
||||
## Testing
|
||||
For every new feature please write a new PHPUnit test.
|
||||
|
||||
Before every commit execute `./vendor/bin/phpunit` to check if your changes wrecked something:
|
||||
24
vendor/maennchen/zipstream-php/LICENSE
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2007-2009 Paul Duncan <pabs@pablotron.org>
|
||||
Copyright (C) 2014 Jonatan Männchen <jonatan@maennchen.ch>
|
||||
Copyright (C) 2014 Jesse G. Donat <donatj@gmail.com>
|
||||
Copyright (C) 2018 Nicolas CARPi <nicolas.carpi@curie.fr>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
123
vendor/maennchen/zipstream-php/README.md
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
# ZipStream-PHP
|
||||
|
||||
[](https://travis-ci.org/maennchen/ZipStream-PHP)
|
||||
[](https://scrutinizer-ci.com/g/maennchen/ZipStream-PHP/)
|
||||
[](https://scrutinizer-ci.com/g/maennchen/ZipStream-PHP/)
|
||||
[](https://packagist.org/packages/maennchen/zipstream-php)
|
||||
[](https://packagist.org/packages/maennchen/zipstream-php)
|
||||
[](https://opencollective.com/zipstream) [](LICENSE)
|
||||
|
||||
## Overview
|
||||
|
||||
A fast and simple streaming zip file downloader for PHP. Using this library will save you from having to write the Zip to disk. You can directly send it to the user, which is much faster. It can work with S3 buckets or any PSR7 Stream.
|
||||
|
||||
Please see the [LICENSE](LICENSE) file for licensing and warranty information.
|
||||
|
||||
## Installation
|
||||
|
||||
Simply add a dependency on maennchen/zipstream-php to your project's composer.json file if you use Composer to manage the dependencies of your project. Use following command to add the package to your project's dependencies:
|
||||
|
||||
```bash
|
||||
composer require maennchen/zipstream-php
|
||||
```
|
||||
|
||||
## Usage and options
|
||||
|
||||
Here's a simple example:
|
||||
|
||||
```php
|
||||
// Autoload the dependencies
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
// enable output of HTTP headers
|
||||
$options = new ZipStream\Option\Archive();
|
||||
$options->setSendHttpHeaders(true);
|
||||
|
||||
// create a new zipstream object
|
||||
$zip = new ZipStream\ZipStream('example.zip', $options);
|
||||
|
||||
// create a file named 'hello.txt'
|
||||
$zip->addFile('hello.txt', 'This is the contents of hello.txt');
|
||||
|
||||
// add a file named 'some_image.jpg' from a local file 'path/to/image.jpg'
|
||||
$zip->addFileFromPath('some_image.jpg', 'path/to/image.jpg');
|
||||
|
||||
// add a file named 'goodbye.txt' from an open stream resource
|
||||
$fp = tmpfile();
|
||||
fwrite($fp, 'The quick brown fox jumped over the lazy dog.');
|
||||
rewind($fp);
|
||||
$zip->addFileFromStream('goodbye.txt', $fp);
|
||||
fclose($fp);
|
||||
|
||||
// finish the zip stream
|
||||
$zip->finish();
|
||||
```
|
||||
|
||||
You can also add comments, modify file timestamps, and customize (or
|
||||
disable) the HTTP headers. It is also possible to specify the storage method when adding files,
|
||||
the current default storage method is 'deflate' i.e files are stored with Compression mode 0x08.
|
||||
|
||||
See the [Wiki](https://github.com/maennchen/ZipStream-PHP/wiki) for details.
|
||||
|
||||
## Known issue
|
||||
|
||||
The native Mac OS archive extraction tool might not open archives in some conditions. A workaround is to disable the Zip64 feature with the option `$opt->setEnableZip64(false)`. This limits the archive to 4 Gb and 64k files but will allow Mac OS users to open them without issue. See #116.
|
||||
|
||||
The linux `unzip` utility might not handle properly unicode characters. It is recommended to extract with another tool like [7-zip](https://www.7-zip.org/). See #146.
|
||||
|
||||
## Upgrade to version 2.0.0
|
||||
|
||||
* Only the self opened streams will be closed (#139)
|
||||
If you were relying on ZipStream to close streams that the library didn't open,
|
||||
you'll need to close them yourself now.
|
||||
|
||||
## Upgrade to version 1.0.0
|
||||
|
||||
* All options parameters to all function have been moved from an `array` to structured option objects. See [the wiki](https://github.com/maennchen/ZipStream-PHP/wiki/Available-options) for examples.
|
||||
* The whole library has been refactored. The minimal PHP requirement has been raised to PHP 7.1.
|
||||
|
||||
## Usage with Symfony and S3
|
||||
|
||||
You can find example code on [the wiki](https://github.com/maennchen/ZipStream-PHP/wiki/Symfony-example).
|
||||
|
||||
## Contributing
|
||||
|
||||
ZipStream-PHP is a collaborative project. Please take a look at the [CONTRIBUTING.md](CONTRIBUTING.md) file.
|
||||
|
||||
## About the Authors
|
||||
|
||||
* Paul Duncan <pabs@pablotron.org> - https://pablotron.org/
|
||||
* Jonatan Männchen <jonatan@maennchen.ch> - https://maennchen.dev
|
||||
* Jesse G. Donat <donatj@gmail.com> - https://donatstudios.com
|
||||
* Nicolas CARPi <nico-git@deltablot.email> - https://www.deltablot.com
|
||||
* Nik Barham <nik@brokencube.co.uk> - https://www.brokencube.co.uk
|
||||
|
||||
## Contributors
|
||||
|
||||
### Code Contributors
|
||||
|
||||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
|
||||
<a href="https://github.com/maennchen/ZipStream-PHP/graphs/contributors"><img src="https://opencollective.com/zipstream/contributors.svg?width=890&button=false" /></a>
|
||||
|
||||
### Financial Contributors
|
||||
|
||||
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/zipstream/contribute)]
|
||||
|
||||
#### Individuals
|
||||
|
||||
<a href="https://opencollective.com/zipstream"><img src="https://opencollective.com/zipstream/individuals.svg?width=890"></a>
|
||||
|
||||
#### Organizations
|
||||
|
||||
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/zipstream/contribute)]
|
||||
|
||||
<a href="https://opencollective.com/zipstream/organization/0/website"><img src="https://opencollective.com/zipstream/organization/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/zipstream/organization/1/website"><img src="https://opencollective.com/zipstream/organization/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/zipstream/organization/2/website"><img src="https://opencollective.com/zipstream/organization/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/zipstream/organization/3/website"><img src="https://opencollective.com/zipstream/organization/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/zipstream/organization/4/website"><img src="https://opencollective.com/zipstream/organization/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/zipstream/organization/5/website"><img src="https://opencollective.com/zipstream/organization/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/zipstream/organization/6/website"><img src="https://opencollective.com/zipstream/organization/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/zipstream/organization/7/website"><img src="https://opencollective.com/zipstream/organization/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/zipstream/organization/8/website"><img src="https://opencollective.com/zipstream/organization/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/zipstream/organization/9/website"><img src="https://opencollective.com/zipstream/organization/9/avatar.svg"></a>
|
||||
41
vendor/maennchen/zipstream-php/composer.json
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "maennchen/zipstream-php",
|
||||
"description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
|
||||
"keywords": ["zip", "stream"],
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"authors": [{
|
||||
"name": "Paul Duncan",
|
||||
"email": "pabs@pablotron.org"
|
||||
},
|
||||
{
|
||||
"name": "Jonatan Männchen",
|
||||
"email": "jonatan@maennchen.ch"
|
||||
},
|
||||
{
|
||||
"name": "Jesse Donat",
|
||||
"email": "donatj@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "András Kolesár",
|
||||
"email": "kolesar@kolesar.hu"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">= 7.1",
|
||||
"symfony/polyfill-mbstring": "^1.0",
|
||||
"psr/http-message": "^1.0",
|
||||
"myclabs/php-enum": "^1.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": ">= 7.5",
|
||||
"guzzlehttp/guzzle": ">= 6.3",
|
||||
"ext-zip": "*",
|
||||
"mikey179/vfsstream": "^1.6"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"ZipStream\\": "src/"
|
||||
}
|
||||
}
|
||||
}
|
||||
17
vendor/maennchen/zipstream-php/phpunit.xml.dist
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
<phpunit bootstrap="test/bootstrap.php">
|
||||
<testsuites>
|
||||
<testsuite name="Application">
|
||||
<directory>test</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<logging>
|
||||
<log type="coverage-clover" target="clover.xml"/>
|
||||
</logging>
|
||||
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">src</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
55
vendor/maennchen/zipstream-php/psalm.xml
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0"?>
|
||||
<psalm
|
||||
totallyTyped="false"
|
||||
resolveFromConfigFile="true"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="https://getpsalm.org/schema/config"
|
||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
||||
>
|
||||
<projectFiles>
|
||||
<directory name="src" />
|
||||
<ignoreFiles>
|
||||
<directory name="vendor" />
|
||||
</ignoreFiles>
|
||||
</projectFiles>
|
||||
|
||||
<issueHandlers>
|
||||
<LessSpecificReturnType errorLevel="info" />
|
||||
|
||||
<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives -->
|
||||
|
||||
<DeprecatedMethod errorLevel="info" />
|
||||
<DeprecatedProperty errorLevel="info" />
|
||||
<DeprecatedClass errorLevel="info" />
|
||||
<DeprecatedConstant errorLevel="info" />
|
||||
<DeprecatedFunction errorLevel="info" />
|
||||
<DeprecatedInterface errorLevel="info" />
|
||||
<DeprecatedTrait errorLevel="info" />
|
||||
|
||||
<InternalMethod errorLevel="info" />
|
||||
<InternalProperty errorLevel="info" />
|
||||
<InternalClass errorLevel="info" />
|
||||
|
||||
<MissingClosureReturnType errorLevel="info" />
|
||||
<MissingReturnType errorLevel="info" />
|
||||
<MissingPropertyType errorLevel="info" />
|
||||
<InvalidDocblock errorLevel="info" />
|
||||
<MisplacedRequiredParam errorLevel="info" />
|
||||
|
||||
<PropertyNotSetInConstructor errorLevel="info" />
|
||||
<MissingConstructor errorLevel="info" />
|
||||
<MissingClosureParamType errorLevel="info" />
|
||||
<MissingParamType errorLevel="info" />
|
||||
|
||||
<RedundantCondition errorLevel="info" />
|
||||
|
||||
<DocblockTypeContradiction errorLevel="info" />
|
||||
<RedundantConditionGivenDocblockType errorLevel="info" />
|
||||
|
||||
<UnresolvableInclude errorLevel="info" />
|
||||
|
||||
<RawObjectIteration errorLevel="info" />
|
||||
|
||||
<InvalidStringClass errorLevel="info" />
|
||||
</issueHandlers>
|
||||
</psalm>
|
||||
172
vendor/maennchen/zipstream-php/src/Bigint.php
vendored
Normal file
@ -0,0 +1,172 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream;
|
||||
|
||||
use OverflowException;
|
||||
|
||||
class Bigint
|
||||
{
|
||||
/**
|
||||
* @var int[]
|
||||
*/
|
||||
private $bytes = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||
|
||||
/**
|
||||
* Initialize the bytes array
|
||||
*
|
||||
* @param int $value
|
||||
*/
|
||||
public function __construct(int $value = 0)
|
||||
{
|
||||
$this->fillBytes($value, 0, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill the bytes field with int
|
||||
*
|
||||
* @param int $value
|
||||
* @param int $start
|
||||
* @param int $count
|
||||
* @return void
|
||||
*/
|
||||
protected function fillBytes(int $value, int $start, int $count): void
|
||||
{
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$this->bytes[$start + $i] = $i >= PHP_INT_SIZE ? 0 : $value & 0xFF;
|
||||
$value >>= 8;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an instance
|
||||
*
|
||||
* @param int $value
|
||||
* @return Bigint
|
||||
*/
|
||||
public static function init(int $value = 0): self
|
||||
{
|
||||
return new self($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill bytes from low to high
|
||||
*
|
||||
* @param int $low
|
||||
* @param int $high
|
||||
* @return Bigint
|
||||
*/
|
||||
public static function fromLowHigh(int $low, int $high): self
|
||||
{
|
||||
$bigint = new Bigint();
|
||||
$bigint->fillBytes($low, 0, 4);
|
||||
$bigint->fillBytes($high, 4, 4);
|
||||
return $bigint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get high 32
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getHigh32(): int
|
||||
{
|
||||
return $this->getValue(4, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get value from bytes array
|
||||
*
|
||||
* @param int $end
|
||||
* @param int $length
|
||||
* @return int
|
||||
*/
|
||||
public function getValue(int $end = 0, int $length = 8): int
|
||||
{
|
||||
$result = 0;
|
||||
for ($i = $end + $length - 1; $i >= $end; $i--) {
|
||||
$result <<= 8;
|
||||
$result |= $this->bytes[$i];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get low FF
|
||||
*
|
||||
* @param bool $force
|
||||
* @return float
|
||||
*/
|
||||
public function getLowFF(bool $force = false): float
|
||||
{
|
||||
if ($force || $this->isOver32()) {
|
||||
return (float)0xFFFFFFFF;
|
||||
}
|
||||
return (float)$this->getLow32();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if is over 32
|
||||
*
|
||||
* @param bool $force
|
||||
* @return bool
|
||||
*/
|
||||
public function isOver32(bool $force = false): bool
|
||||
{
|
||||
// value 0xFFFFFFFF already needs a Zip64 header
|
||||
return $force ||
|
||||
max(array_slice($this->bytes, 4, 4)) > 0 ||
|
||||
min(array_slice($this->bytes, 0, 4)) === 0xFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get low 32
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getLow32(): int
|
||||
{
|
||||
return $this->getValue(0, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get hexadecimal
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHex64(): string
|
||||
{
|
||||
$result = '0x';
|
||||
for ($i = 7; $i >= 0; $i--) {
|
||||
$result .= sprintf('%02X', $this->bytes[$i]);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add
|
||||
*
|
||||
* @param Bigint $other
|
||||
* @return Bigint
|
||||
*/
|
||||
public function add(Bigint $other): Bigint
|
||||
{
|
||||
$result = clone $this;
|
||||
$overflow = false;
|
||||
for ($i = 0; $i < 8; $i++) {
|
||||
$result->bytes[$i] += $other->bytes[$i];
|
||||
if ($overflow) {
|
||||
$result->bytes[$i]++;
|
||||
$overflow = false;
|
||||
}
|
||||
if ($result->bytes[$i] & 0x100) {
|
||||
$overflow = true;
|
||||
$result->bytes[$i] &= 0xFF;
|
||||
}
|
||||
}
|
||||
if ($overflow) {
|
||||
throw new OverflowException;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
70
vendor/maennchen/zipstream-php/src/DeflateStream.php
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream;
|
||||
|
||||
class DeflateStream extends Stream
|
||||
{
|
||||
protected $filter;
|
||||
|
||||
/**
|
||||
* @var Option\File
|
||||
*/
|
||||
protected $options;
|
||||
|
||||
/**
|
||||
* Rewind stream
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function rewind(): void
|
||||
{
|
||||
// deflate filter needs to be removed before rewind
|
||||
if ($this->filter) {
|
||||
$this->removeDeflateFilter();
|
||||
$this->seek(0);
|
||||
$this->addDeflateFilter($this->options);
|
||||
} else {
|
||||
rewind($this->stream);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the deflate filter
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function removeDeflateFilter(): void
|
||||
{
|
||||
if (!$this->filter) {
|
||||
return;
|
||||
}
|
||||
stream_filter_remove($this->filter);
|
||||
$this->filter = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a deflate filter
|
||||
*
|
||||
* @param Option\File $options
|
||||
* @return void
|
||||
*/
|
||||
public function addDeflateFilter(Option\File $options): void
|
||||
{
|
||||
$this->options = $options;
|
||||
// parameter 4 for stream_filter_append expects array
|
||||
// so we convert the option object in an array
|
||||
$optionsArr = [
|
||||
'comment' => $options->getComment(),
|
||||
'method' => $options->getMethod(),
|
||||
'deflateLevel' => $options->getDeflateLevel(),
|
||||
'time' => $options->getTime()
|
||||
];
|
||||
$this->filter = stream_filter_append(
|
||||
$this->stream,
|
||||
'zlib.deflate',
|
||||
STREAM_FILTER_READ,
|
||||
$optionsArr
|
||||
);
|
||||
}
|
||||
}
|
||||
11
vendor/maennchen/zipstream-php/src/Exception.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream;
|
||||
|
||||
/**
|
||||
* This class is only for inheriting
|
||||
*/
|
||||
abstract class Exception extends \Exception
|
||||
{
|
||||
}
|
||||
13
vendor/maennchen/zipstream-php/src/Exception/EncodingException.php
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream\Exception;
|
||||
|
||||
use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if file or comment encoding is incorrect
|
||||
*/
|
||||
class EncodingException extends Exception
|
||||
{
|
||||
}
|
||||
22
vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream\Exception;
|
||||
|
||||
use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if a file wasn't found
|
||||
*/
|
||||
class FileNotFoundException extends Exception
|
||||
{
|
||||
/**
|
||||
* Constructor of the Exception
|
||||
*
|
||||
* @param String $path - The path which wasn't found
|
||||
*/
|
||||
public function __construct(string $path)
|
||||
{
|
||||
parent::__construct("The file with the path $path wasn't found.");
|
||||
}
|
||||
}
|
||||
22
vendor/maennchen/zipstream-php/src/Exception/FileNotReadableException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream\Exception;
|
||||
|
||||
use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if a file wasn't found
|
||||
*/
|
||||
class FileNotReadableException extends Exception
|
||||
{
|
||||
/**
|
||||
* Constructor of the Exception
|
||||
*
|
||||
* @param String $path - The path which wasn't found
|
||||
*/
|
||||
public function __construct(string $path)
|
||||
{
|
||||
parent::__construct("The file with the path $path isn't readable.");
|
||||
}
|
||||
}
|
||||
13
vendor/maennchen/zipstream-php/src/Exception/IncompatibleOptionsException.php
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream\Exception;
|
||||
|
||||
use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if options are incompatible
|
||||
*/
|
||||
class IncompatibleOptionsException extends Exception
|
||||
{
|
||||
}
|
||||
17
vendor/maennchen/zipstream-php/src/Exception/OverflowException.php
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream\Exception;
|
||||
|
||||
use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if a counter value exceeds storage size
|
||||
*/
|
||||
class OverflowException extends Exception
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('File size exceeds limit of 32 bit integer. Please enable "zip64" option.');
|
||||
}
|
||||
}
|
||||
22
vendor/maennchen/zipstream-php/src/Exception/StreamNotReadableException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream\Exception;
|
||||
|
||||
use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if `fread` fails on a stream.
|
||||
*/
|
||||
class StreamNotReadableException extends Exception
|
||||
{
|
||||
/**
|
||||
* Constructor of the Exception
|
||||
*
|
||||
* @param string $fileName - The name of the file which the stream belongs to.
|
||||
*/
|
||||
public function __construct(string $fileName)
|
||||
{
|
||||
parent::__construct("The stream for $fileName could not be read.");
|
||||
}
|
||||
}
|
||||
477
vendor/maennchen/zipstream-php/src/File.php
vendored
Normal file
@ -0,0 +1,477 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream;
|
||||
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use ZipStream\Exception\EncodingException;
|
||||
use ZipStream\Exception\FileNotFoundException;
|
||||
use ZipStream\Exception\FileNotReadableException;
|
||||
use ZipStream\Exception\OverflowException;
|
||||
use ZipStream\Option\File as FileOptions;
|
||||
use ZipStream\Option\Method;
|
||||
use ZipStream\Option\Version;
|
||||
|
||||
class File
|
||||
{
|
||||
const HASH_ALGORITHM = 'crc32b';
|
||||
|
||||
const BIT_ZERO_HEADER = 0x0008;
|
||||
const BIT_EFS_UTF8 = 0x0800;
|
||||
|
||||
const COMPUTE = 1;
|
||||
const SEND = 2;
|
||||
|
||||
private const CHUNKED_READ_BLOCK_SIZE = 1048576;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* @var FileOptions
|
||||
*/
|
||||
public $opt;
|
||||
|
||||
/**
|
||||
* @var Bigint
|
||||
*/
|
||||
public $len;
|
||||
/**
|
||||
* @var Bigint
|
||||
*/
|
||||
public $zlen;
|
||||
|
||||
/** @var int */
|
||||
public $crc;
|
||||
|
||||
/**
|
||||
* @var Bigint
|
||||
*/
|
||||
public $hlen;
|
||||
|
||||
/**
|
||||
* @var Bigint
|
||||
*/
|
||||
public $ofs;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $bits;
|
||||
|
||||
/**
|
||||
* @var Version
|
||||
*/
|
||||
public $version;
|
||||
|
||||
/**
|
||||
* @var ZipStream
|
||||
*/
|
||||
public $zip;
|
||||
|
||||
/**
|
||||
* @var resource
|
||||
*/
|
||||
private $deflate;
|
||||
/**
|
||||
* @var resource
|
||||
*/
|
||||
private $hash;
|
||||
|
||||
/**
|
||||
* @var Method
|
||||
*/
|
||||
private $method;
|
||||
|
||||
/**
|
||||
* @var Bigint
|
||||
*/
|
||||
private $totalLength;
|
||||
|
||||
public function __construct(ZipStream $zip, string $name, ?FileOptions $opt = null)
|
||||
{
|
||||
$this->zip = $zip;
|
||||
|
||||
$this->name = $name;
|
||||
$this->opt = $opt ?: new FileOptions();
|
||||
$this->method = $this->opt->getMethod();
|
||||
$this->version = Version::STORE();
|
||||
$this->ofs = new Bigint();
|
||||
}
|
||||
|
||||
public function processPath(string $path): void
|
||||
{
|
||||
if (!is_readable($path)) {
|
||||
if (!file_exists($path)) {
|
||||
throw new FileNotFoundException($path);
|
||||
}
|
||||
throw new FileNotReadableException($path);
|
||||
}
|
||||
if ($this->zip->isLargeFile($path) === false) {
|
||||
$data = file_get_contents($path);
|
||||
$this->processData($data);
|
||||
} else {
|
||||
$this->method = $this->zip->opt->getLargeFileMethod();
|
||||
|
||||
$stream = new DeflateStream(fopen($path, 'rb'));
|
||||
$this->processStream($stream);
|
||||
$stream->close();
|
||||
}
|
||||
}
|
||||
|
||||
public function processData(string $data): void
|
||||
{
|
||||
$this->len = new Bigint(strlen($data));
|
||||
$this->crc = crc32($data);
|
||||
|
||||
// compress data if needed
|
||||
if ($this->method->equals(Method::DEFLATE())) {
|
||||
$data = gzdeflate($data);
|
||||
}
|
||||
|
||||
$this->zlen = new Bigint(strlen($data));
|
||||
$this->addFileHeader();
|
||||
$this->zip->send($data);
|
||||
$this->addFileFooter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and send zip header for this file.
|
||||
*
|
||||
* @return void
|
||||
* @throws \ZipStream\Exception\EncodingException
|
||||
*/
|
||||
public function addFileHeader(): void
|
||||
{
|
||||
$name = static::filterFilename($this->name);
|
||||
|
||||
// calculate name length
|
||||
$nameLength = strlen($name);
|
||||
|
||||
// create dos timestamp
|
||||
$time = static::dosTime($this->opt->getTime()->getTimestamp());
|
||||
|
||||
$comment = $this->opt->getComment();
|
||||
|
||||
if (!mb_check_encoding($name, 'ASCII') ||
|
||||
!mb_check_encoding($comment, 'ASCII')) {
|
||||
// Sets Bit 11: Language encoding flag (EFS). If this bit is set,
|
||||
// the filename and comment fields for this file
|
||||
// MUST be encoded using UTF-8. (see APPENDIX D)
|
||||
if (!mb_check_encoding($name, 'UTF-8') ||
|
||||
!mb_check_encoding($comment, 'UTF-8')) {
|
||||
throw new EncodingException(
|
||||
'File name and comment should use UTF-8 ' .
|
||||
'if one of them does not fit into ASCII range.'
|
||||
);
|
||||
}
|
||||
$this->bits |= self::BIT_EFS_UTF8;
|
||||
}
|
||||
|
||||
if ($this->method->equals(Method::DEFLATE())) {
|
||||
$this->version = Version::DEFLATE();
|
||||
}
|
||||
|
||||
$force = (boolean)($this->bits & self::BIT_ZERO_HEADER) &&
|
||||
$this->zip->opt->isEnableZip64();
|
||||
|
||||
$footer = $this->buildZip64ExtraBlock($force);
|
||||
|
||||
// If this file will start over 4GB limit in ZIP file,
|
||||
// CDR record will have to use Zip64 extension to describe offset
|
||||
// to keep consistency we use the same value here
|
||||
if ($this->zip->ofs->isOver32()) {
|
||||
$this->version = Version::ZIP64();
|
||||
}
|
||||
|
||||
$fields = [
|
||||
['V', ZipStream::FILE_HEADER_SIGNATURE],
|
||||
['v', $this->version->getValue()], // Version needed to Extract
|
||||
['v', $this->bits], // General purpose bit flags - data descriptor flag set
|
||||
['v', $this->method->getValue()], // Compression method
|
||||
['V', $time], // Timestamp (DOS Format)
|
||||
['V', $this->crc], // CRC32 of data (0 -> moved to data descriptor footer)
|
||||
['V', $this->zlen->getLowFF($force)], // Length of compressed data (forced to 0xFFFFFFFF for zero header)
|
||||
['V', $this->len->getLowFF($force)], // Length of original data (forced to 0xFFFFFFFF for zero header)
|
||||
['v', $nameLength], // Length of filename
|
||||
['v', strlen($footer)], // Extra data (see above)
|
||||
];
|
||||
|
||||
// pack fields and calculate "total" length
|
||||
$header = ZipStream::packFields($fields);
|
||||
|
||||
// print header and filename
|
||||
$data = $header . $name . $footer;
|
||||
$this->zip->send($data);
|
||||
|
||||
// save header length
|
||||
$this->hlen = Bigint::init(strlen($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip characters that are not legal in Windows filenames
|
||||
* to prevent compatibility issues
|
||||
*
|
||||
* @param string $filename Unprocessed filename
|
||||
* @return string
|
||||
*/
|
||||
public static function filterFilename(string $filename): string
|
||||
{
|
||||
// strip leading slashes from file name
|
||||
// (fixes bug in windows archive viewer)
|
||||
$filename = preg_replace('/^\\/+/', '', $filename);
|
||||
|
||||
return str_replace(['\\', ':', '*', '?', '"', '<', '>', '|'], '_', $filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a UNIX timestamp to a DOS timestamp.
|
||||
*
|
||||
* @param int $when
|
||||
* @return int DOS Timestamp
|
||||
*/
|
||||
final protected static function dosTime(int $when): int
|
||||
{
|
||||
// get date array for timestamp
|
||||
$d = getdate($when);
|
||||
|
||||
// set lower-bound on dates
|
||||
if ($d['year'] < 1980) {
|
||||
$d = array(
|
||||
'year' => 1980,
|
||||
'mon' => 1,
|
||||
'mday' => 1,
|
||||
'hours' => 0,
|
||||
'minutes' => 0,
|
||||
'seconds' => 0
|
||||
);
|
||||
}
|
||||
|
||||
// remove extra years from 1980
|
||||
$d['year'] -= 1980;
|
||||
|
||||
// return date string
|
||||
return
|
||||
($d['year'] << 25) |
|
||||
($d['mon'] << 21) |
|
||||
($d['mday'] << 16) |
|
||||
($d['hours'] << 11) |
|
||||
($d['minutes'] << 5) |
|
||||
($d['seconds'] >> 1);
|
||||
}
|
||||
|
||||
protected function buildZip64ExtraBlock(bool $force = false): string
|
||||
{
|
||||
|
||||
$fields = [];
|
||||
if ($this->len->isOver32($force)) {
|
||||
$fields[] = ['P', $this->len]; // Length of original data
|
||||
}
|
||||
|
||||
if ($this->len->isOver32($force)) {
|
||||
$fields[] = ['P', $this->zlen]; // Length of compressed data
|
||||
}
|
||||
|
||||
if ($this->ofs->isOver32()) {
|
||||
$fields[] = ['P', $this->ofs]; // Offset of local header record
|
||||
}
|
||||
|
||||
if (!empty($fields)) {
|
||||
if (!$this->zip->opt->isEnableZip64()) {
|
||||
throw new OverflowException();
|
||||
}
|
||||
|
||||
array_unshift(
|
||||
$fields,
|
||||
['v', 0x0001], // 64 bit extension
|
||||
['v', count($fields) * 8] // Length of data block
|
||||
);
|
||||
$this->version = Version::ZIP64();
|
||||
}
|
||||
|
||||
return ZipStream::packFields($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and send data descriptor footer for this file.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function addFileFooter(): void
|
||||
{
|
||||
|
||||
if ($this->bits & self::BIT_ZERO_HEADER) {
|
||||
// compressed and uncompressed size
|
||||
$sizeFormat = 'V';
|
||||
if ($this->zip->opt->isEnableZip64()) {
|
||||
$sizeFormat = 'P';
|
||||
}
|
||||
$fields = [
|
||||
['V', ZipStream::DATA_DESCRIPTOR_SIGNATURE],
|
||||
['V', $this->crc], // CRC32
|
||||
[$sizeFormat, $this->zlen], // Length of compressed data
|
||||
[$sizeFormat, $this->len], // Length of original data
|
||||
];
|
||||
|
||||
$footer = ZipStream::packFields($fields);
|
||||
$this->zip->send($footer);
|
||||
} else {
|
||||
$footer = '';
|
||||
}
|
||||
$this->totalLength = $this->hlen->add($this->zlen)->add(Bigint::init(strlen($footer)));
|
||||
$this->zip->addToCdr($this);
|
||||
}
|
||||
|
||||
public function processStream(StreamInterface $stream): void
|
||||
{
|
||||
$this->zlen = new Bigint();
|
||||
$this->len = new Bigint();
|
||||
|
||||
if ($this->zip->opt->isZeroHeader()) {
|
||||
$this->processStreamWithZeroHeader($stream);
|
||||
} else {
|
||||
$this->processStreamWithComputedHeader($stream);
|
||||
}
|
||||
}
|
||||
|
||||
protected function processStreamWithZeroHeader(StreamInterface $stream): void
|
||||
{
|
||||
$this->bits |= self::BIT_ZERO_HEADER;
|
||||
$this->addFileHeader();
|
||||
$this->readStream($stream, self::COMPUTE | self::SEND);
|
||||
$this->addFileFooter();
|
||||
}
|
||||
|
||||
protected function readStream(StreamInterface $stream, ?int $options = null): void
|
||||
{
|
||||
$this->deflateInit();
|
||||
$total = 0;
|
||||
$size = $this->opt->getSize();
|
||||
while (!$stream->eof() && ($size === 0 || $total < $size)) {
|
||||
$data = $stream->read(self::CHUNKED_READ_BLOCK_SIZE);
|
||||
$total += strlen($data);
|
||||
if ($size > 0 && $total > $size) {
|
||||
$data = substr($data, 0 , strlen($data)-($total - $size));
|
||||
}
|
||||
$this->deflateData($stream, $data, $options);
|
||||
if ($options & self::SEND) {
|
||||
$this->zip->send($data);
|
||||
}
|
||||
}
|
||||
$this->deflateFinish($options);
|
||||
}
|
||||
|
||||
protected function deflateInit(): void
|
||||
{
|
||||
$this->hash = hash_init(self::HASH_ALGORITHM);
|
||||
if ($this->method->equals(Method::DEFLATE())) {
|
||||
$this->deflate = deflate_init(
|
||||
ZLIB_ENCODING_RAW,
|
||||
['level' => $this->opt->getDeflateLevel()]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected function deflateData(StreamInterface $stream, string &$data, ?int $options = null): void
|
||||
{
|
||||
if ($options & self::COMPUTE) {
|
||||
$this->len = $this->len->add(Bigint::init(strlen($data)));
|
||||
hash_update($this->hash, $data);
|
||||
}
|
||||
if ($this->deflate) {
|
||||
$data = deflate_add(
|
||||
$this->deflate,
|
||||
$data,
|
||||
$stream->eof()
|
||||
? ZLIB_FINISH
|
||||
: ZLIB_NO_FLUSH
|
||||
);
|
||||
}
|
||||
if ($options & self::COMPUTE) {
|
||||
$this->zlen = $this->zlen->add(Bigint::init(strlen($data)));
|
||||
}
|
||||
}
|
||||
|
||||
protected function deflateFinish(?int $options = null): void
|
||||
{
|
||||
if ($options & self::COMPUTE) {
|
||||
$this->crc = hexdec(hash_final($this->hash));
|
||||
}
|
||||
}
|
||||
|
||||
protected function processStreamWithComputedHeader(StreamInterface $stream): void
|
||||
{
|
||||
$this->readStream($stream, self::COMPUTE);
|
||||
$stream->rewind();
|
||||
|
||||
// incremental compression with deflate_add
|
||||
// makes this second read unnecessary
|
||||
// but it is only available from PHP 7.0
|
||||
if (!$this->deflate && $stream instanceof DeflateStream && $this->method->equals(Method::DEFLATE())) {
|
||||
$stream->addDeflateFilter($this->opt);
|
||||
$this->zlen = new Bigint();
|
||||
while (!$stream->eof()) {
|
||||
$data = $stream->read(self::CHUNKED_READ_BLOCK_SIZE);
|
||||
$this->zlen = $this->zlen->add(Bigint::init(strlen($data)));
|
||||
}
|
||||
$stream->rewind();
|
||||
}
|
||||
|
||||
$this->addFileHeader();
|
||||
$this->readStream($stream, self::SEND);
|
||||
$this->addFileFooter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Send CDR record for specified file.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCdrFile(): string
|
||||
{
|
||||
$name = static::filterFilename($this->name);
|
||||
|
||||
// get attributes
|
||||
$comment = $this->opt->getComment();
|
||||
|
||||
// get dos timestamp
|
||||
$time = static::dosTime($this->opt->getTime()->getTimestamp());
|
||||
|
||||
$footer = $this->buildZip64ExtraBlock();
|
||||
|
||||
$fields = [
|
||||
['V', ZipStream::CDR_FILE_SIGNATURE], // Central file header signature
|
||||
['v', ZipStream::ZIP_VERSION_MADE_BY], // Made by version
|
||||
['v', $this->version->getValue()], // Extract by version
|
||||
['v', $this->bits], // General purpose bit flags - data descriptor flag set
|
||||
['v', $this->method->getValue()], // Compression method
|
||||
['V', $time], // Timestamp (DOS Format)
|
||||
['V', $this->crc], // CRC32
|
||||
['V', $this->zlen->getLowFF()], // Compressed Data Length
|
||||
['V', $this->len->getLowFF()], // Original Data Length
|
||||
['v', strlen($name)], // Length of filename
|
||||
['v', strlen($footer)], // Extra data len (see above)
|
||||
['v', strlen($comment)], // Length of comment
|
||||
['v', 0], // Disk number
|
||||
['v', 0], // Internal File Attributes
|
||||
['V', 32], // External File Attributes
|
||||
['V', $this->ofs->getLowFF()] // Relative offset of local header
|
||||
];
|
||||
|
||||
// pack fields, then append name and comment
|
||||
$header = ZipStream::packFields($fields);
|
||||
|
||||
return $header . $name . $footer . $comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Bigint
|
||||
*/
|
||||
public function getTotalLength(): Bigint
|
||||
{
|
||||
return $this->totalLength;
|
||||
}
|
||||
}
|
||||
261
vendor/maennchen/zipstream-php/src/Option/Archive.php
vendored
Normal file
@ -0,0 +1,261 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream\Option;
|
||||
|
||||
final class Archive
|
||||
{
|
||||
const DEFAULT_DEFLATE_LEVEL = 6;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $comment = '';
|
||||
/**
|
||||
* Size, in bytes, of the largest file to try
|
||||
* and load into memory (used by
|
||||
* addFileFromPath()). Large files may also
|
||||
* be compressed differently; see the
|
||||
* 'largeFileMethod' option. Default is ~20 Mb.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $largeFileSize = 20 * 1024 * 1024;
|
||||
/**
|
||||
* How to handle large files. Legal values are
|
||||
* Method::STORE() (the default), or
|
||||
* Method::DEFLATE(). STORE sends the file
|
||||
* raw and is significantly
|
||||
* faster, while DEFLATE compresses the file
|
||||
* and is much, much slower. Note that DEFLATE
|
||||
* must compress the file twice and is extremely slow.
|
||||
*
|
||||
* @var Method
|
||||
*/
|
||||
private $largeFileMethod;
|
||||
/**
|
||||
* Boolean indicating whether or not to send
|
||||
* the HTTP headers for this file.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $sendHttpHeaders = false;
|
||||
/**
|
||||
* The method called to send headers
|
||||
*
|
||||
* @var Callable
|
||||
*/
|
||||
private $httpHeaderCallback = 'header';
|
||||
/**
|
||||
* Enable Zip64 extension, supporting very large
|
||||
* archives (any size > 4 GB or file count > 64k)
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $enableZip64 = true;
|
||||
/**
|
||||
* Enable streaming files with single read where
|
||||
* general purpose bit 3 indicates local file header
|
||||
* contain zero values in crc and size fields,
|
||||
* these appear only after file contents
|
||||
* in data descriptor block.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $zeroHeader = false;
|
||||
/**
|
||||
* Enable reading file stat for determining file size.
|
||||
* When a 32-bit system reads file size that is
|
||||
* over 2 GB, invalid value appears in file size
|
||||
* due to integer overflow. Should be disabled on
|
||||
* 32-bit systems with method addFileFromPath
|
||||
* if any file may exceed 2 GB. In this case file
|
||||
* will be read in blocks and correct size will be
|
||||
* determined from content.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $statFiles = true;
|
||||
/**
|
||||
* Enable flush after every write to output stream.
|
||||
* @var bool
|
||||
*/
|
||||
private $flushOutput = false;
|
||||
/**
|
||||
* HTTP Content-Disposition. Defaults to
|
||||
* 'attachment', where
|
||||
* FILENAME is the specified filename.
|
||||
*
|
||||
* Note that this does nothing if you are
|
||||
* not sending HTTP headers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $contentDisposition = 'attachment';
|
||||
/**
|
||||
* Note that this does nothing if you are
|
||||
* not sending HTTP headers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $contentType = 'application/x-zip';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $deflateLevel = 6;
|
||||
|
||||
/**
|
||||
* @var resource
|
||||
*/
|
||||
private $outputStream;
|
||||
|
||||
/**
|
||||
* Options constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->largeFileMethod = Method::STORE();
|
||||
$this->outputStream = fopen('php://output', 'wb');
|
||||
}
|
||||
|
||||
public function getComment(): string
|
||||
{
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
public function setComment(string $comment): void
|
||||
{
|
||||
$this->comment = $comment;
|
||||
}
|
||||
|
||||
public function getLargeFileSize(): int
|
||||
{
|
||||
return $this->largeFileSize;
|
||||
}
|
||||
|
||||
public function setLargeFileSize(int $largeFileSize): void
|
||||
{
|
||||
$this->largeFileSize = $largeFileSize;
|
||||
}
|
||||
|
||||
public function getLargeFileMethod(): Method
|
||||
{
|
||||
return $this->largeFileMethod;
|
||||
}
|
||||
|
||||
public function setLargeFileMethod(Method $largeFileMethod): void
|
||||
{
|
||||
$this->largeFileMethod = $largeFileMethod;
|
||||
}
|
||||
|
||||
public function isSendHttpHeaders(): bool
|
||||
{
|
||||
return $this->sendHttpHeaders;
|
||||
}
|
||||
|
||||
public function setSendHttpHeaders(bool $sendHttpHeaders): void
|
||||
{
|
||||
$this->sendHttpHeaders = $sendHttpHeaders;
|
||||
}
|
||||
|
||||
public function getHttpHeaderCallback(): Callable
|
||||
{
|
||||
return $this->httpHeaderCallback;
|
||||
}
|
||||
|
||||
public function setHttpHeaderCallback(Callable $httpHeaderCallback): void
|
||||
{
|
||||
$this->httpHeaderCallback = $httpHeaderCallback;
|
||||
}
|
||||
|
||||
public function isEnableZip64(): bool
|
||||
{
|
||||
return $this->enableZip64;
|
||||
}
|
||||
|
||||
public function setEnableZip64(bool $enableZip64): void
|
||||
{
|
||||
$this->enableZip64 = $enableZip64;
|
||||
}
|
||||
|
||||
public function isZeroHeader(): bool
|
||||
{
|
||||
return $this->zeroHeader;
|
||||
}
|
||||
|
||||
public function setZeroHeader(bool $zeroHeader): void
|
||||
{
|
||||
$this->zeroHeader = $zeroHeader;
|
||||
}
|
||||
|
||||
public function isFlushOutput(): bool
|
||||
{
|
||||
return $this->flushOutput;
|
||||
}
|
||||
|
||||
public function setFlushOutput(bool $flushOutput): void
|
||||
{
|
||||
$this->flushOutput = $flushOutput;
|
||||
}
|
||||
|
||||
public function isStatFiles(): bool
|
||||
{
|
||||
return $this->statFiles;
|
||||
}
|
||||
|
||||
public function setStatFiles(bool $statFiles): void
|
||||
{
|
||||
$this->statFiles = $statFiles;
|
||||
}
|
||||
|
||||
public function getContentDisposition(): string
|
||||
{
|
||||
return $this->contentDisposition;
|
||||
}
|
||||
|
||||
public function setContentDisposition(string $contentDisposition): void
|
||||
{
|
||||
$this->contentDisposition = $contentDisposition;
|
||||
}
|
||||
|
||||
public function getContentType(): string
|
||||
{
|
||||
return $this->contentType;
|
||||
}
|
||||
|
||||
public function setContentType(string $contentType): void
|
||||
{
|
||||
$this->contentType = $contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return resource
|
||||
*/
|
||||
public function getOutputStream()
|
||||
{
|
||||
return $this->outputStream;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resource $outputStream
|
||||
*/
|
||||
public function setOutputStream($outputStream): void
|
||||
{
|
||||
$this->outputStream = $outputStream;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getDeflateLevel(): int
|
||||
{
|
||||
return $this->deflateLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $deflateLevel
|
||||
*/
|
||||
public function setDeflateLevel(int $deflateLevel): void
|
||||
{
|
||||
$this->deflateLevel = $deflateLevel;
|
||||
}
|
||||
}
|
||||
116
vendor/maennchen/zipstream-php/src/Option/File.php
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream\Option;
|
||||
|
||||
use DateTime;
|
||||
|
||||
final class File
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $comment = '';
|
||||
/**
|
||||
* @var Method
|
||||
*/
|
||||
private $method;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $deflateLevel;
|
||||
/**
|
||||
* @var DateTime
|
||||
*/
|
||||
private $time;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $size = 0;
|
||||
|
||||
public function defaultTo(Archive $archiveOptions): void
|
||||
{
|
||||
$this->deflateLevel = $this->deflateLevel ?: $archiveOptions->getDeflateLevel();
|
||||
$this->time = $this->time ?: new DateTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getComment(): string
|
||||
{
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $comment
|
||||
*/
|
||||
public function setComment(string $comment): void
|
||||
{
|
||||
$this->comment = $comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Method
|
||||
*/
|
||||
public function getMethod(): Method
|
||||
{
|
||||
return $this->method ?: Method::DEFLATE();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Method $method
|
||||
*/
|
||||
public function setMethod(Method $method): void
|
||||
{
|
||||
$this->method = $method;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getDeflateLevel(): int
|
||||
{
|
||||
return $this->deflateLevel ?: Archive::DEFAULT_DEFLATE_LEVEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $deflateLevel
|
||||
*/
|
||||
public function setDeflateLevel(int $deflateLevel): void
|
||||
{
|
||||
$this->deflateLevel = $deflateLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getTime(): DateTime
|
||||
{
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTime $time
|
||||
*/
|
||||
public function setTime(DateTime $time): void
|
||||
{
|
||||
$this->time = $time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSize(): int
|
||||
{
|
||||
return $this->size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $size
|
||||
*/
|
||||
public function setSize(int $size): void
|
||||
{
|
||||
$this->size = $size;
|
||||
}
|
||||
}
|
||||
19
vendor/maennchen/zipstream-php/src/Option/Method.php
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream\Option;
|
||||
|
||||
use MyCLabs\Enum\Enum;
|
||||
|
||||
/**
|
||||
* Methods enum
|
||||
*
|
||||
* @method static STORE(): Method
|
||||
* @method static DEFLATE(): Method
|
||||
* @psalm-immutable
|
||||
*/
|
||||
class Method extends Enum
|
||||
{
|
||||
const STORE = 0x00;
|
||||
const DEFLATE = 0x08;
|
||||
}
|
||||
22
vendor/maennchen/zipstream-php/src/Option/Version.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream\Option;
|
||||
|
||||
use MyCLabs\Enum\Enum;
|
||||
|
||||
/**
|
||||
* Class Version
|
||||
* @package ZipStream\Option
|
||||
*
|
||||
* @method static STORE(): Version
|
||||
* @method static DEFLATE(): Version
|
||||
* @method static ZIP64(): Version
|
||||
* @psalm-immutable
|
||||
*/
|
||||
class Version extends Enum
|
||||
{
|
||||
const STORE = 0x000A; // 1.00
|
||||
const DEFLATE = 0x0014; // 2.00
|
||||
const ZIP64 = 0x002D; // 4.50
|
||||
}
|
||||
253
vendor/maennchen/zipstream-php/src/Stream.php
vendored
Normal file
@ -0,0 +1,253 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream;
|
||||
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Describes a data stream.
|
||||
*
|
||||
* Typically, an instance will wrap a PHP stream; this interface provides
|
||||
* a wrapper around the most common operations, including serialization of
|
||||
* the entire stream to a string.
|
||||
*/
|
||||
class Stream implements StreamInterface
|
||||
{
|
||||
protected $stream;
|
||||
|
||||
public function __construct($stream)
|
||||
{
|
||||
$this->stream = $stream;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the stream and any underlying resources.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function close(): void
|
||||
{
|
||||
if (is_resource($this->stream)) {
|
||||
fclose($this->stream);
|
||||
}
|
||||
$this->detach();
|
||||
}
|
||||
|
||||
/**
|
||||
* Separates any underlying resources from the stream.
|
||||
*
|
||||
* After the stream has been detached, the stream is in an unusable state.
|
||||
*
|
||||
* @return resource|null Underlying PHP stream, if any
|
||||
*/
|
||||
public function detach()
|
||||
{
|
||||
$result = $this->stream;
|
||||
$this->stream = null;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads all data from the stream into a string, from the beginning to end.
|
||||
*
|
||||
* This method MUST attempt to seek to the beginning of the stream before
|
||||
* reading data and read the stream until the end is reached.
|
||||
*
|
||||
* Warning: This could attempt to load a large amount of data into memory.
|
||||
*
|
||||
* This method MUST NOT raise an exception in order to conform with PHP's
|
||||
* string casting operations.
|
||||
*
|
||||
* @see http://php.net/manual/en/language.oop5.magic.php#object.tostring
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
try {
|
||||
$this->seek(0);
|
||||
} catch (\RuntimeException $e) {}
|
||||
return (string) stream_get_contents($this->stream);
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek to a position in the stream.
|
||||
*
|
||||
* @link http://www.php.net/manual/en/function.fseek.php
|
||||
* @param int $offset Stream offset
|
||||
* @param int $whence Specifies how the cursor position will be calculated
|
||||
* based on the seek offset. Valid values are identical to the built-in
|
||||
* PHP $whence values for `fseek()`. SEEK_SET: Set position equal to
|
||||
* offset bytes SEEK_CUR: Set position to current location plus offset
|
||||
* SEEK_END: Set position to end-of-stream plus offset.
|
||||
* @throws \RuntimeException on failure.
|
||||
*/
|
||||
public function seek($offset, $whence = SEEK_SET): void
|
||||
{
|
||||
if (!$this->isSeekable()) {
|
||||
throw new RuntimeException;
|
||||
}
|
||||
if (fseek($this->stream, $offset, $whence) !== 0) {
|
||||
throw new RuntimeException;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the stream is seekable.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSeekable(): bool
|
||||
{
|
||||
return (bool)$this->getMetadata('seekable');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get stream metadata as an associative array or retrieve a specific key.
|
||||
*
|
||||
* The keys returned are identical to the keys returned from PHP's
|
||||
* stream_get_meta_data() function.
|
||||
*
|
||||
* @link http://php.net/manual/en/function.stream-get-meta-data.php
|
||||
* @param string $key Specific metadata to retrieve.
|
||||
* @return array|mixed|null Returns an associative array if no key is
|
||||
* provided. Returns a specific key value if a key is provided and the
|
||||
* value is found, or null if the key is not found.
|
||||
*/
|
||||
public function getMetadata($key = null)
|
||||
{
|
||||
$metadata = stream_get_meta_data($this->stream);
|
||||
return $key !== null ? @$metadata[$key] : $metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the size of the stream if known.
|
||||
*
|
||||
* @return int|null Returns the size in bytes if known, or null if unknown.
|
||||
*/
|
||||
public function getSize(): ?int
|
||||
{
|
||||
$stats = fstat($this->stream);
|
||||
return $stats['size'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current position of the file read/write pointer
|
||||
*
|
||||
* @return int Position of the file pointer
|
||||
* @throws \RuntimeException on error.
|
||||
*/
|
||||
public function tell(): int
|
||||
{
|
||||
$position = ftell($this->stream);
|
||||
if ($position === false) {
|
||||
throw new RuntimeException;
|
||||
}
|
||||
return $position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the stream is at the end of the stream.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function eof(): bool
|
||||
{
|
||||
return feof($this->stream);
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek to the beginning of the stream.
|
||||
*
|
||||
* If the stream is not seekable, this method will raise an exception;
|
||||
* otherwise, it will perform a seek(0).
|
||||
*
|
||||
* @see seek()
|
||||
* @link http://www.php.net/manual/en/function.fseek.php
|
||||
* @throws \RuntimeException on failure.
|
||||
*/
|
||||
public function rewind(): void
|
||||
{
|
||||
$this->seek(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Write data to the stream.
|
||||
*
|
||||
* @param string $string The string that is to be written.
|
||||
* @return int Returns the number of bytes written to the stream.
|
||||
* @throws \RuntimeException on failure.
|
||||
*/
|
||||
public function write($string): int
|
||||
{
|
||||
if (!$this->isWritable()) {
|
||||
throw new RuntimeException;
|
||||
}
|
||||
if (fwrite($this->stream, $string) === false) {
|
||||
throw new RuntimeException;
|
||||
}
|
||||
return \mb_strlen($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the stream is writable.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isWritable(): bool
|
||||
{
|
||||
return preg_match('/[waxc+]/', $this->getMetadata('mode')) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read data from the stream.
|
||||
*
|
||||
* @param int $length Read up to $length bytes from the object and return
|
||||
* them. Fewer than $length bytes may be returned if underlying stream
|
||||
* call returns fewer bytes.
|
||||
* @return string Returns the data read from the stream, or an empty string
|
||||
* if no bytes are available.
|
||||
* @throws \RuntimeException if an error occurs.
|
||||
*/
|
||||
public function read($length): string
|
||||
{
|
||||
if (!$this->isReadable()) {
|
||||
throw new RuntimeException;
|
||||
}
|
||||
$result = fread($this->stream, $length);
|
||||
if ($result === false) {
|
||||
throw new RuntimeException;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the stream is readable.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isReadable(): bool
|
||||
{
|
||||
return preg_match('/[r+]/', $this->getMetadata('mode')) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the remaining contents in a string
|
||||
*
|
||||
* @return string
|
||||
* @throws \RuntimeException if unable to read or an error occurs while
|
||||
* reading.
|
||||
*/
|
||||
public function getContents(): string
|
||||
{
|
||||
if (!$this->isReadable()) {
|
||||
throw new RuntimeException;
|
||||
}
|
||||
$result = stream_get_contents($this->stream);
|
||||
if ($result === false) {
|
||||
throw new RuntimeException;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
599
vendor/maennchen/zipstream-php/src/ZipStream.php
vendored
Normal file
@ -0,0 +1,599 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStream;
|
||||
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use ZipStream\Exception\OverflowException;
|
||||
use ZipStream\Option\Archive as ArchiveOptions;
|
||||
use ZipStream\Option\File as FileOptions;
|
||||
use ZipStream\Option\Version;
|
||||
|
||||
/**
|
||||
* ZipStream
|
||||
*
|
||||
* Streamed, dynamically generated zip archives.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* Streaming zip archives is a simple, three-step process:
|
||||
*
|
||||
* 1. Create the zip stream:
|
||||
*
|
||||
* $zip = new ZipStream('example.zip');
|
||||
*
|
||||
* 2. Add one or more files to the archive:
|
||||
*
|
||||
* * add first file
|
||||
* $data = file_get_contents('some_file.gif');
|
||||
* $zip->addFile('some_file.gif', $data);
|
||||
*
|
||||
* * add second file
|
||||
* $data = file_get_contents('some_file.gif');
|
||||
* $zip->addFile('another_file.png', $data);
|
||||
*
|
||||
* 3. Finish the zip stream:
|
||||
*
|
||||
* $zip->finish();
|
||||
*
|
||||
* You can also add an archive comment, add comments to individual files,
|
||||
* and adjust the timestamp of files. See the API documentation for each
|
||||
* method below for additional information.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* // create a new zip stream object
|
||||
* $zip = new ZipStream('some_files.zip');
|
||||
*
|
||||
* // list of local files
|
||||
* $files = array('foo.txt', 'bar.jpg');
|
||||
*
|
||||
* // read and add each file to the archive
|
||||
* foreach ($files as $path)
|
||||
* $zip->addFile($path, file_get_contents($path));
|
||||
*
|
||||
* // write archive footer to stream
|
||||
* $zip->finish();
|
||||
*/
|
||||
class ZipStream
|
||||
{
|
||||
/**
|
||||
* This number corresponds to the ZIP version/OS used (2 bytes)
|
||||
* From: https://www.iana.org/assignments/media-types/application/zip
|
||||
* The upper byte (leftmost one) indicates the host system (OS) for the
|
||||
* file. Software can use this information to determine
|
||||
* the line record format for text files etc. The current
|
||||
* mappings are:
|
||||
*
|
||||
* 0 - MS-DOS and OS/2 (F.A.T. file systems)
|
||||
* 1 - Amiga 2 - VAX/VMS
|
||||
* 3 - *nix 4 - VM/CMS
|
||||
* 5 - Atari ST 6 - OS/2 H.P.F.S.
|
||||
* 7 - Macintosh 8 - Z-System
|
||||
* 9 - CP/M 10 thru 255 - unused
|
||||
*
|
||||
* The lower byte (rightmost one) indicates the version number of the
|
||||
* software used to encode the file. The value/10
|
||||
* indicates the major version number, and the value
|
||||
* mod 10 is the minor version number.
|
||||
* Here we are using 6 for the OS, indicating OS/2 H.P.F.S.
|
||||
* to prevent file permissions issues upon extract (see #84)
|
||||
* 0x603 is 00000110 00000011 in binary, so 6 and 3
|
||||
*/
|
||||
const ZIP_VERSION_MADE_BY = 0x603;
|
||||
|
||||
/**
|
||||
* The following signatures end with 0x4b50, which in ASCII is PK,
|
||||
* the initials of the inventor Phil Katz.
|
||||
* See https://en.wikipedia.org/wiki/Zip_(file_format)#File_headers
|
||||
*/
|
||||
const FILE_HEADER_SIGNATURE = 0x04034b50;
|
||||
const CDR_FILE_SIGNATURE = 0x02014b50;
|
||||
const CDR_EOF_SIGNATURE = 0x06054b50;
|
||||
const DATA_DESCRIPTOR_SIGNATURE = 0x08074b50;
|
||||
const ZIP64_CDR_EOF_SIGNATURE = 0x06064b50;
|
||||
const ZIP64_CDR_LOCATOR_SIGNATURE = 0x07064b50;
|
||||
|
||||
/**
|
||||
* Global Options
|
||||
*
|
||||
* @var ArchiveOptions
|
||||
*/
|
||||
public $opt;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $files = [];
|
||||
|
||||
/**
|
||||
* @var Bigint
|
||||
*/
|
||||
public $cdr_ofs;
|
||||
|
||||
/**
|
||||
* @var Bigint
|
||||
*/
|
||||
public $ofs;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $need_headers;
|
||||
|
||||
/**
|
||||
* @var null|String
|
||||
*/
|
||||
protected $output_name;
|
||||
|
||||
/**
|
||||
* Create a new ZipStream object.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* @param String $name - Name of output file (optional).
|
||||
* @param ArchiveOptions $opt - Archive Options
|
||||
*
|
||||
* Large File Support:
|
||||
*
|
||||
* By default, the method addFileFromPath() will send send files
|
||||
* larger than 20 megabytes along raw rather than attempting to
|
||||
* compress them. You can change both the maximum size and the
|
||||
* compression behavior using the largeFile* options above, with the
|
||||
* following caveats:
|
||||
*
|
||||
* * For "small" files (e.g. files smaller than largeFileSize), the
|
||||
* memory use can be up to twice that of the actual file. In other
|
||||
* words, adding a 10 megabyte file to the archive could potentially
|
||||
* occupy 20 megabytes of memory.
|
||||
*
|
||||
* * Enabling compression on large files (e.g. files larger than
|
||||
* large_file_size) is extremely slow, because ZipStream has to pass
|
||||
* over the large file once to calculate header information, and then
|
||||
* again to compress and send the actual data.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* // create a new zip file named 'foo.zip'
|
||||
* $zip = new ZipStream('foo.zip');
|
||||
*
|
||||
* // create a new zip file named 'bar.zip' with a comment
|
||||
* $opt->setComment = 'this is a comment for the zip file.';
|
||||
* $zip = new ZipStream('bar.zip', $opt);
|
||||
*
|
||||
* Notes:
|
||||
*
|
||||
* In order to let this library send HTTP headers, a filename must be given
|
||||
* _and_ the option `sendHttpHeaders` must be `true`. This behavior is to
|
||||
* allow software to send its own headers (including the filename), and
|
||||
* still use this library.
|
||||
*/
|
||||
public function __construct(?string $name = null, ?ArchiveOptions $opt = null)
|
||||
{
|
||||
$this->opt = $opt ?: new ArchiveOptions();
|
||||
|
||||
$this->output_name = $name;
|
||||
$this->need_headers = $name && $this->opt->isSendHttpHeaders();
|
||||
|
||||
$this->cdr_ofs = new Bigint();
|
||||
$this->ofs = new Bigint();
|
||||
}
|
||||
|
||||
/**
|
||||
* addFile
|
||||
*
|
||||
* Add a file to the archive.
|
||||
*
|
||||
* @param String $name - path of file in archive (including directory).
|
||||
* @param String $data - contents of file
|
||||
* @param FileOptions $options
|
||||
*
|
||||
* File Options:
|
||||
* time - Last-modified timestamp (seconds since the epoch) of
|
||||
* this file. Defaults to the current time.
|
||||
* comment - Comment related to this file.
|
||||
* method - Storage method for file ("store" or "deflate")
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* // add a file named 'foo.txt'
|
||||
* $data = file_get_contents('foo.txt');
|
||||
* $zip->addFile('foo.txt', $data);
|
||||
*
|
||||
* // add a file named 'bar.jpg' with a comment and a last-modified
|
||||
* // time of two hours ago
|
||||
* $data = file_get_contents('bar.jpg');
|
||||
* $opt->setTime = time() - 2 * 3600;
|
||||
* $opt->setComment = 'this is a comment about bar.jpg';
|
||||
* $zip->addFile('bar.jpg', $data, $opt);
|
||||
*/
|
||||
public function addFile(string $name, string $data, ?FileOptions $options = null): void
|
||||
{
|
||||
$options = $options ?: new FileOptions();
|
||||
$options->defaultTo($this->opt);
|
||||
|
||||
$file = new File($this, $name, $options);
|
||||
$file->processData($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* addFileFromPath
|
||||
*
|
||||
* Add a file at path to the archive.
|
||||
*
|
||||
* Note that large files may be compressed differently than smaller
|
||||
* files; see the "Large File Support" section above for more
|
||||
* information.
|
||||
*
|
||||
* @param String $name - name of file in archive (including directory path).
|
||||
* @param String $path - path to file on disk (note: paths should be encoded using
|
||||
* UNIX-style forward slashes -- e.g '/path/to/some/file').
|
||||
* @param FileOptions $options
|
||||
*
|
||||
* File Options:
|
||||
* time - Last-modified timestamp (seconds since the epoch) of
|
||||
* this file. Defaults to the current time.
|
||||
* comment - Comment related to this file.
|
||||
* method - Storage method for file ("store" or "deflate")
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* // add a file named 'foo.txt' from the local file '/tmp/foo.txt'
|
||||
* $zip->addFileFromPath('foo.txt', '/tmp/foo.txt');
|
||||
*
|
||||
* // add a file named 'bigfile.rar' from the local file
|
||||
* // '/usr/share/bigfile.rar' with a comment and a last-modified
|
||||
* // time of two hours ago
|
||||
* $path = '/usr/share/bigfile.rar';
|
||||
* $opt->setTime = time() - 2 * 3600;
|
||||
* $opt->setComment = 'this is a comment about bar.jpg';
|
||||
* $zip->addFileFromPath('bigfile.rar', $path, $opt);
|
||||
*
|
||||
* @return void
|
||||
* @throws \ZipStream\Exception\FileNotFoundException
|
||||
* @throws \ZipStream\Exception\FileNotReadableException
|
||||
*/
|
||||
public function addFileFromPath(string $name, string $path, ?FileOptions $options = null): void
|
||||
{
|
||||
$options = $options ?: new FileOptions();
|
||||
$options->defaultTo($this->opt);
|
||||
|
||||
$file = new File($this, $name, $options);
|
||||
$file->processPath($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* addFileFromStream
|
||||
*
|
||||
* Add an open stream to the archive.
|
||||
*
|
||||
* @param String $name - path of file in archive (including directory).
|
||||
* @param resource $stream - contents of file as a stream resource
|
||||
* @param FileOptions $options
|
||||
*
|
||||
* File Options:
|
||||
* time - Last-modified timestamp (seconds since the epoch) of
|
||||
* this file. Defaults to the current time.
|
||||
* comment - Comment related to this file.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* // create a temporary file stream and write text to it
|
||||
* $fp = tmpfile();
|
||||
* fwrite($fp, 'The quick brown fox jumped over the lazy dog.');
|
||||
*
|
||||
* // add a file named 'streamfile.txt' from the content of the stream
|
||||
* $x->addFileFromStream('streamfile.txt', $fp);
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addFileFromStream(string $name, $stream, ?FileOptions $options = null): void
|
||||
{
|
||||
$options = $options ?: new FileOptions();
|
||||
$options->defaultTo($this->opt);
|
||||
|
||||
$file = new File($this, $name, $options);
|
||||
$file->processStream(new DeflateStream($stream));
|
||||
}
|
||||
|
||||
/**
|
||||
* addFileFromPsr7Stream
|
||||
*
|
||||
* Add an open stream to the archive.
|
||||
*
|
||||
* @param String $name - path of file in archive (including directory).
|
||||
* @param StreamInterface $stream - contents of file as a stream resource
|
||||
* @param FileOptions $options
|
||||
*
|
||||
* File Options:
|
||||
* time - Last-modified timestamp (seconds since the epoch) of
|
||||
* this file. Defaults to the current time.
|
||||
* comment - Comment related to this file.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* // create a temporary file stream and write text to it
|
||||
* $fp = tmpfile();
|
||||
* fwrite($fp, 'The quick brown fox jumped over the lazy dog.');
|
||||
*
|
||||
* // add a file named 'streamfile.txt' from the content of the stream
|
||||
* $x->addFileFromPsr7Stream('streamfile.txt', $fp);
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addFileFromPsr7Stream(
|
||||
string $name,
|
||||
StreamInterface $stream,
|
||||
?FileOptions $options = null
|
||||
): void {
|
||||
$options = $options ?: new FileOptions();
|
||||
$options->defaultTo($this->opt);
|
||||
|
||||
$file = new File($this, $name, $options);
|
||||
$file->processStream($stream);
|
||||
}
|
||||
|
||||
/**
|
||||
* finish
|
||||
*
|
||||
* Write zip footer to stream.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* // add a list of files to the archive
|
||||
* $files = array('foo.txt', 'bar.jpg');
|
||||
* foreach ($files as $path)
|
||||
* $zip->addFile($path, file_get_contents($path));
|
||||
*
|
||||
* // write footer to stream
|
||||
* $zip->finish();
|
||||
* @return void
|
||||
*
|
||||
* @throws OverflowException
|
||||
*/
|
||||
public function finish(): void
|
||||
{
|
||||
// add trailing cdr file records
|
||||
foreach ($this->files as $cdrFile) {
|
||||
$this->send($cdrFile);
|
||||
$this->cdr_ofs = $this->cdr_ofs->add(Bigint::init(strlen($cdrFile)));
|
||||
}
|
||||
|
||||
// Add 64bit headers (if applicable)
|
||||
if (count($this->files) >= 0xFFFF ||
|
||||
$this->cdr_ofs->isOver32() ||
|
||||
$this->ofs->isOver32()) {
|
||||
if (!$this->opt->isEnableZip64()) {
|
||||
throw new OverflowException();
|
||||
}
|
||||
|
||||
$this->addCdr64Eof();
|
||||
$this->addCdr64Locator();
|
||||
}
|
||||
|
||||
// add trailing cdr eof record
|
||||
$this->addCdrEof();
|
||||
|
||||
// The End
|
||||
$this->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Send ZIP64 CDR EOF (Central Directory Record End-of-File) record.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function addCdr64Eof(): void
|
||||
{
|
||||
$num_files = count($this->files);
|
||||
$cdr_length = $this->cdr_ofs;
|
||||
$cdr_offset = $this->ofs;
|
||||
|
||||
$fields = [
|
||||
['V', static::ZIP64_CDR_EOF_SIGNATURE], // ZIP64 end of central file header signature
|
||||
['P', 44], // Length of data below this header (length of block - 12) = 44
|
||||
['v', static::ZIP_VERSION_MADE_BY], // Made by version
|
||||
['v', Version::ZIP64], // Extract by version
|
||||
['V', 0x00], // disk number
|
||||
['V', 0x00], // no of disks
|
||||
['P', $num_files], // no of entries on disk
|
||||
['P', $num_files], // no of entries in cdr
|
||||
['P', $cdr_length], // CDR size
|
||||
['P', $cdr_offset], // CDR offset
|
||||
];
|
||||
|
||||
$ret = static::packFields($fields);
|
||||
$this->send($ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a format string and argument list for pack(), then call
|
||||
* pack() and return the result.
|
||||
*
|
||||
* @param array $fields
|
||||
* @return string
|
||||
*/
|
||||
public static function packFields(array $fields): string
|
||||
{
|
||||
$fmt = '';
|
||||
$args = [];
|
||||
|
||||
// populate format string and argument list
|
||||
foreach ($fields as [$format, $value]) {
|
||||
if ($format === 'P') {
|
||||
$fmt .= 'VV';
|
||||
if ($value instanceof Bigint) {
|
||||
$args[] = $value->getLow32();
|
||||
$args[] = $value->getHigh32();
|
||||
} else {
|
||||
$args[] = $value;
|
||||
$args[] = 0;
|
||||
}
|
||||
} else {
|
||||
if ($value instanceof Bigint) {
|
||||
$value = $value->getLow32();
|
||||
}
|
||||
$fmt .= $format;
|
||||
$args[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// prepend format string to argument list
|
||||
array_unshift($args, $fmt);
|
||||
|
||||
// build output string from header and compressed data
|
||||
return pack(...$args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send string, sending HTTP headers if necessary.
|
||||
* Flush output after write if configure option is set.
|
||||
*
|
||||
* @param String $str
|
||||
* @return void
|
||||
*/
|
||||
public function send(string $str): void
|
||||
{
|
||||
if ($this->need_headers) {
|
||||
$this->sendHttpHeaders();
|
||||
}
|
||||
$this->need_headers = false;
|
||||
|
||||
fwrite($this->opt->getOutputStream(), $str);
|
||||
|
||||
if ($this->opt->isFlushOutput()) {
|
||||
// flush output buffer if it is on and flushable
|
||||
$status = ob_get_status();
|
||||
if (isset($status['flags']) && ($status['flags'] & PHP_OUTPUT_HANDLER_FLUSHABLE)) {
|
||||
ob_flush();
|
||||
}
|
||||
|
||||
// Flush system buffers after flushing userspace output buffer
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send HTTP headers for this stream.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function sendHttpHeaders(): void
|
||||
{
|
||||
// grab content disposition
|
||||
$disposition = $this->opt->getContentDisposition();
|
||||
|
||||
if ($this->output_name) {
|
||||
// Various different browsers dislike various characters here. Strip them all for safety.
|
||||
$safe_output = trim(str_replace(['"', "'", '\\', ';', "\n", "\r"], '', $this->output_name));
|
||||
|
||||
// Check if we need to UTF-8 encode the filename
|
||||
$urlencoded = rawurlencode($safe_output);
|
||||
$disposition .= "; filename*=UTF-8''{$urlencoded}";
|
||||
}
|
||||
|
||||
$headers = array(
|
||||
'Content-Type' => $this->opt->getContentType(),
|
||||
'Content-Disposition' => $disposition,
|
||||
'Pragma' => 'public',
|
||||
'Cache-Control' => 'public, must-revalidate',
|
||||
'Content-Transfer-Encoding' => 'binary'
|
||||
);
|
||||
|
||||
$call = $this->opt->getHttpHeaderCallback();
|
||||
foreach ($headers as $key => $val) {
|
||||
$call("$key: $val");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send ZIP64 CDR Locator (Central Directory Record Locator) record.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function addCdr64Locator(): void
|
||||
{
|
||||
$cdr_offset = $this->ofs->add($this->cdr_ofs);
|
||||
|
||||
$fields = [
|
||||
['V', static::ZIP64_CDR_LOCATOR_SIGNATURE], // ZIP64 end of central file header signature
|
||||
['V', 0x00], // Disc number containing CDR64EOF
|
||||
['P', $cdr_offset], // CDR offset
|
||||
['V', 1], // Total number of disks
|
||||
];
|
||||
|
||||
$ret = static::packFields($fields);
|
||||
$this->send($ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send CDR EOF (Central Directory Record End-of-File) record.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function addCdrEof(): void
|
||||
{
|
||||
$num_files = count($this->files);
|
||||
$cdr_length = $this->cdr_ofs;
|
||||
$cdr_offset = $this->ofs;
|
||||
|
||||
// grab comment (if specified)
|
||||
$comment = $this->opt->getComment();
|
||||
|
||||
$fields = [
|
||||
['V', static::CDR_EOF_SIGNATURE], // end of central file header signature
|
||||
['v', 0x00], // disk number
|
||||
['v', 0x00], // no of disks
|
||||
['v', min($num_files, 0xFFFF)], // no of entries on disk
|
||||
['v', min($num_files, 0xFFFF)], // no of entries in cdr
|
||||
['V', $cdr_length->getLowFF()], // CDR size
|
||||
['V', $cdr_offset->getLowFF()], // CDR offset
|
||||
['v', strlen($comment)], // Zip Comment size
|
||||
];
|
||||
|
||||
$ret = static::packFields($fields) . $comment;
|
||||
$this->send($ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all internal variables. Note that the stream object is not
|
||||
* usable after this.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function clear(): void
|
||||
{
|
||||
$this->files = [];
|
||||
$this->ofs = new Bigint();
|
||||
$this->cdr_ofs = new Bigint();
|
||||
$this->opt = new ArchiveOptions();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this file larger than large_file_size?
|
||||
*
|
||||
* @param string $path
|
||||
* @return bool
|
||||
*/
|
||||
public function isLargeFile(string $path): bool
|
||||
{
|
||||
if (!$this->opt->isStatFiles()) {
|
||||
return false;
|
||||
}
|
||||
$stat = stat($path);
|
||||
return $stat['size'] > $this->opt->getLargeFileSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save file attributes for trailing CDR record.
|
||||
*
|
||||
* @param File $file
|
||||
* @return void
|
||||
*/
|
||||
public function addToCdr(File $file): void
|
||||
{
|
||||
$file->ofs = $this->ofs;
|
||||
$this->ofs = $this->ofs->add($file->getTotalLength());
|
||||
$this->files[] = $file->getCdrFile();
|
||||
}
|
||||
}
|
||||
65
vendor/maennchen/zipstream-php/test/BigintTest.php
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace BigintTest;
|
||||
|
||||
use OverflowException;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use ZipStream\Bigint;
|
||||
|
||||
class BigintTest extends TestCase
|
||||
{
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$bigint = new Bigint(0x12345678);
|
||||
$this->assertSame('0x0000000012345678', $bigint->getHex64());
|
||||
$this->assertSame(0x12345678, $bigint->getLow32());
|
||||
$this->assertSame(0, $bigint->getHigh32());
|
||||
}
|
||||
|
||||
public function testConstructLarge(): void
|
||||
{
|
||||
$bigint = new Bigint(0x87654321);
|
||||
$this->assertSame('0x0000000087654321', $bigint->getHex64());
|
||||
$this->assertSame('87654321', bin2hex(pack('N', $bigint->getLow32())));
|
||||
$this->assertSame(0, $bigint->getHigh32());
|
||||
}
|
||||
|
||||
public function testAddSmallValue(): void
|
||||
{
|
||||
$bigint = new Bigint(1);
|
||||
$bigint = $bigint->add(Bigint::init(2));
|
||||
$this->assertSame(3, $bigint->getLow32());
|
||||
$this->assertFalse($bigint->isOver32());
|
||||
$this->assertTrue($bigint->isOver32(true));
|
||||
$this->assertSame($bigint->getLowFF(), (float)$bigint->getLow32());
|
||||
$this->assertSame($bigint->getLowFF(true), (float)0xFFFFFFFF);
|
||||
}
|
||||
|
||||
public function testAddWithOverflowAtLowestByte(): void
|
||||
{
|
||||
$bigint = new Bigint(0xFF);
|
||||
$bigint = $bigint->add(Bigint::init(0x01));
|
||||
$this->assertSame(0x100, $bigint->getLow32());
|
||||
}
|
||||
|
||||
public function testAddWithOverflowAtInteger32(): void
|
||||
{
|
||||
$bigint = new Bigint(0xFFFFFFFE);
|
||||
$this->assertFalse($bigint->isOver32());
|
||||
$bigint = $bigint->add(Bigint::init(0x01));
|
||||
$this->assertTrue($bigint->isOver32());
|
||||
$bigint = $bigint->add(Bigint::init(0x01));
|
||||
$this->assertSame('0x0000000100000000', $bigint->getHex64());
|
||||
$this->assertTrue($bigint->isOver32());
|
||||
$this->assertSame((float)0xFFFFFFFF, $bigint->getLowFF());
|
||||
}
|
||||
|
||||
public function testAddWithOverflowAtInteger64(): void
|
||||
{
|
||||
$bigint = Bigint::fromLowHigh(0xFFFFFFFF, 0xFFFFFFFF);
|
||||
$this->assertSame('0xFFFFFFFFFFFFFFFF', $bigint->getHex64());
|
||||
$this->expectException(OverflowException::class);
|
||||
$bigint->add(Bigint::init(1));
|
||||
}
|
||||
}
|
||||
586
vendor/maennchen/zipstream-php/test/ZipStreamTest.php
vendored
Normal file
@ -0,0 +1,586 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZipStreamTest;
|
||||
|
||||
use org\bovigo\vfs\vfsStream;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use ZipStream\File;
|
||||
use ZipStream\Option\Archive as ArchiveOptions;
|
||||
use ZipStream\Option\File as FileOptions;
|
||||
use ZipStream\Option\Method;
|
||||
use ZipStream\ZipStream;
|
||||
|
||||
/**
|
||||
* Test Class for the Main ZipStream CLass
|
||||
*/
|
||||
class ZipStreamTest extends TestCase
|
||||
{
|
||||
const OSX_ARCHIVE_UTILITY =
|
||||
'/System/Library/CoreServices/Applications/Archive Utility.app/Contents/MacOS/Archive Utility';
|
||||
|
||||
public function testFileNotFoundException(): void
|
||||
{
|
||||
$this->expectException(\ZipStream\Exception\FileNotFoundException::class);
|
||||
// Get ZipStream Object
|
||||
$zip = new ZipStream();
|
||||
|
||||
// Trigger error by adding a file which doesn't exist
|
||||
$zip->addFileFromPath('foobar.php', '/foo/bar/foobar.php');
|
||||
}
|
||||
|
||||
public function testFileNotReadableException(): void
|
||||
{
|
||||
// create new virtual filesystem
|
||||
$root = vfsStream::setup('vfs');
|
||||
// create a virtual file with no permissions
|
||||
$file = vfsStream::newFile('foo.txt', 0000)->at($root)->setContent('bar');
|
||||
$zip = new ZipStream();
|
||||
$this->expectException(\ZipStream\Exception\FileNotReadableException::class);
|
||||
$zip->addFileFromPath('foo.txt', $file->url());
|
||||
}
|
||||
|
||||
public function testDostime(): void
|
||||
{
|
||||
// Allows testing of protected method
|
||||
$class = new \ReflectionClass(File::class);
|
||||
$method = $class->getMethod('dostime');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$this->assertSame($method->invoke(null, 1416246368), 1165069764);
|
||||
|
||||
// January 1 1980 - DOS Epoch.
|
||||
$this->assertSame($method->invoke(null, 315532800), 2162688);
|
||||
|
||||
// January 1 1970 -> January 1 1980 due to minimum DOS Epoch. @todo Throw Exception?
|
||||
$this->assertSame($method->invoke(null, 0), 2162688);
|
||||
}
|
||||
|
||||
public function testAddFile(): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$zip->addFile('sample.txt', 'Sample String Data');
|
||||
$zip->addFile('test/sample.txt', 'More Simple Sample Data');
|
||||
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$tmpDir = $this->validateAndExtractZip($tmp);
|
||||
|
||||
$files = $this->getRecursiveFileList($tmpDir);
|
||||
$this->assertEquals(['sample.txt', 'test/sample.txt'], $files);
|
||||
|
||||
$this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
|
||||
$this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getTmpFileStream(): array
|
||||
{
|
||||
$tmp = tempnam(sys_get_temp_dir(), 'zipstreamtest');
|
||||
$stream = fopen($tmp, 'wb+');
|
||||
|
||||
return array($tmp, $stream);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $tmp
|
||||
* @return string
|
||||
*/
|
||||
protected function validateAndExtractZip($tmp): string
|
||||
{
|
||||
$tmpDir = $this->getTmpDir();
|
||||
|
||||
$zipArch = new \ZipArchive;
|
||||
$res = $zipArch->open($tmp);
|
||||
|
||||
if ($res !== true) {
|
||||
$this->fail("Failed to open {$tmp}. Code: $res");
|
||||
|
||||
return $tmpDir;
|
||||
}
|
||||
|
||||
$this->assertEquals(0, $zipArch->status);
|
||||
$this->assertEquals(0, $zipArch->statusSys);
|
||||
|
||||
$zipArch->extractTo($tmpDir);
|
||||
$zipArch->close();
|
||||
|
||||
return $tmpDir;
|
||||
}
|
||||
|
||||
protected function getTmpDir(): string
|
||||
{
|
||||
$tmp = tempnam(sys_get_temp_dir(), 'zipstreamtest');
|
||||
unlink($tmp);
|
||||
mkdir($tmp) or $this->fail('Failed to make directory');
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @return string[]
|
||||
*/
|
||||
protected function getRecursiveFileList(string $path): array
|
||||
{
|
||||
$data = array();
|
||||
$path = (string)realpath($path);
|
||||
$files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
|
||||
|
||||
$pathLen = strlen($path);
|
||||
foreach ($files as $file) {
|
||||
$filePath = $file->getRealPath();
|
||||
if (!is_dir($filePath)) {
|
||||
$data[] = substr($filePath, $pathLen + 1);
|
||||
}
|
||||
}
|
||||
|
||||
sort($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function testAddFileUtf8NameComment(): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$name = 'árvíztűrő tükörfúrógép.txt';
|
||||
$content = 'Sample String Data';
|
||||
$comment =
|
||||
'Filename has every special characters ' .
|
||||
'from Hungarian language in lowercase. ' .
|
||||
'In uppercase: ÁÍŰŐÜÖÚÓÉ';
|
||||
|
||||
$fileOptions = new FileOptions();
|
||||
$fileOptions->setComment($comment);
|
||||
|
||||
$zip->addFile($name, $content, $fileOptions);
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$tmpDir = $this->validateAndExtractZip($tmp);
|
||||
|
||||
$files = $this->getRecursiveFileList($tmpDir);
|
||||
$this->assertEquals(array($name), $files);
|
||||
$this->assertStringEqualsFile($tmpDir . '/' . $name, $content);
|
||||
|
||||
$zipArch = new \ZipArchive();
|
||||
$zipArch->open($tmp);
|
||||
$this->assertEquals($comment, $zipArch->getCommentName($name));
|
||||
}
|
||||
|
||||
public function testAddFileUtf8NameNonUtfComment(): void
|
||||
{
|
||||
$this->expectException(\ZipStream\Exception\EncodingException::class);
|
||||
|
||||
$stream = $this->getTmpFileStream()[1];
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$name = 'á.txt';
|
||||
$content = 'any';
|
||||
$comment = 'á';
|
||||
|
||||
$fileOptions = new FileOptions();
|
||||
$fileOptions->setComment(mb_convert_encoding($comment, 'ISO-8859-2', 'UTF-8'));
|
||||
|
||||
$zip->addFile($name, $content, $fileOptions);
|
||||
}
|
||||
|
||||
public function testAddFileNonUtf8NameUtfComment(): void
|
||||
{
|
||||
$this->expectException(\ZipStream\Exception\EncodingException::class);
|
||||
|
||||
$stream = $this->getTmpFileStream()[1];
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$name = 'á.txt';
|
||||
$content = 'any';
|
||||
$comment = 'á';
|
||||
|
||||
$fileOptions = new FileOptions();
|
||||
$fileOptions->setComment($comment);
|
||||
|
||||
$zip->addFile(mb_convert_encoding($name, 'ISO-8859-2', 'UTF-8'), $content, $fileOptions);
|
||||
}
|
||||
|
||||
public function testAddFileWithStorageMethod(): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$fileOptions = new FileOptions();
|
||||
$fileOptions->setMethod(Method::STORE());
|
||||
|
||||
$zip->addFile('sample.txt', 'Sample String Data', $fileOptions);
|
||||
$zip->addFile('test/sample.txt', 'More Simple Sample Data');
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$zipArch = new \ZipArchive();
|
||||
$zipArch->open($tmp);
|
||||
|
||||
$sample1 = $zipArch->statName('sample.txt');
|
||||
$sample12 = $zipArch->statName('test/sample.txt');
|
||||
$this->assertEquals($sample1['comp_method'], Method::STORE);
|
||||
$this->assertEquals($sample12['comp_method'], Method::DEFLATE);
|
||||
|
||||
$zipArch->close();
|
||||
}
|
||||
|
||||
public function testDecompressFileWithMacUnarchiver(): void
|
||||
{
|
||||
if (!file_exists(self::OSX_ARCHIVE_UTILITY)) {
|
||||
$this->markTestSkipped('The Mac OSX Archive Utility is not available.');
|
||||
}
|
||||
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$folder = uniqid('', true);
|
||||
|
||||
$zip->addFile($folder . '/sample.txt', 'Sample Data');
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
exec(escapeshellarg(self::OSX_ARCHIVE_UTILITY) . ' ' . escapeshellarg($tmp), $output, $returnStatus);
|
||||
|
||||
$this->assertEquals(0, $returnStatus);
|
||||
$this->assertCount(0, $output);
|
||||
|
||||
$this->assertFileExists(dirname($tmp) . '/' . $folder . '/sample.txt');
|
||||
$this->assertStringEqualsFile(dirname($tmp) . '/' . $folder . '/sample.txt', 'Sample Data');
|
||||
}
|
||||
|
||||
public function testAddFileFromPath(): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
[$tmpExample, $streamExample] = $this->getTmpFileStream();
|
||||
fwrite($streamExample, 'Sample String Data');
|
||||
fclose($streamExample);
|
||||
$zip->addFileFromPath('sample.txt', $tmpExample);
|
||||
|
||||
[$tmpExample, $streamExample] = $this->getTmpFileStream();
|
||||
fwrite($streamExample, 'More Simple Sample Data');
|
||||
fclose($streamExample);
|
||||
$zip->addFileFromPath('test/sample.txt', $tmpExample);
|
||||
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$tmpDir = $this->validateAndExtractZip($tmp);
|
||||
|
||||
$files = $this->getRecursiveFileList($tmpDir);
|
||||
$this->assertEquals(array('sample.txt', 'test/sample.txt'), $files);
|
||||
|
||||
$this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
|
||||
$this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
|
||||
}
|
||||
|
||||
public function testAddFileFromPathWithStorageMethod(): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$fileOptions = new FileOptions();
|
||||
$fileOptions->setMethod(Method::STORE());
|
||||
|
||||
[$tmpExample, $streamExample] = $this->getTmpFileStream();
|
||||
fwrite($streamExample, 'Sample String Data');
|
||||
fclose($streamExample);
|
||||
$zip->addFileFromPath('sample.txt', $tmpExample, $fileOptions);
|
||||
|
||||
[$tmpExample, $streamExample] = $this->getTmpFileStream();
|
||||
fwrite($streamExample, 'More Simple Sample Data');
|
||||
fclose($streamExample);
|
||||
$zip->addFileFromPath('test/sample.txt', $tmpExample);
|
||||
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$zipArch = new \ZipArchive();
|
||||
$zipArch->open($tmp);
|
||||
|
||||
$sample1 = $zipArch->statName('sample.txt');
|
||||
$this->assertEquals(Method::STORE, $sample1['comp_method']);
|
||||
|
||||
$sample2 = $zipArch->statName('test/sample.txt');
|
||||
$this->assertEquals(Method::DEFLATE, $sample2['comp_method']);
|
||||
|
||||
$zipArch->close();
|
||||
}
|
||||
|
||||
public function testAddLargeFileFromPath(): void
|
||||
{
|
||||
$methods = [Method::DEFLATE(), Method::STORE()];
|
||||
$falseTrue = [false, true];
|
||||
foreach ($methods as $method) {
|
||||
foreach ($falseTrue as $zeroHeader) {
|
||||
foreach ($falseTrue as $zip64) {
|
||||
if ($zeroHeader && $method->equals(Method::DEFLATE())) {
|
||||
continue;
|
||||
}
|
||||
$this->addLargeFileFileFromPath($method, $zeroHeader, $zip64);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function addLargeFileFileFromPath($method, $zeroHeader, $zip64): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
$options->setLargeFileMethod($method);
|
||||
$options->setLargeFileSize(5);
|
||||
$options->setZeroHeader($zeroHeader);
|
||||
$options->setEnableZip64($zip64);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
[$tmpExample, $streamExample] = $this->getTmpFileStream();
|
||||
for ($i = 0; $i <= 10000; $i++) {
|
||||
fwrite($streamExample, sha1((string)$i));
|
||||
if ($i % 100 === 0) {
|
||||
fwrite($streamExample, "\n");
|
||||
}
|
||||
}
|
||||
fclose($streamExample);
|
||||
$shaExample = sha1_file($tmpExample);
|
||||
$zip->addFileFromPath('sample.txt', $tmpExample);
|
||||
unlink($tmpExample);
|
||||
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$tmpDir = $this->validateAndExtractZip($tmp);
|
||||
|
||||
$files = $this->getRecursiveFileList($tmpDir);
|
||||
$this->assertEquals(array('sample.txt'), $files);
|
||||
|
||||
$this->assertEquals(sha1_file($tmpDir . '/sample.txt'), $shaExample, "SHA-1 Mismatch Method: {$method}");
|
||||
}
|
||||
|
||||
public function testAddFileFromStream(): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
// In this test we can't use temporary stream to feed data
|
||||
// because zlib.deflate filter gives empty string before PHP 7
|
||||
// it works fine with file stream
|
||||
$streamExample = fopen(__FILE__, 'rb');
|
||||
$zip->addFileFromStream('sample.txt', $streamExample);
|
||||
// fclose($streamExample);
|
||||
|
||||
$fileOptions = new FileOptions();
|
||||
$fileOptions->setMethod(Method::STORE());
|
||||
|
||||
$streamExample2 = fopen('php://temp', 'wb+');
|
||||
fwrite($streamExample2, 'More Simple Sample Data');
|
||||
rewind($streamExample2); // move the pointer back to the beginning of file.
|
||||
$zip->addFileFromStream('test/sample.txt', $streamExample2, $fileOptions);
|
||||
// fclose($streamExample2);
|
||||
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$tmpDir = $this->validateAndExtractZip($tmp);
|
||||
|
||||
$files = $this->getRecursiveFileList($tmpDir);
|
||||
$this->assertEquals(array('sample.txt', 'test/sample.txt'), $files);
|
||||
|
||||
$this->assertStringEqualsFile(__FILE__, file_get_contents($tmpDir . '/sample.txt'));
|
||||
$this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
|
||||
}
|
||||
|
||||
public function testAddFileFromStreamWithStorageMethod(): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$fileOptions = new FileOptions();
|
||||
$fileOptions->setMethod(Method::STORE());
|
||||
|
||||
$streamExample = fopen('php://temp', 'wb+');
|
||||
fwrite($streamExample, 'Sample String Data');
|
||||
rewind($streamExample); // move the pointer back to the beginning of file.
|
||||
$zip->addFileFromStream('sample.txt', $streamExample, $fileOptions);
|
||||
// fclose($streamExample);
|
||||
|
||||
$streamExample2 = fopen('php://temp', 'bw+');
|
||||
fwrite($streamExample2, 'More Simple Sample Data');
|
||||
rewind($streamExample2); // move the pointer back to the beginning of file.
|
||||
$zip->addFileFromStream('test/sample.txt', $streamExample2);
|
||||
// fclose($streamExample2);
|
||||
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$zipArch = new \ZipArchive();
|
||||
$zipArch->open($tmp);
|
||||
|
||||
$sample1 = $zipArch->statName('sample.txt');
|
||||
$this->assertEquals(Method::STORE, $sample1['comp_method']);
|
||||
|
||||
$sample2 = $zipArch->statName('test/sample.txt');
|
||||
$this->assertEquals(Method::DEFLATE, $sample2['comp_method']);
|
||||
|
||||
$zipArch->close();
|
||||
}
|
||||
|
||||
public function testAddFileFromPsr7Stream(): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$body = 'Sample String Data';
|
||||
$response = new Response(200, [], $body);
|
||||
|
||||
$fileOptions = new FileOptions();
|
||||
$fileOptions->setMethod(Method::STORE());
|
||||
|
||||
$zip->addFileFromPsr7Stream('sample.json', $response->getBody(), $fileOptions);
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$tmpDir = $this->validateAndExtractZip($tmp);
|
||||
|
||||
$files = $this->getRecursiveFileList($tmpDir);
|
||||
$this->assertEquals(array('sample.json'), $files);
|
||||
$this->assertStringEqualsFile($tmpDir . '/sample.json', $body);
|
||||
}
|
||||
|
||||
public function testAddFileFromPsr7StreamWithFileSizeSet(): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$body = 'Sample String Data';
|
||||
$fileSize = strlen($body);
|
||||
// Add fake padding
|
||||
$fakePadding = "\0\0\0\0\0\0";
|
||||
$response = new Response(200, [], $body . $fakePadding);
|
||||
|
||||
$fileOptions = new FileOptions();
|
||||
$fileOptions->setMethod(Method::STORE());
|
||||
$fileOptions->setSize($fileSize);
|
||||
$zip->addFileFromPsr7Stream('sample.json', $response->getBody(), $fileOptions);
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$tmpDir = $this->validateAndExtractZip($tmp);
|
||||
|
||||
$files = $this->getRecursiveFileList($tmpDir);
|
||||
$this->assertEquals(array('sample.json'), $files);
|
||||
$this->assertStringEqualsFile($tmpDir . '/sample.json', $body);
|
||||
}
|
||||
|
||||
public function testCreateArchiveWithFlushOptionSet(): void
|
||||
{
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
$options->setFlushOutput(true);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$zip->addFile('sample.txt', 'Sample String Data');
|
||||
$zip->addFile('test/sample.txt', 'More Simple Sample Data');
|
||||
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$tmpDir = $this->validateAndExtractZip($tmp);
|
||||
|
||||
$files = $this->getRecursiveFileList($tmpDir);
|
||||
$this->assertEquals(['sample.txt', 'test/sample.txt'], $files);
|
||||
|
||||
$this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
|
||||
$this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
|
||||
}
|
||||
|
||||
public function testCreateArchiveWithOutputBufferingOffAndFlushOptionSet(): void
|
||||
{
|
||||
// WORKAROUND (1/2): remove phpunit's output buffer in order to run test without any buffering
|
||||
ob_end_flush();
|
||||
$this->assertEquals(0, ob_get_level());
|
||||
|
||||
[$tmp, $stream] = $this->getTmpFileStream();
|
||||
|
||||
$options = new ArchiveOptions();
|
||||
$options->setOutputStream($stream);
|
||||
$options->setFlushOutput(true);
|
||||
|
||||
$zip = new ZipStream(null, $options);
|
||||
|
||||
$zip->addFile('sample.txt', 'Sample String Data');
|
||||
|
||||
$zip->finish();
|
||||
fclose($stream);
|
||||
|
||||
$tmpDir = $this->validateAndExtractZip($tmp);
|
||||
$this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
|
||||
|
||||
// WORKAROUND (2/2): add back output buffering so that PHPUnit doesn't complain that it is missing
|
||||
ob_start();
|
||||
}
|
||||
}
|
||||
6
vendor/maennchen/zipstream-php/test/bootstrap.php
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
39
vendor/maennchen/zipstream-php/test/bug/BugHonorFileTimeTest.php
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace BugHonorFileTimeTest;
|
||||
|
||||
use DateTime;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use ZipStream\Option\{
|
||||
Archive,
|
||||
File
|
||||
};
|
||||
use ZipStream\ZipStream;
|
||||
|
||||
use function fopen;
|
||||
|
||||
/**
|
||||
* Asserts that specified last-modified timestamps are not overwritten when a
|
||||
* file is added
|
||||
*/
|
||||
class BugHonorFileTimeTest extends TestCase
|
||||
{
|
||||
public function testHonorsFileTime(): void
|
||||
{
|
||||
$archiveOpt = new Archive();
|
||||
$fileOpt = new File();
|
||||
$expectedTime = new DateTime('2019-04-21T19:25:00-0800');
|
||||
|
||||
$archiveOpt->setOutputStream(fopen('php://memory', 'wb'));
|
||||
$fileOpt->setTime(clone $expectedTime);
|
||||
|
||||
$zip = new ZipStream(null, $archiveOpt);
|
||||
|
||||
$zip->addFile('sample.txt', 'Sample', $fileOpt);
|
||||
|
||||
$zip->finish();
|
||||
|
||||
$this->assertEquals($expectedTime, $fileOpt->getTime());
|
||||
}
|
||||
}
|
||||
156
vendor/markbaker/complex/README.md
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
PHPComplex
|
||||
==========
|
||||
|
||||
---
|
||||
|
||||
PHP Class for handling Complex numbers
|
||||
|
||||
Master: [](http://travis-ci.org/MarkBaker/PHPComplex)
|
||||
|
||||
Develop: [](http://travis-ci.org/MarkBaker/PHPComplex)
|
||||
|
||||
[](https://xkcd.com/2028/)
|
||||
|
||||
---
|
||||
|
||||
The library currently provides the following operations:
|
||||
|
||||
- addition
|
||||
- subtraction
|
||||
- multiplication
|
||||
- division
|
||||
- division by
|
||||
- division into
|
||||
|
||||
together with functions for
|
||||
|
||||
- theta (polar theta angle)
|
||||
- rho (polar distance/radius)
|
||||
- conjugate
|
||||
* negative
|
||||
- inverse (1 / complex)
|
||||
- cos (cosine)
|
||||
- acos (inverse cosine)
|
||||
- cosh (hyperbolic cosine)
|
||||
- acosh (inverse hyperbolic cosine)
|
||||
- sin (sine)
|
||||
- asin (inverse sine)
|
||||
- sinh (hyperbolic sine)
|
||||
- asinh (inverse hyperbolic sine)
|
||||
- sec (secant)
|
||||
- asec (inverse secant)
|
||||
- sech (hyperbolic secant)
|
||||
- asech (inverse hyperbolic secant)
|
||||
- csc (cosecant)
|
||||
- acsc (inverse cosecant)
|
||||
- csch (hyperbolic secant)
|
||||
- acsch (inverse hyperbolic secant)
|
||||
- tan (tangent)
|
||||
- atan (inverse tangent)
|
||||
- tanh (hyperbolic tangent)
|
||||
- atanh (inverse hyperbolic tangent)
|
||||
- cot (cotangent)
|
||||
- acot (inverse cotangent)
|
||||
- coth (hyperbolic cotangent)
|
||||
- acoth (inverse hyperbolic cotangent)
|
||||
- sqrt (square root)
|
||||
- exp (exponential)
|
||||
- ln (natural log)
|
||||
- log10 (base-10 log)
|
||||
- log2 (base-2 log)
|
||||
- pow (raised to the power of a real number)
|
||||
|
||||
|
||||
---
|
||||
|
||||
# Usage
|
||||
|
||||
To create a new complex object, you can provide either the real, imaginary and suffix parts as individual values, or as an array of values passed passed to the constructor; or a string representing the value. e.g
|
||||
|
||||
```
|
||||
$real = 1.23;
|
||||
$imaginary = -4.56;
|
||||
$suffix = 'i';
|
||||
|
||||
$complexObject = new Complex\Complex($real, $imaginary, $suffix);
|
||||
```
|
||||
or
|
||||
```
|
||||
$real = 1.23;
|
||||
$imaginary = -4.56;
|
||||
$suffix = 'i';
|
||||
|
||||
$arguments = [$real, $imaginary, $suffix];
|
||||
|
||||
$complexObject = new Complex\Complex($arguments);
|
||||
```
|
||||
or
|
||||
```
|
||||
$complexString = '1.23-4.56i';
|
||||
|
||||
$complexObject = new Complex\Complex($complexString);
|
||||
```
|
||||
|
||||
Complex objects are immutable: whenever you call a method or pass a complex value to a function that returns a complex value, a new Complex object will be returned, and the original will remain unchanged.
|
||||
This also allows you to chain multiple methods as you would for a fluent interface (as long as they are methods that will return a Complex result).
|
||||
|
||||
## Performing Mathematical Operations
|
||||
|
||||
To perform mathematical operations with Complex values, you can call the appropriate method against a complex value, passing other values as arguments
|
||||
|
||||
```
|
||||
$complexString1 = '1.23-4.56i';
|
||||
$complexString2 = '2.34+5.67i';
|
||||
|
||||
$complexObject = new Complex\Complex($complexString1);
|
||||
echo $complexObject->add($complexString2);
|
||||
```
|
||||
or pass all values to the appropriate function
|
||||
```
|
||||
$complexString1 = '1.23-4.56i';
|
||||
$complexString2 = '2.34+5.67i';
|
||||
|
||||
echo Complex\add($complexString1, $complexString2);
|
||||
```
|
||||
If you want to perform the same operation against multiple values (e.g. to add three or more complex numbers), then you can pass multiple arguments to any of the operations.
|
||||
|
||||
You can pass these arguments as Complex objects, or as an array or string that will parse to a complex object.
|
||||
|
||||
## Using functions
|
||||
|
||||
When calling any of the available functions for a complex value, you can either call the relevant method for the Complex object
|
||||
```
|
||||
$complexString = '1.23-4.56i';
|
||||
|
||||
$complexObject = new Complex\Complex($complexString);
|
||||
echo $complexObject->sinh();
|
||||
```
|
||||
or you can call the function as you would in procedural code, passing the Complex object as an argument
|
||||
```
|
||||
$complexString = '1.23-4.56i';
|
||||
|
||||
$complexObject = new Complex\Complex($complexString);
|
||||
echo Complex\sinh($complexObject);
|
||||
```
|
||||
When called procedurally using the function, you can pass in the argument as a Complex object, or as an array or string that will parse to a complex object.
|
||||
```
|
||||
$complexString = '1.23-4.56i';
|
||||
|
||||
echo Complex\sinh($complexString);
|
||||
```
|
||||
|
||||
In the case of the `pow()` function (the only implemented function that requires an additional argument) you need to pass both arguments when calling the function procedurally
|
||||
|
||||
```
|
||||
$complexString = '1.23-4.56i';
|
||||
|
||||
$complexObject = new Complex\Complex($complexString);
|
||||
echo Complex\pow($complexObject, 2);
|
||||
```
|
||||
or pass the additional argument when calling the method
|
||||
```
|
||||
$complexString = '1.23-4.56i';
|
||||
|
||||
$complexObject = new Complex\Complex($complexString);
|
||||
echo $complexObject->pow(2);
|
||||
```
|
||||
53
vendor/markbaker/complex/classes/Autoloader.php
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
*
|
||||
* Autoloader for Complex classes
|
||||
*
|
||||
* @package Complex
|
||||
* @copyright Copyright (c) 2014 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
class Autoloader
|
||||
{
|
||||
/**
|
||||
* Register the Autoloader with SPL
|
||||
*
|
||||
*/
|
||||
public static function Register()
|
||||
{
|
||||
if (function_exists('__autoload')) {
|
||||
// Register any existing autoloader function with SPL, so we don't get any clashes
|
||||
spl_autoload_register('__autoload');
|
||||
}
|
||||
// Register ourselves with SPL
|
||||
return spl_autoload_register(['Complex\\Autoloader', 'Load']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Autoload a class identified by name
|
||||
*
|
||||
* @param string $pClassName Name of the object to load
|
||||
*/
|
||||
public static function Load($pClassName)
|
||||
{
|
||||
if ((class_exists($pClassName, false)) || (strpos($pClassName, 'Complex\\') !== 0)) {
|
||||
// Either already loaded, or not a Complex class request
|
||||
return false;
|
||||
}
|
||||
|
||||
$pClassFilePath = __DIR__ . DIRECTORY_SEPARATOR .
|
||||
'src' . DIRECTORY_SEPARATOR .
|
||||
str_replace(['Complex\\', '\\'], ['', '/'], $pClassName) .
|
||||
'.php';
|
||||
|
||||
if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) {
|
||||
// Can't load
|
||||
return false;
|
||||
}
|
||||
require($pClassFilePath);
|
||||
}
|
||||
}
|
||||
38
vendor/markbaker/complex/classes/Bootstrap.php
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__ . '/Autoloader.php';
|
||||
|
||||
\Complex\Autoloader::Register();
|
||||
|
||||
|
||||
abstract class FilesystemRegexFilter extends RecursiveRegexIterator
|
||||
{
|
||||
protected $regex;
|
||||
public function __construct(RecursiveIterator $it, $regex)
|
||||
{
|
||||
$this->regex = $regex;
|
||||
parent::__construct($it, $regex);
|
||||
}
|
||||
}
|
||||
|
||||
class FilenameFilter extends FilesystemRegexFilter
|
||||
{
|
||||
// Filter files against the regex
|
||||
public function accept()
|
||||
{
|
||||
return (!$this->isFile() || preg_match($this->regex, $this->getFilename()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$srcFolder = __DIR__ . DIRECTORY_SEPARATOR . 'src';
|
||||
$srcDirectory = new RecursiveDirectoryIterator($srcFolder);
|
||||
|
||||
$filteredFileList = new FilenameFilter($srcDirectory, '/(?:php)$/i');
|
||||
$filteredFileList = new FilenameFilter($filteredFileList, '/^(?!.*(Complex|Exception)\.php).*$/i');
|
||||
|
||||
foreach (new RecursiveIteratorIterator($filteredFileList) as $file) {
|
||||
if ($file->isFile()) {
|
||||
include_once $file;
|
||||
}
|
||||
}
|
||||
390
vendor/markbaker/complex/classes/src/Complex.php
vendored
Normal file
@ -0,0 +1,390 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Class for the management of Complex numbers
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Complex Number object.
|
||||
*
|
||||
* @package Complex
|
||||
*
|
||||
* @method float abs()
|
||||
* @method Complex acos()
|
||||
* @method Complex acosh()
|
||||
* @method Complex acot()
|
||||
* @method Complex acoth()
|
||||
* @method Complex acsc()
|
||||
* @method Complex acsch()
|
||||
* @method float argument()
|
||||
* @method Complex asec()
|
||||
* @method Complex asech()
|
||||
* @method Complex asin()
|
||||
* @method Complex asinh()
|
||||
* @method Complex atan()
|
||||
* @method Complex atanh()
|
||||
* @method Complex conjugate()
|
||||
* @method Complex cos()
|
||||
* @method Complex cosh()
|
||||
* @method Complex cot()
|
||||
* @method Complex coth()
|
||||
* @method Complex csc()
|
||||
* @method Complex csch()
|
||||
* @method Complex exp()
|
||||
* @method Complex inverse()
|
||||
* @method Complex ln()
|
||||
* @method Complex log2()
|
||||
* @method Complex log10()
|
||||
* @method Complex negative()
|
||||
* @method Complex pow(int|float $power)
|
||||
* @method float rho()
|
||||
* @method Complex sec()
|
||||
* @method Complex sech()
|
||||
* @method Complex sin()
|
||||
* @method Complex sinh()
|
||||
* @method Complex sqrt()
|
||||
* @method Complex tan()
|
||||
* @method Complex tanh()
|
||||
* @method float theta()
|
||||
* @method Complex add(...$complexValues)
|
||||
* @method Complex subtract(...$complexValues)
|
||||
* @method Complex multiply(...$complexValues)
|
||||
* @method Complex divideby(...$complexValues)
|
||||
* @method Complex divideinto(...$complexValues)
|
||||
*/
|
||||
class Complex
|
||||
{
|
||||
/**
|
||||
* @constant Euler's Number.
|
||||
*/
|
||||
const EULER = 2.7182818284590452353602874713526624977572;
|
||||
|
||||
/**
|
||||
* @constant Regexp to split an input string into real and imaginary components and suffix
|
||||
*/
|
||||
const NUMBER_SPLIT_REGEXP =
|
||||
'` ^
|
||||
( # Real part
|
||||
[-+]?(\d+\.?\d*|\d*\.?\d+) # Real value (integer or float)
|
||||
([Ee][-+]?[0-2]?\d{1,3})? # Optional real exponent for scientific format
|
||||
)
|
||||
( # Imaginary part
|
||||
[-+]?(\d+\.?\d*|\d*\.?\d+) # Imaginary value (integer or float)
|
||||
([Ee][-+]?[0-2]?\d{1,3})? # Optional imaginary exponent for scientific format
|
||||
)?
|
||||
( # Imaginary part is optional
|
||||
([-+]?) # Imaginary (implicit 1 or -1) only
|
||||
([ij]?) # Imaginary i or j - depending on whether mathematical or engineering
|
||||
)
|
||||
$`uix';
|
||||
|
||||
/**
|
||||
* @var float $realPart The value of of this complex number on the real plane.
|
||||
*/
|
||||
protected $realPart = 0.0;
|
||||
|
||||
/**
|
||||
* @var float $imaginaryPart The value of of this complex number on the imaginary plane.
|
||||
*/
|
||||
protected $imaginaryPart = 0.0;
|
||||
|
||||
/**
|
||||
* @var string $suffix The suffix for this complex number (i or j).
|
||||
*/
|
||||
protected $suffix;
|
||||
|
||||
|
||||
/**
|
||||
* Validates whether the argument is a valid complex number, converting scalar or array values if possible
|
||||
*
|
||||
* @param mixed $complexNumber The value to parse
|
||||
* @return array
|
||||
* @throws Exception If the argument isn't a Complex number or cannot be converted to one
|
||||
*/
|
||||
private static function parseComplex($complexNumber)
|
||||
{
|
||||
// Test for real number, with no imaginary part
|
||||
if (is_numeric($complexNumber)) {
|
||||
return [$complexNumber, 0, null];
|
||||
}
|
||||
|
||||
// Fix silly human errors
|
||||
$complexNumber = str_replace(
|
||||
['+-', '-+', '++', '--'],
|
||||
['-', '-', '+', '+'],
|
||||
$complexNumber
|
||||
);
|
||||
|
||||
// Basic validation of string, to parse out real and imaginary parts, and any suffix
|
||||
$validComplex = preg_match(
|
||||
self::NUMBER_SPLIT_REGEXP,
|
||||
$complexNumber,
|
||||
$complexParts
|
||||
);
|
||||
|
||||
if (!$validComplex) {
|
||||
// Neither real nor imaginary part, so test to see if we actually have a suffix
|
||||
$validComplex = preg_match('/^([\-\+]?)([ij])$/ui', $complexNumber, $complexParts);
|
||||
if (!$validComplex) {
|
||||
throw new Exception('Invalid complex number');
|
||||
}
|
||||
// We have a suffix, so set the real to 0, the imaginary to either 1 or -1 (as defined by the sign)
|
||||
$imaginary = 1;
|
||||
if ($complexParts[1] === '-') {
|
||||
$imaginary = 0 - $imaginary;
|
||||
}
|
||||
return [0, $imaginary, $complexParts[2]];
|
||||
}
|
||||
|
||||
// If we don't have an imaginary part, identify whether it should be +1 or -1...
|
||||
if (($complexParts[4] === '') && ($complexParts[9] !== '')) {
|
||||
if ($complexParts[7] !== $complexParts[9]) {
|
||||
$complexParts[4] = 1;
|
||||
if ($complexParts[8] === '-') {
|
||||
$complexParts[4] = -1;
|
||||
}
|
||||
} else {
|
||||
// ... or if we have only the real and no imaginary part
|
||||
// (in which case our real should be the imaginary)
|
||||
$complexParts[4] = $complexParts[1];
|
||||
$complexParts[1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Return real and imaginary parts and suffix as an array, and set a default suffix if user input lazily
|
||||
return [
|
||||
$complexParts[1],
|
||||
$complexParts[4],
|
||||
!empty($complexParts[9]) ? $complexParts[9] : 'i'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function __construct($realPart = 0.0, $imaginaryPart = null, $suffix = 'i')
|
||||
{
|
||||
if ($imaginaryPart === null) {
|
||||
if (is_array($realPart)) {
|
||||
// We have an array of (potentially) real and imaginary parts, and any suffix
|
||||
list ($realPart, $imaginaryPart, $suffix) = array_values($realPart) + [0.0, 0.0, 'i'];
|
||||
} elseif ((is_string($realPart)) || (is_numeric($realPart))) {
|
||||
// We've been given a string to parse to extract the real and imaginary parts, and any suffix
|
||||
list($realPart, $imaginaryPart, $suffix) = self::parseComplex($realPart);
|
||||
}
|
||||
}
|
||||
|
||||
if ($imaginaryPart != 0.0 && empty($suffix)) {
|
||||
$suffix = 'i';
|
||||
} elseif ($imaginaryPart == 0.0 && !empty($suffix)) {
|
||||
$suffix = '';
|
||||
}
|
||||
|
||||
// Set parsed values in our properties
|
||||
$this->realPart = (float) $realPart;
|
||||
$this->imaginaryPart = (float) $imaginaryPart;
|
||||
$this->suffix = strtolower($suffix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the real part of this complex number
|
||||
*
|
||||
* @return Float
|
||||
*/
|
||||
public function getReal(): float
|
||||
{
|
||||
return $this->realPart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the imaginary part of this complex number
|
||||
*
|
||||
* @return Float
|
||||
*/
|
||||
public function getImaginary(): float
|
||||
{
|
||||
return $this->imaginaryPart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the suffix of this complex number
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public function getSuffix(): string
|
||||
{
|
||||
return $this->suffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this is a real value, false if a complex value
|
||||
*
|
||||
* @return Bool
|
||||
*/
|
||||
public function isReal(): bool
|
||||
{
|
||||
return $this->imaginaryPart == 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this is a complex value, false if a real value
|
||||
*
|
||||
* @return Bool
|
||||
*/
|
||||
public function isComplex(): bool
|
||||
{
|
||||
return !$this->isReal();
|
||||
}
|
||||
|
||||
public function format(): string
|
||||
{
|
||||
$str = "";
|
||||
if ($this->imaginaryPart != 0.0) {
|
||||
if (\abs($this->imaginaryPart) != 1.0) {
|
||||
$str .= $this->imaginaryPart . $this->suffix;
|
||||
} else {
|
||||
$str .= (($this->imaginaryPart < 0.0) ? '-' : '') . $this->suffix;
|
||||
}
|
||||
}
|
||||
if ($this->realPart != 0.0) {
|
||||
if (($str) && ($this->imaginaryPart > 0.0)) {
|
||||
$str = "+" . $str;
|
||||
}
|
||||
$str = $this->realPart . $str;
|
||||
}
|
||||
if (!$str) {
|
||||
$str = "0.0";
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->format();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates whether the argument is a valid complex number, converting scalar or array values if possible
|
||||
*
|
||||
* @param mixed $complex The value to validate
|
||||
* @return Complex
|
||||
* @throws Exception If the argument isn't a Complex number or cannot be converted to one
|
||||
*/
|
||||
public static function validateComplexArgument($complex): Complex
|
||||
{
|
||||
if (is_scalar($complex) || is_array($complex)) {
|
||||
$complex = new Complex($complex);
|
||||
} elseif (!is_object($complex) || !($complex instanceof Complex)) {
|
||||
throw new Exception('Value is not a valid complex number');
|
||||
}
|
||||
|
||||
return $complex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the reverse of this complex number
|
||||
*
|
||||
* @return Complex
|
||||
*/
|
||||
public function reverse(): Complex
|
||||
{
|
||||
return new Complex(
|
||||
$this->imaginaryPart,
|
||||
$this->realPart,
|
||||
($this->realPart == 0.0) ? null : $this->suffix
|
||||
);
|
||||
}
|
||||
|
||||
public function invertImaginary(): Complex
|
||||
{
|
||||
return new Complex(
|
||||
$this->realPart,
|
||||
$this->imaginaryPart * -1,
|
||||
($this->imaginaryPart == 0.0) ? null : $this->suffix
|
||||
);
|
||||
}
|
||||
|
||||
public function invertReal(): Complex
|
||||
{
|
||||
return new Complex(
|
||||
$this->realPart * -1,
|
||||
$this->imaginaryPart,
|
||||
($this->imaginaryPart == 0.0) ? null : $this->suffix
|
||||
);
|
||||
}
|
||||
|
||||
protected static $functions = [
|
||||
'abs',
|
||||
'acos',
|
||||
'acosh',
|
||||
'acot',
|
||||
'acoth',
|
||||
'acsc',
|
||||
'acsch',
|
||||
'argument',
|
||||
'asec',
|
||||
'asech',
|
||||
'asin',
|
||||
'asinh',
|
||||
'atan',
|
||||
'atanh',
|
||||
'conjugate',
|
||||
'cos',
|
||||
'cosh',
|
||||
'cot',
|
||||
'coth',
|
||||
'csc',
|
||||
'csch',
|
||||
'exp',
|
||||
'inverse',
|
||||
'ln',
|
||||
'log2',
|
||||
'log10',
|
||||
'negative',
|
||||
'pow',
|
||||
'rho',
|
||||
'sec',
|
||||
'sech',
|
||||
'sin',
|
||||
'sinh',
|
||||
'sqrt',
|
||||
'tan',
|
||||
'tanh',
|
||||
'theta',
|
||||
];
|
||||
|
||||
protected static $operations = [
|
||||
'add',
|
||||
'subtract',
|
||||
'multiply',
|
||||
'divideby',
|
||||
'divideinto',
|
||||
];
|
||||
|
||||
/**
|
||||
* Returns the result of the function call or operation
|
||||
*
|
||||
* @return Complex|float
|
||||
* @throws Exception|\InvalidArgumentException
|
||||
*/
|
||||
public function __call($functionName, $arguments)
|
||||
{
|
||||
$functionName = strtolower(str_replace('_', '', $functionName));
|
||||
|
||||
// Test for function calls
|
||||
if (in_array($functionName, self::$functions, true)) {
|
||||
$functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
|
||||
return $functionName($this, ...$arguments);
|
||||
}
|
||||
// Test for operation calls
|
||||
if (in_array($functionName, self::$operations, true)) {
|
||||
$functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
|
||||
return $functionName($this, ...$arguments);
|
||||
}
|
||||
throw new Exception('Complex Function or Operation does not exist');
|
||||
}
|
||||
}
|
||||
13
vendor/markbaker/complex/classes/src/Exception.php
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Exception.
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
class Exception extends \Exception
|
||||
{
|
||||
}
|
||||
29
vendor/markbaker/complex/classes/src/functions/abs.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex abs() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the absolute value (modulus) of a complex number.
|
||||
* Also known as the rho of the complex number, i.e. the distance/radius
|
||||
* from the centrepoint to the representation of the number in polar coordinates.
|
||||
*
|
||||
* This function is a synonym for rho()
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return float The absolute (or rho) value of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
*
|
||||
* @see rho
|
||||
*
|
||||
*/
|
||||
function abs($complex): float
|
||||
{
|
||||
return rho($complex);
|
||||
}
|
||||
38
vendor/markbaker/complex/classes/src/functions/acos.php
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex acos() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the inverse cosine of a complex number.
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return Complex The inverse cosine of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
*/
|
||||
function acos($complex): Complex
|
||||
{
|
||||
$complex = Complex::validateComplexArgument($complex);
|
||||
|
||||
$square = clone $complex;
|
||||
$square = multiply($square, $complex);
|
||||
$invsqrt = new Complex(1.0);
|
||||
$invsqrt = subtract($invsqrt, $square);
|
||||
$invsqrt = sqrt($invsqrt);
|
||||
$adjust = new Complex(
|
||||
$complex->getReal() - $invsqrt->getImaginary(),
|
||||
$complex->getImaginary() + $invsqrt->getReal()
|
||||
);
|
||||
$log = ln($adjust);
|
||||
|
||||
return new Complex(
|
||||
$log->getImaginary(),
|
||||
-1 * $log->getReal()
|
||||
);
|
||||
}
|
||||
34
vendor/markbaker/complex/classes/src/functions/acosh.php
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex acosh() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the inverse hyperbolic cosine of a complex number.
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return Complex The inverse hyperbolic cosine of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
*/
|
||||
function acosh($complex)
|
||||
{
|
||||
$complex = Complex::validateComplexArgument($complex);
|
||||
|
||||
if ($complex->isReal() && ($complex->getReal() > 1)) {
|
||||
return new Complex(\acosh($complex->getReal()));
|
||||
}
|
||||
|
||||
$acosh = acos($complex)
|
||||
->reverse();
|
||||
if ($acosh->getReal() < 0.0) {
|
||||
$acosh = $acosh->invertReal();
|
||||
}
|
||||
|
||||
return $acosh;
|
||||
}
|
||||
25
vendor/markbaker/complex/classes/src/functions/acot.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex acot() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the inverse cotangent of a complex number.
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return Complex The inverse cotangent of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
* @throws \InvalidArgumentException If function would result in a division by zero
|
||||
*/
|
||||
function acot($complex): Complex
|
||||
{
|
||||
$complex = Complex::validateComplexArgument($complex);
|
||||
|
||||
return atan(inverse($complex));
|
||||
}
|
||||
25
vendor/markbaker/complex/classes/src/functions/acoth.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex acoth() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the inverse hyperbolic cotangent of a complex number.
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return Complex The inverse hyperbolic cotangent of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
* @throws \InvalidArgumentException If function would result in a division by zero
|
||||
*/
|
||||
function acoth($complex): Complex
|
||||
{
|
||||
$complex = Complex::validateComplexArgument($complex);
|
||||
|
||||
return atanh(inverse($complex));
|
||||
}
|
||||
29
vendor/markbaker/complex/classes/src/functions/acsc.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex acsc() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the inverse cosecant of a complex number.
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return Complex The inverse cosecant of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
* @throws \InvalidArgumentException If function would result in a division by zero
|
||||
*/
|
||||
function acsc($complex): Complex
|
||||
{
|
||||
$complex = Complex::validateComplexArgument($complex);
|
||||
|
||||
if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
|
||||
return new Complex(INF);
|
||||
}
|
||||
|
||||
return asin(inverse($complex));
|
||||
}
|
||||
29
vendor/markbaker/complex/classes/src/functions/acsch.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex acsch() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the inverse hyperbolic cosecant of a complex number.
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return Complex The inverse hyperbolic cosecant of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
* @throws \InvalidArgumentException If function would result in a division by zero
|
||||
*/
|
||||
function acsch($complex): Complex
|
||||
{
|
||||
$complex = Complex::validateComplexArgument($complex);
|
||||
|
||||
if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
|
||||
return new Complex(INF);
|
||||
}
|
||||
|
||||
return asinh(inverse($complex));
|
||||
}
|
||||
28
vendor/markbaker/complex/classes/src/functions/argument.php
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex argument() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the argument of a complex number.
|
||||
* Also known as the theta of the complex number, i.e. the angle in radians
|
||||
* from the real axis to the representation of the number in polar coordinates.
|
||||
*
|
||||
* This function is a synonym for theta()
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return float The argument (or theta) value of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
*
|
||||
* @see theta
|
||||
*/
|
||||
function argument($complex): float
|
||||
{
|
||||
return theta($complex);
|
||||
}
|
||||
29
vendor/markbaker/complex/classes/src/functions/asec.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex asec() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the inverse secant of a complex number.
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return Complex The inverse secant of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
* @throws \InvalidArgumentException If function would result in a division by zero
|
||||
*/
|
||||
function asec($complex): Complex
|
||||
{
|
||||
$complex = Complex::validateComplexArgument($complex);
|
||||
|
||||
if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
|
||||
return new Complex(INF);
|
||||
}
|
||||
|
||||
return acos(inverse($complex));
|
||||
}
|
||||
29
vendor/markbaker/complex/classes/src/functions/asech.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex asech() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the inverse hyperbolic secant of a complex number.
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return Complex The inverse hyperbolic secant of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
* @throws \InvalidArgumentException If function would result in a division by zero
|
||||
*/
|
||||
function asech($complex): Complex
|
||||
{
|
||||
$complex = Complex::validateComplexArgument($complex);
|
||||
|
||||
if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
|
||||
return new Complex(INF);
|
||||
}
|
||||
|
||||
return acosh(inverse($complex));
|
||||
}
|
||||
37
vendor/markbaker/complex/classes/src/functions/asin.php
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* Function code for the complex asin() function
|
||||
*
|
||||
* @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
|
||||
* @license https://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
namespace Complex;
|
||||
|
||||
/**
|
||||
* Returns the inverse sine of a complex number.
|
||||
*
|
||||
* @param Complex|mixed $complex Complex number or a numeric value.
|
||||
* @return Complex The inverse sine of the complex argument.
|
||||
* @throws Exception If argument isn't a valid real or complex number.
|
||||
*/
|
||||
function asin($complex): Complex
|
||||
{
|
||||
$complex = Complex::validateComplexArgument($complex);
|
||||
|
||||
$square = multiply($complex, $complex);
|
||||
$invsqrt = new Complex(1.0);
|
||||
$invsqrt = subtract($invsqrt, $square);
|
||||
$invsqrt = sqrt($invsqrt);
|
||||
$adjust = new Complex(
|
||||
$invsqrt->getReal() - $complex->getImaginary(),
|
||||
$invsqrt->getImaginary() + $complex->getReal()
|
||||
);
|
||||
$log = ln($adjust);
|
||||
|
||||
return new Complex(
|
||||
$log->getImaginary(),
|
||||
-1 * $log->getReal()
|
||||
);
|
||||
}
|
||||