Back to InstallerScript class

Method moveCliFiles

public void
moveCliFiles
()
Moves the CLI scripts into the CLI folder in the CMS
Returns
  • void
Since
  • 3.6

Method moveCliFiles - Source code

/**
 * Moves the CLI scripts into the CLI folder in the CMS
 *
 * @return  void
 *
 * @since   3.6
 */
public function moveCliFiles()
{
    if (!empty($this->cliScriptFiles)) {
        foreach ($this->cliScriptFiles as $file) {
            $name = basename($file);
            if (file_exists(JPATH_ROOT . $file) && !File::move(JPATH_ROOT . $file, JPATH_ROOT . '/cli/' . $name)) {
                echo Text::sprintf('JLIB_INSTALLER_FILE_ERROR_MOVE', $name);
            }
        }
    }
}