J4.x

J4.x:Kutayarisha mazingira yako ya kienyeji

From Joomla! Documentation

This page is a translated version of the page J4.x:Setting Up Your Local Environment and the translation is 48% complete.

Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎français • ‎עברית • ‎हिन्दी • ‎日本語 • ‎Kiswahili • ‎Türkçe • ‎中文(台灣)‎
Tutorial
Ni vipi kutayarisha mazingira ya kienyeji kwa Joomla 4
Joomla! 
4.x

Kuanzia Joomla 4, tumebadilisha maendesho ya maendeleo. Haitawezekana tena kudupliketi yaliohifadhiwa na kuwa na usakinishaji wa Joomla iliyo tayari kwa kutmia. Tunafuata mfano mzuri na tumefahamisha maendesho ya kujenga CMS.

Mwongozo wa kuanzisha haraka

Inategemea na mfumo wako wa mwendesho ni vipi utafanya ili uweze kurekebisha mazingira yako ya maendeleo. Hatuwezi kuandika mwongozo kwa kila aina ya mfumo. Kwa hivyo unapaswa kuuliza mashini ya kutafuta kwa kupata maelezo unayohitaji.

Zana unazohitaji

  1. PHP - kwa kimsingi hii ni sawa na ya kuendesha tovuti ya Joomla, lakni unahitaji toleo la PHP CLI (command line interface) - angalia kurasa ya Kusanidi seva ya LAMPP kwa maendeleo ya PHP
  2. Composer - kwa kusimamia mategemezi ya PHP ya Joomla - kwa usaidizi wa kusakinisha Composer, soma mwongozo katika https://getcomposer.org/doc/00-intro.md
  3. Node.js - kwa kukusanya mafaili ya Joomla ya JavaScript na SASS - kwa usaidizi wa kusakinisha Node.js, tafadhali fuata maelezo yanayopatikana kwa https://nodejs.org/en/
  4. Git - kwa kusimamia matoleo

Hatua za kurekebisha mazingira ya kienyeji

  1. Dupliketi yaliohifadhiwa
  2. Anzisha composer install kutoka kwa enzi ya hifadhi ya Git (unaweza kuongeza --ignore-platform-reqs ikiwa hauna PHP-LDAP iliyosakinishwa kwa kienyeji na hauihitaji)
  3. Anzisha npm install kutoka kwa enzi ya hifadhi ya Git

Linux and OSX users can set up the following bash alias by placing the following inside the ~/.bashrc file:

alias jinstall="rm -rf administrator/templates/atum/css; rm -rf templates/cassiopeia/css; rm -rf media/; rm -rf node_modules/; rm -rf libraries/vendor/; composer install; npm ci; git checkout -- libraries/vendor/.htaccess"

This will wipe all the compiled files in your system and run a fresh install as one command by calling jinstall inside your Joomla install.

Mwongozo mrefu kidogo wa kuanzisha

Siku hizi Joomla si tofauti na zana zingine za wovuti. Iko na sehemu kubwa ya PHP, na ina zaidi sana kodi ya JavaScript. Matumizi ya PHP haihitaji marekebisho mengi, isipokuwa JavaScript inataka uchezenayo sana. Sababu kubwa ni hakuna mtu anaeandika kodi ambayo inajulikana na visakuzi vyote. Kwa hivyo, kodi nilazima itafsiriwe kwa mfano kutoka kwa ES6 kwa toleo litakaloingiliana na JavaScript. Na kweli ni sawa na CSS - kwa Joomla tunatumia SASS, na hii itageuzwa kwa CSS ya asili, ili iweze kujulikana kwa kila kisakuzi. Majuto ni matayarisho ya mazingira ya maendeleo yatakuwa ni magumu, lakini mazana yatarahisisha kuandika kodi. Kwa mfano ni vizuri kuna uboreshaji wa kisakuzi na kuweza kuona mabadiliko yako wakati huo.

PHP

It should be enough to run composer install as this will install PHP dependencies saved in the composer.lock file. You can do this as many times as you like, it will only install new packages when the composer.lock file is changed. Don't run composer update as this will update all packages to newer versions and update the composer.lock file.

Note: You may need to run composer install with the --ignore-platform-reqs option to ignore platform requirements specified in Composer, i.e. if you do not have PHP's LDAP extension installed.

Node/npm scripts

Node.js comes with a package manager called NPM (in some way the same as Composer). NPM has a run command and we have prepared some scripts to make your life easier. You have to run the commands for the root of the repository

npm run build:css

It will compile SASS files to CSS and also create the minified files.

npm run build:js

It will compile and transpile the JavaScript files to the correct format and create minified files

npm run watch:css

This is the same as the build:css command but will watch for changes and automatically build updated files.

npm run watch:js

This is the same as the build:js command but will watch for changes and automatically build updated files.

npm run lint:js

This will make a syntax check on JavaScript files.

npm run test

This will run other JavaScript testing suite.

Possible Issues

If you receive a login error such as shown below, then delete the \library\autoload_psr4.php file as shown in the second image. Login After Install Error autoload_psr4.php