軟件包名稱:打開TOK獲得的附加捆綁錯誤供應商的文件夾中的Symfony2
(我從GitHub下載了)我把該文件夾中的Symfony的供應商的文件夾(項目名\供應商\ OpenTok \ OpenTok \和所有文件和文件夾,在這裏)
在AppKernel.php在
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new OpenTokBundle\OpenTokBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new AdminBundle\AdminBundle(),
new SiteBundle\SiteBundle(),
new WSBundle\WSBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
}
}
應用程序\ autoload.php
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;
/**
* @var ClassLoader $loader
*/
$loader = require __DIR__.'/../vendor/autoload.php';
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
$loader->add('OpenTok' , __DIR__.'/..vendor/OpenTok');
return $loader;
?>
Composer.json
"require": {
"php": ">=5.3.9",
"symfony/symfony": "2.8.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"opentok/opentok": "dev-master"
},
這上面的代碼給我錯誤:
Fatal error: Class 'OpenTokBundle\OpenTokBundle' not found
現在我怎麼能在我的所有其他文件使用opentok捆綁?請幫幫我。我是symfony的新手
對不起,先生,但即時通訊新的symfony,我不能得到理解第二和第三點 –
請看到我的編輯問題 –
您已經'opentok/opentok '在你的composer.json中。你的機器上有作曲家嗎?如果沒有,打開終端,進入Symfony應用程序的根目錄並安裝它(請參閱https://getcomposer.org/download/)。然後在終端運行'php composer.phar update opentok/opentok'。有關作曲家的更多信息,請參閱https://getcomposer.org/doc/01-basic-usage.md – qooplmao