作曲家做得不好

时间:2019-10-15 00:52:22

标签: php .htaccess composer-php

我尝试通过网络管理员安装模块。该动作调用一个函数,该函数允许通过作曲家安装库。

我的问题是每次在我的shop目录中的htaccess中访问被拒绝时,作曲家都会创建一个。

结论,不可能显示网站

我不需要此htaccess。 如何解决这个问题。

/shop/.htaccess ===> do not need this files (create automatically)
/shop/composer.lock
/shop/composer.json
public function __construct()
{
  static::$root = CORE::getConfig('dir_root', 'Shop');
  static::$composerJson = static::$root . 'composer.json';

  //define  composer environment
  putenv('COMPOSER_HOME=' . self::$root);
  putenv('COMPOSER_CACHE_DIR=' . CORE::BASE_DIRECTORY . '/Work/Cache/Composer/');
}

public static function install($library = null)
{
  if (self::checkExecute() == true) {
    if (is_null($library)) {
      $result = false;
    } else {
      $cmd = 'cd ' . self::$root . ' && composer require  ' . $library . ' 2>&1';
      exec($cmd, $output, $return); // update dependencies

      $result = $output[2];
    }

    return $result;
  }
}

谢谢。

0 个答案:

没有答案