FPDI-2.3.6 "Fatal error: Uncaught Error: Class "FPDI" not found" (2021) - fpdf

I download and uncompress FPDF 1.83 and FPDI 2.3.6, after I load correctlly with:
<?php
require_once('fpdf183/fpdf.php');
require_once('FPDI-2.3.6/src/autoload.php');
but when I try use:
<?php
require_once('fpdf183/fpdf.php');
require_once('FPDI-2.3.6/src/autoload.php');
$pdf = new FPDI();
Fatal error: Uncaught Error: Class "FPDI" not found ... on line 5
how I can fixed that?, how I can use ALL functions FPDI and FPDF without use composer ?

You need use additional line: use setasign\Fpdi\Fpdi;
<?php
require_once('fpdf183/fpdf.php');
require_once('FPDI-2.3.6/src/autoload.php');
use setasign\Fpdi\Fpdi;
However opening PDFs with PDFI in 2021 maybe you get:
Alternatively the document you're trying to import has to be resaved without the use of compressed cross-reference streams and objects by an external programm (e.g. by lowering the PDF version to 1.4).
Then setasign.com reply: We offer a commercial addon which enables FPDI to handle documents that uses these compression features. :#
https://www.setasign.com/support/faq/fpdi/error-document-compression-technique-not-supported/

Related

How to add Babel support for nullishCoalescingOperator to vue project?

In my Vue-CLI project, when I tried using the ?? operator, I got this error:
Syntax Error: SyntaxError: /Users/stevebennett/odev/freelancing/v-map/src/components/Map.vue: >Support for the experimental syntax 'nullishCoalescingOperator' isn't currently enabled (30:29):
...
Add #babel/plugin-proposal-nullish-coalescing-operator (https://git.io/vb4Se) to the 'plugins' section of your Babel config to enable transformation.
I installed #babel/plugin-syntax-nullish-coalescing-operator (its name seems to have changed), added it to my babel.config.js:
module.exports = {
presets: ['#vue/app'],
plugins: ['#babel/plugin-syntax-nullish-coalescing-operator'],
};
Now the error message seems to have gone backwards, no reference to the operator name at all:
Module parse failed: Unexpected token (39:35)
You may need an appropriate loader to handle this file type.
| case 8:
| points = _context.sent;
console.log(sheetID ?? 37);
What am I doing wrong?
For me, the #babel/plugin-syntax-nullish-coalescing-operator plugin would not work, which is the one you are using.
I had to use the #babel/plugin-proposal-nullish-coalescing-operator plugin which is the one that the error message suggests you use.
Additionally, I noticed this on the page for the #babel/plugin-syntax-nullish-coalescing-operator plugin:
I can't say for sure if this will fix your problem, but it certainly fixed mine

typo3 backend does not parse: syntax error, unexpected 'class' (T_CLASS)

I just installed Yet Another Gallery 4.0.7 on Typo3 6.2.19. When I try to open backend module I only get this error:
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/clients/client6/web32/web/typo3conf/ext/pt_extlist/Classes/Domain/Configuration/Filters/FilterConfig.php on line 351
Screenshot:
The error is coming from the extension "List Generator". The code uses the Class::class syntax which is probably not supported by your version of PHP. Check if you are running PHP 5.5 or higher.
You should try to call class like: 'Vendor\YourController\Task\Yourclass', instead of \Vender\YourController\Task\YourClass::class

Dancer DBIC Could not load schema_class

I have a Dancer app that is working. I am using DBIC for the database.
I want to add some tables to the database, and so I created new files for those. However, now when I restart the app, I get the following errors
Error while loading ././bin/app.pl: Could not load schema_class MyApp::Schema at /usr/local/share/perl/5.14.2/Dancer/Plugin/DBIC.pm line 42.
Compilation failed in require at ././bin/app.pl line 5.
BEGIN failed--compilation aborted at ././bin/app.pl line 5.
When I remove the new files, everything works fine.
Here is my Schema.pm file
package MyApp::Schema;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
use strict;
use warnings;
use base 'DBIx::Class::Schema';
__PACKAGE__->load_namespaces;
1;
Where can I get more information about the error and what I did wrong?
Since you are using __PACKAGE__->load_namespaces, all new classes will loaded, which explains why the simple existence of the new class files cause an error. If there is a syntax error in your new class files, then loading the schema will die.
You can use perl -c on the new class files to ensure they will compile and get a better idea of the problem if they do not.

using SoapClient,ArrayObject, ArrayIterator causes error in zend framework

I'm working on some helpful method in my entity.
private function setApi($api_address,$api_username,$api_password){
$this->api_address = $api_address;
$this->api_username = $api_username;
$this->api_password = $api_password;
$this->api_client = new SoapClient($api_address); // error
}
Warning: require(App/Entity/SoapClient.php): failed to open stream: No such file or directory in /zendboilerplate/library/Doctrine/Common/ClassLoader.php on line 148 Fatal error: require(): Failed opening required 'App/Entity/SoapClient.php' (include_path='/zendboilerplate/application/../library:/zendboilerplate/application/../library/Bisna/Application/Resource:/zendboilerplate/library:.:/usr/share/php:/usr/share/pear') in /zendboilerplate/library/Doctrine/Common/ClassLoader.php on line 148
It seems that zend looks for a class declaration (and it doesn't use included classes in php).
Identical error for each "new Class" declaration.
Using a my own class included in library everything is ok.
(Also tried with #new SoapClient() but no result).
I'm guessing this is namespace related. Try changing the line that is erroring to:
$this->api_client = new \SoapClient($api_address);
that should force it to use the PHP SoapClient instead of the namespace that is presumably declared at the start of the file you're having trouble with.

Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity

I was using this piece of php script in a application running under over XAMPP on my local machine:
$dom = new DomDocument();
$filename = "library.xml";
if (!$dom->load($filename))
die("Could not parse iTunes XML file: ".$filename);
Then i tried to move this application to a WampServer without success, with the following warning:
Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity "file:///C:/wamp/www/parser/library.xml" in C:\wamp\www\parser\includes\libs\itunes_xml_parser.lib.php on line 111
This line in the error is exactly the load line, which worked flawlessly in earlier versions of XAMPP and isn't working now on XAMPP 1.7.7
As per this why don't you try using an absolute path for your filepath.
Also i see that this php file is located at C:\wamp\www\parser\includes\libs and library.xml is being searched at C:/wamp/www/parser/. Is this correct?
It could also be possible that you had turned off warnings/errors in your earlier xampp installation.So check this also.