{* $Id$ *} {if ! $composer_available} {remarksbox type="warning" title="{tr}Composer not found{/tr}"} {tr}Composer could not be executed, so the automated check on the packages cannot be performed.{/tr}
{tr _0='{tr}Diagnose{/tr}' _1=''}In %0Diagnose%1 tab you can install composer.{/tr} {/remarksbox} {/if} {if isset($composer_output)} {remarksbox type="note" title="{tr}Note{/tr}"} {tr}Result of executing the changes to the packages:{/tr}
{$composer_output}
{/remarksbox} {/if} {if isset($composer_installed_errors)} {remarksbox type="warning" title="{tr}Composer errors{/tr}"} {tr}Composer returned some errors:{/tr}
{$composer_installed_errors}
{/remarksbox} {/if} {if not empty($composer_environment_warning)} {remarksbox type="warning" title="{tr}Issues with composer environment{/tr}"}

{tr}Issues with composer environment:{/tr}

{tr _0='sh setup.sh fix' _1='doc.tiki.org/Packages'}Run %0 from a shell to try to fix this, see %1 for more info.{/tr}

{/remarksbox} {/if} {if isset($extensions_output)} {if $extensions_status} {$type = 'success'} {$title = "{tr}Success{/tr}"} {else} {$type = 'error'} {$title = "{tr}Error{/tr}"} {/if} {remarksbox type=$type title=$title close="y"}
{$extensions_output}
{/remarksbox} {/if} {tabset name='tabs_admin-packages'} {tab name="{tr}Packages{/tr}"} {if ! $composer_phar_exists}
{remarksbox type="note" title="{tr}Note{/tr}"} {tr}Packages check could not be performed at the moment due to missing{/tr} temp/composer.phar
{tr}You can try to install composer from the Diagnose tab or look at the manual instructions bellow.{/tr} {/remarksbox} {/if} {if count($composer_packages_installed)}

{tr}Installed Packages{/tr} {tr}Status of the packages registered in the composer.json file{/tr}

{foreach item=entry from=$composer_packages_installed} {/foreach} {if $composer_packages_missing} {/if}
{tr}Package Name{/tr} {tr}Version Required{/tr} {tr}Status{/tr} {tr}Version Installed{/tr} {tr}Action{/tr}
{$entry.name} {$entry.required} {if $entry.upgradeVersion}{tr}Update:{/tr} {$entry.requiredVersion}{/if} {if $composer_phar_exists} {if $entry.status == 'installed'} {icon name='success' iclass='tips' ititle="{tr}Status:{/tr}{tr}Installed{/tr}"} {elseif $entry.status == 'missing'} {icon name='warning' iclass='tips' ititle="{tr}Status:{/tr}{tr}Missing{/tr}"} {else}   {/if} {/if} {$entry.installed|default:' '} {if $entry.state == 'replaced'} {icon name='exclamation-triangle'} {elseif $entry.state == 'deprecated'} {icon name='exclamation-triangle'} {else} {icon name='info-circle'} {/if} {if $entry.extension}
{ticket} {if !$entry.extensionEnabled} {elseif $entry.extensionUpdate} {else} {/if}
{/if} {if $entry.key} {if $composer_phar_exists}
{ticket} {if $entry.installed && $entry.upgradeVersion} {/if}
{/if} {else} {tr}Removal not available{/tr} {icon name='info' iclass='tips' ititle="{tr}Removal not available:{/tr}{tr}This package is not managed by Tiki and likely was installed manually.{/tr}"} {/if}
{if $composer_available}

{tr}One or more packages appear to be missing{/tr}

{tr}In the list above, some packages could not be found. They are defined in the composer.json file, but do not seem to be installed.{/tr} {else}

{tr}Could not validate the status of one or more packages{/tr}

{tr}In the list above, some packages status could not be validated, since composer was not found, you can try to install composer and try again or install the packages manually.{/tr} {/if}

{if $composer_available}

{tr}Install packages from the administrator interface{/tr}

{tr}The administrator interface can be used to install the packages marked as missing in the list above.{/tr} {tr}Click the "Fix Missing Packages" button below, and Tiki will try to install them:{/tr}

{ticket}

The results of the execution of the commands will be displayed after the process finishes.

{/if}

{tr}Install packages manually{/tr}

{if ! $composer_available}

{tr _0="composer"}Make sure %0 is installed.{/tr}

{tr}Composer can be installed manually, in the host machine, by following the instructions from the{/tr} Composer {tr}website.{/tr}

{tr _0="setup.sh" _1="temp/composer.phar"}The script %0 that is included in the Tiki distribution can be run to make sure composer is installed and the file permissions are correctly applied. In this case, composer will be installed as %1.{/tr} {tr}Below is an example of how to do this in a Linux-like operating system:{/tr}
bash ./setup.sh composer

{tr}Install the missing packages.{/tr}

{/if}

{tr}You can install the missing packages by issuing the command{/tr} composer --no-dev --prefer-dist update. {tr}Below is an example of how to do this in a Linux-like operating system:{/tr}
php temp/composer.phar --no-dev --prefer-dist update

{/if} {if count($composer_packages_available)}

{tr}Available Packages{/tr} {tr}These packages have been identified as required by one or more features.{/tr}

{foreach item=entry from=$composer_packages_available} {/foreach}
{tr}Package Name{/tr} {tr}Version{/tr} {tr}Licence{/tr} {tr}Required by{/tr} {tr}Action{/tr}
{$entry.name} {if $entry.state == 'replaced'} {icon name='exclamation-triangle'} {/if} {$entry.requiredVersion} {if empty($entry.licence)}{tr}Not Available{/tr}{else}{$entry.licence}{/if} {', '|implode:$entry.requiredBy} {if $composer_phar_exists}
{ticket}
{/if}

{tr}There appear to be some optional packages that can be installed{/tr}

{tr}In the list above, there are optional packages that may be installed in order to use the Tiki features that require the package.{/tr}

{if $composer_available}

{tr}Install packages from the administrator interface{/tr}

{tr}The administrator interface can be used to install the optional packages in the list above.{/tr} {tr}Click the "Install Package" button, and Tiki will try to install them.{/tr}

{/if}

{tr}Install packages manually{/tr}

{if ! $composer_available}

{tr _0="composer"}Make sure %0 is installed.{/tr}

{tr}Composer can be installed manually, in the host machine, by following the instructions from the{/tr} Composer {tr}website.{/tr}

{tr _0="setup.sh" _1="temp/composer.phar"}The script %0 that is included in the Tiki distribution can be run to make sure composer is installed and the file permissions are correctly applied. In this case, composer will be installed as %1.{/tr} {tr}Below is an example of how to do this in a Linux-like operating system:{/tr}
bash ./setup.sh composer

{/if}

{tr _0="composer.json"}Make sure there is a %0 file in the root of the website.{/tr}

{tr _0="composer.json"}If there is not already a %0 file, then create one.{/tr} {tr}The sample composer.json.dist that comes with Tiki can be used as a starting point.{/tr} {tr}Below is an example of how to do this in a Linux-like operating system:{/tr}
cp composer.json.dist composer.json

{tr}Install the package.{/tr}

{tr}Packages can be installed by issuing a command{/tr} composer require package:version {tr}for each package that is to be installed.{/tr} {tr}Below is an example of how to do this in a Linux-like operating system:{/tr}
php temp/composer.phar require --update-no-dev --prefer-dist psr/log:^1.0

{/if} {/tab} {tab name="{tr}Packages Custom{/tr}"} {if ! $composer_custom_packages_installed} {remarksbox type="info" title="{tr}There are no manual managed packages installed in the folder vendor_custom{/tr}"} {tr}Please check Tiki Packages website for information on how to download and use these manual packages.{/tr}
{tr}Note that this in place for when you can not use composer to manage your packages, example when there is restricted access to internet and composer will not be able to download the packages, for most users the most convenient way is to install directly from the "Packages" tab.{/tr} {/remarksbox} {/if} {if $composer_custom_packages_installed} {if ! $composer_phar_exists} {remarksbox type="info" title="{tr}Note{/tr}"} {tr}Packages check could not be performed at the moment due to missing{/tr} temp/composer.phar
{tr}You can try to install composer from the Diagnose tab or look at the manual instructions bellow.{/tr} {/remarksbox} {/if}

{tr}Composer Packages Custom Status of the packages registered in the vendor_custom folder{/tr}

{remarksbox type="info" title="{tr}For information only{/tr}"} {tr}These packages are managed manually and displayed here for informational purposes.{/tr} {/remarksbox} {foreach item=packages key=folderName from=$composer_custom_packages_installed} {foreach item=package from=$packages} {/foreach} {/foreach}
{tr}Package Name{/tr} {tr}Version Required{/tr} {tr}Status{/tr} {tr}Version Installed{/tr} Actions
{$folderName}
{$package.name} {$package.required} {if $package.status == 'installed'} {icon name='success' iclass='tips' ititle="{tr}Status:{/tr}{tr}Installed{/tr}"} {elseif $package.status == 'missing'} {icon name='warning' iclass='tips' ititle="{tr}Status:{/tr}{tr}Missing{/tr}"} {/if} {$package.installed|default:' '} {if $package.extension}
{ticket} {if !$package.extensionEnabled} {elseif $package.extensionUpdate} {else} {/if}
{/if}
{/if} {/tab} {tab name="{tr}Packages Bundled{/tr}"} {if $composer_available} {remarksbox type="info" title="{tr}For information only{/tr}"} {tr}These packages are bundled with Tiki, and displayed here for informational purposes.{/tr} {/remarksbox} {/if} {if ! $composer_phar_exists} {remarksbox type="info" title="{tr}Note{/tr}"} {tr}Packages check could not be performed at the moment due to missing{/tr} temp/composer.phar
{tr}You can try to install composer from the Diagnose tab or look at the manual instructions bellow.{/tr} {/remarksbox} {/if}

{tr}Composer Packages Bundled{/tr} {tr}status of the packages registered in the vendor_bundled/composer.json file{/tr}

{foreach item=entry from=$composer_bundled_packages_installed} {/foreach}
{tr}Package Name{/tr} {tr}Version Required{/tr} {tr}Status{/tr} {tr}Version Installed{/tr}
{$entry.name} {$entry.required} {if $composer_phar_exists} {if $entry.status == 'installed'} {icon name='success' iclass='tips' ititle="{tr}Status:{/tr}{tr}Installed{/tr}"} {elseif $entry.status == 'missing'} {icon name='warning' iclass='tips' ititle="{tr}Status:{/tr}{tr}Missing{/tr}"} {else}   {/if} {/if} {$entry.installed|default:' '}
{/tab} {tab name="{tr}Diagnose{/tr}"}

{tr}Diagnose Composer Installation{/tr} {tr}Use the button below to test your composer installation.{/tr}

{ticket}

{tr}Composer management{/tr}

{ticket} {if ! $composer_available} {else} {/if}

{if isset($diagnostic_composer_location) || $diagnostic_composer_output || $composer_management_success || $composer_management_error}

{tr}Results{/tr}

{if isset($diagnostic_composer_location) }

Composer: {if $diagnostic_composer_location}{tr}{$diagnostic_composer_location}{/tr}{else}{tr}Composer not found{/tr}{/if}

{/if} {if $diagnostic_composer_output}

Composer diagnose output

{$diagnostic_composer_output}
{/if} {if $composer_management_success} {remarksbox type="success" title="{tr}Success{/tr}" close="n"} {$composer_management_success} {/remarksbox} {/if} {if $composer_management_error} {remarksbox type="error" title="{tr}Error{/tr}" close="n"} {$composer_management_error} {/remarksbox} {/if}
{/if} {/tab} {if count($packageprefs)} {tab name="{tr}Extensions Preferences{/tr}"}
{ticket}
{tr}Activate Extension Package{/tr} {foreach $packageprefs as $package} {preference name="{$package|escape}"} {/foreach}

{/tab} {/if} {/tabset} {jq} $(document).ready(function(){ $(".install-composer").click(function(){ $('.nav-tabs a[href="#contenttabs_admin_packages-4"]').tab('show'); }); }); {/jq}