PHP-JIMPORT-001
jimport('joomla.filesystem.file')
jimport() autoloader calls
jimport() was how Joomla 1.5–3 loaded classes. Joomla 4 uses Composer PSR-4. The function is gone. No plugin restores it.
jimport('joomla.filesystem.file') → use Joomla\CMS\Filesystem\File;
What you will see
- Call to undefined function jimport()
- Call to undefined function jimport
Symptoms people search
undefined function jimport · install script dies on Joomla 4
Replace this code
Swap jimport('joomla.filesystem.file') for use Joomla\CMS\Filesystem\File;.
Joomla 3
Remove or stop calling this
jimport('joomla.filesystem.file');
JFile::copy($src, $dest);Joomla 4 / 6
Use this instead
use Joomla\CMS\Filesystem\File;
File::copy($src, $dest);How to fix it
- 1Delete every jimport() line.
- 2Add a use statement for the namespaced class.
- 3Replace JFile/JFolder/JPath with File/Folder/Path.
Also known as
jimport · joomla.filesystem
Related issues
- Joomla 3 → 4PHP
DS path constant
DS → DIRECTORY_SEPARATOR or /
- Joomla 3 → 4PHP
JPATH_PLATFORM
JPATH_PLATFORM → Do not use — autoload instead
- Joomla 3 → 4Joomla API
isAdmin() / isSite()
$app->isAdmin() → $app->isClient('administrator') / isClient('site')
- Joomla 3 → 4Templates
ISIS / Hathor admin templates
ISIS → Atum
- Joomla 3 → 4PHP
mysql_* PHP functions
mysql_query() → Joomla DatabaseInterface / mysqli / PDO
- Joomla 3 → 4PHP
each() / create_function() / ereg / split
each($array) → foreach / closures / preg_*