getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
355 stars 227 forks source link

Admin panel error : Call to undefined function Grav\Plugin\GitSync\exec() #2347

Open vparmeland opened 1 year ago

vparmeland commented 1 year ago

After installing quark-open-publishing theme, my admin do not work.

xxx@xxx:~/sites/mecafrontgrav$ bin/gpm install quark-open-publishing
GPM Releases Configuration: Stable

The following dependencies need to be installed...
  |- Package git-sync
  |- Package quark

 Install these packages? [Y|n]  (yes/no) [yes]:
 > Y

Preparing to install Git Sync [v2.3.2]
  |- Downloading package...   100%
  |- Checking destination...  ok
  |- Installing package...    ok                             
  '- Success!  

Preparing to install Quark [v2.0.4]
  |- Downloading package...   100%
  |- Checking destination...  ok
  |- Installing package...    ok                             
  '- Success!  

Dependencies are OK

Preparing to install Quark Open Publishing [v2.3.1]
  |- Downloading package...   100%
  |- Checking destination...  ok
  |- Installing package...    ok                             
  '- Success!  

Attention: Quark Open Publishing contains demo content

 Do you wish to install this demo content? [y|N]  (yes/no) [no]:
 > n

  '- Skipped!  

Clearing cache

Cleared:  /home/clients/xxxx/sites/mecafrontgrav/cache/twig/*
Cleared:  /home/clients/xxxx/sites/mecafrontgrav/cache/doctrine/*
Cleared:  /home/clients/xxxx/sites/mecafrontgrav/cache/compiled/*
Cleared:  /home/clients/xxxx/sites/mecafrontgrav/assets/*
Touched: /home/clients/xxxx/sites/mecafrontgrav/user/config/system.yaml

image

/home/clients/xxxxx/sites/mecafrontgrav/user/plugins/git-sync/classes/Helper.php

    /**
     * Checks if the user/ folder is already initialized
     *
     * @return bool
     */
    public static function isGitInitialized()
    {
        return file_exists(rtrim(USER_DIR, '/') . '/.git');
    }

    /**
     * @param bool $version
     * @return bool|string
     */
    public static function isGitInstalled($version = false)
    {
        $bin = Helper::getGitBinary();

        exec($bin . ' --version', $output, $returnValue);

        $installed = $returnValue === 0;

        if ($version && $output) {
            $output = explode(' ', array_shift($output));
            $versions = array_filter($output, static function($item) {
                return version_compare($item, '0.0.1', '>=');
            });

            $installed = array_shift($versions);
        }

        return $installed;
    }

    /**
     * @param bool $override
     * @return string
     */
    public static function getGitBinary($override = false)
Arguments
"Call to undefined function Grav\Plugin\GitSync\exec()"
ViliusS commented 1 year ago

You are running PHP version which has exec() function disabled.