How is it possible to include a php library ?

Permalink Browser Info Environment
Hi,
I'm developping on concrete v9. I'm trying to code a block in which i could use a php library (simpleXLSX). I'd like to declare that library to import and read an XLSX file, but i'd like to use AJAX, so i'd like the library declared into the controller.php file...

How is it possible to do that ? Perhaps in package designer by checking the "elements" folder ?

Thanks.

Type: Ticket
Status: In Progress
crostif
View Replies:
ramonleenders replied on at Permalink Reply
ramonleenders
Hi there,

Ideally a package like that is installed with Composer. You could add composer to your Package and include the autoload.php file from composer in your package. But I wouldn't do all this with Package Designer. It's a bit more complicated and needs more work to it. More developer skills.

Does that answer your questions? If not, let me know!

Kind regards
Ramon

concrete5 Environment Information

# Concrete Version
Core Version - 9.1.3
Version Installed - 9.1.3
Database Version - 20220908074900

# Hostname
hr1531984552.reseller.mis.ovh.net

# Environment
production

# Database Information
Version: 10.3.38-MariaDB-0+deb10u1
SQL Mode: ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

# Concrete Packages
Block Designer (4.1.4), Calcul Trajet Asso (0.9.0), HTML+PHP Code Block (1.0.0), Light Slider (2.0), Package Designer (1.0.0), test (0.9.0), testlib (0.9.0), Theme Styling Tool (1.2.3)

# Concrete Overrides
single_pages/ajax_calcul.php

# Concrete Cache Settings
Block Cache - Off
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
fpm-fcgi

# PHP Version
7.4.33

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, ionCube Loader, json, ldap, libxml, mbstring, mysqli, mysqlnd, odbc, openssl, pcre, PDO, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, redis, Reflection, session, SimpleXML, soap, sockets, sodium, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 120
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 16M
upload_max_filesize - 16M
ic24.api.max_timeout - 7
ldap.max_links - Unlimited
mbstring.regex_retry_limit - 1000000
mbstring.regex_stack_limit - 100000
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
redis.pconnect.connection_limit - 0
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
unserialize_max_depth - 4096
opcache.max_accelerated_files - 10000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 OPR/98.0.0.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.