Php Symfony,教程,使用RoutingAutoBundle创建基本CMS

Php Symfony,教程,使用RoutingAutoBundle创建基本CMS,php,symfony,content-management-system,doctrine-phpcr,Php,Symfony,Content Management System,Doctrine Phpcr,我正在制作简单的Symfony CMS教程,来自: http://symfony.com/doc/master/cmf/tutorial/introduction.html http://symfony.com/doc/master/cmf/tutorial/getting-started.html http://symfony.com/doc/master/cmf/tutorial/auto-routing.html 问题在于,尽管命令行没有显示任何错误,但没有加载装置,也没有生成管线 我的

我正在制作简单的Symfony CMS教程,来自:

http://symfony.com/doc/master/cmf/tutorial/introduction.html
http://symfony.com/doc/master/cmf/tutorial/getting-started.html
http://symfony.com/doc/master/cmf/tutorial/auto-routing.html
问题在于,尽管命令行没有显示任何错误,但没有加载装置,也没有生成管线

我的错在哪里?我完全遵循教程,除了安装,因为它不适合我。我安装了Symfony CMS的标准版,并在其中创建了BasicMsbundle

1)

      c:\Bitnami\wampstack-5.4.38-0\sym_prog\standard-edition>php app/console doctrine
        :phpcr:fixtures:load
        Careful, database will be purged. Do you want to continue Y/N ?y
          > purging database
          > Executing initializer: CmfContentBundle
          > Executing initializer: CmfSimpleCmsBundle Homepage
          > Executing initializer: CmfBlockBundle
          > Executing initializer: CmfMenuBundle
          > Executing initializer: My custom initializer
          > loading Acme\BasicCmsBundle\DataFixtures\PHPCR\LoadPageData
          > loading Acme\BasicCmsBundle\DataFixtures\PHPCR\LoadPostData

 If i check database:
C:\Bitnami\wampstack-5.4.38-0\sym_prog\standard-edition\app\app.sqlite
 - it is empty, there are no posts and pages. 


2) And the command below does not list routes.




c:\Bitnami\wampstack-5.4.38-0\sym_prog\standard-edition>php app/console doctrine
        :phpcr:node:dump
        ROOT:
          cms:
            content:
              blocks:
                hero_unit:
                  quick_tour:
                  configure:
                  demo:
            simple:
              home:
              demo:
              quick_tour:
              login:
            menu:
            pages:
              Home:
            posts:
              My First Post:
              My Second Post:
              My Third Post:
              My Fourth Post:
            routes:


3) Actually the tutorial does not show where and how to create resources for the fixtures. Maybe you could tell in short how web pages (resources) are generated in CMS for the given document and fixtures. 

    composer.json

        {
            "name": "symfony-cmf/standard-edition",
            "homepage": "http://cmf.symfony.com",
            "license": "MIT",
            "type": "project",
            "description": "The \"Symfony CMF Standard Edition\" distribution",
            "authors": [
                {
                    "name": "Symfony CMF Community",
                    "homepage": "https://github.com/symfony-cmf/standard-edition/contributors"
                }
            ],
            "autoload": {
                "psr-0": { "": "src/" }
            },
            "minimum-stability": "stable",
            "require": {
                "php": ">=5.3.3",
                "symfony/symfony": "~2.5",
                "doctrine/orm": "^2.4.8",
                "doctrine/doctrine-bundle": "~1.4",
                "doctrine/data-fixtures": "~1.0",
                "doctrine/doctrine-cache-bundle": "~1.0",
                "twig/extensions": "~1.0",
                "symfony/assetic-bundle": "~2.3",
                "symfony/swiftmailer-bundle": "~2.3",
                "symfony/monolog-bundle": "~2.4",
                "symfony-cmf/symfony-cmf": "1.2.*",
                "symfony-cmf/simple-cms-bundle": "1.2.*",
                "symfony-cmf/menu-bundle" : "~1.2", 
                "symfony-cmf/tree-browser-bundle": "~1.1",
                "symfony-cmf/create-bundle": "1.2.*",
                "symfony-cmf/routing-auto-bundle": "~1.0",
                "symfony-cmf/routing-bundle": "~1.3",
                "symfony-cmf/routing": "~1.3",        
                "jackalope/jackalope-doctrine-dbal": "1.1.*",
                "sensio/distribution-bundle": "~3.0",
                "sensio/framework-extra-bundle": "~3.0",
                "incenteev/composer-parameter-handler": "~2.0",
                "nelmio/alice": "~1.0",
                "sonata-project/doctrine-phpcr-admin-bundle" : "~1.2"
            },
            "require-dev": {
                "liip/functional-test-bundle": "~1.0",
                "sensio/generator-bundle": "~2.3"
            },
            "scripts": {
                "post-install-cmd": [
                    "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
                    "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
                ],
                "post-update-cmd": [
                    "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
                    "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
                ]
            },
            "config": {
                "bin-dir": "bin"
            },
            "extra": {
                "symfony-app-dir": "app",
                "symfony-web-dir": "web",
                "incenteev-parameters": {
                    "file": "app/config/parameters.yml"
                },
                "branch-alias": {
                    "dev-master": "1.2-dev"
                }
            }
        }

    C:\Bitnami\wampstack-5.4.38-0\sym_prog\standard-edition\app\AppKernel.php

<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // Symfony Standard Edition Bundles
            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 Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),

            // Symfony CMF Standard Edition Bundles
            new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(),
            new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
            new Symfony\Cmf\Bundle\CoreBundle\CmfCoreBundle(),
            new Symfony\Cmf\Bundle\ContentBundle\CmfContentBundle(),
            new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
            new Symfony\Cmf\Bundle\RoutingAutoBundle\CmfRoutingAutoBundle(),
            new Symfony\Cmf\Bundle\SimpleCmsBundle\CmfSimpleCmsBundle(),

            new Symfony\Cmf\Bundle\BlockBundle\CmfBlockBundle(),
            new Sonata\BlockBundle\SonataBlockBundle(),
            new Sonata\CoreBundle\SonataCoreBundle(),

            new Symfony\Cmf\Bundle\MenuBundle\CmfMenuBundle(),
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),

            new Symfony\Cmf\Bundle\CreateBundle\CmfCreateBundle(),
            new FOS\RestBundle\FOSRestBundle(),
            new JMS\SerializerBundle\JMSSerializerBundle(),

            // Remove this Bundle when using the SE as the basis for a new project
            new Acme\DemoBundle\AcmeDemoBundle(),
            new Acme\TaskBundle\AcmeTaskBundle(),
            new Acme\BasicCmsBundle\AcmeBasicCmsBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            $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(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
}

    C:\Bitnami\wampstack-5.4.38-0\sym_prog\standard-edition\app\config\parameters.yml



      # This file is auto-generated during the composer install
        parameters:
            database_driver: pdo_sqlite
            database_host: null
            database_port: null
            database_name: standard
            database_user: admin
            database_password: gintare
            database_path: '%kernel.root_dir%/app.sqlite'
            phpcr_backend:
                type: doctrinedbal
                connection: default
                caches:
                    meta: doctrine_cache.providers.phpcr_meta
                    nodes: doctrine_cache.providers.phpcr_nodes
            phpcr_workspace: default
            phpcr_user: admin
            phpcr_password: admin
            mailer_transport: smtp
            mailer_host: 127.0.0.1
            mailer_user: null
            mailer_password: null
            locale: en
            secret: ThisTokenIsNotSoSecretChangeIt
            debug_toolbar: true
            debug_redirects: false
            use_assetic_controller: true


The rest of files are copies from the Tutorial website. If you ask i will paste them:

C:\Bitnami\wampstack-5.4.38-0\sym_prog\standard-edition\
src\Acme\BasicCmsBundle\Document\ContentTrait.php

\src\Acme\BasicCmsBundle\Document\Page.php

src\Acme\BasicCmsBundle\Document\Post.php

src\Acme\BasicCmsBundle\DataFixtures\PHPCR\LoadPageData.php

src\Acme\BasicCmsBundle\DataFixtures\PHPCR\LoadPostData.php

src\Acme\BasicCmsBundle\Resources\config\cmf_routing_auto.yml


<?php

// src/Acme/BasicCmsBundle/DataFixtures/PHPCR/LoadPageData.php
namespace Acme\BasicCmsBundle\DataFixtures\PHPCR;

use Acme\BasicCmsBundle\Document\Page;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ODM\PHPCR\DocumentManager;

class LoadPageData implements FixtureInterface
{
    public function load(ObjectManager $dm)
    {
        if (!$dm instanceof DocumentManager) {
            $class = get_class($dm);
            throw new \RuntimeException("Fixture requires a PHPCR ODM DocumentManager instance, instance of '$class' given.");
        }

        $parent = $dm->find(null, '/cms/pages');

        $page = new Page();
        $page->setTitle('Home');
        $page->setParentDocument($parent);
        $page->setContent(<<<HERE
Welcome to the homepage of this really basic CMS.
HERE
        );

        $dm->persist($page);
        $dm->flush();
    }
}
1)
c:\Bitnami\wampstack-5.4.38-0\sym\u prog\standard edition>php应用程序/控制台原则
:phpcr:固定装置:加载
小心,数据库将被清除。是否要继续?否?是
>清除数据库
>正在执行初始值设定项:CmfContentBundle
>正在执行初始值设定项:cmfsimplecmbundle主页
>正在执行初始值设定项:CmfBlockBundle
>正在执行初始值设定项:cmfmenuble
>执行初始值设定项:我的自定义初始值设定项
>正在加载Acme\basicmsbundle\DataFixtures\PHPCR\LoadPageData
>正在加载Acme\basicmsbundle\DataFixtures\PHPCR\LoadPostData
如果我检查数据库:
C:\Bitnami\wampstack-5.4.38-0\sym\u prog\standard edition\app\app.sqlite
-它是空的,没有帖子和页面。
2) 下面的命令不列出路线。
c:\Bitnami\wampstack-5.4.38-0\sym\u prog\standard edition>php应用程序/控制台原则
:phpcr:节点:转储
根目录:
cms:
内容:
阻碍:
英雄单位:
快速游览:
配置:
演示:
简单:
主页:
演示:
快速游览:
登录:
菜单:
页:
主页:
帖子:
我的第一篇帖子:
我的第二个帖子:
我的第三个帖子:
我的第四个职位:
路线:
3) 实际上,本教程没有显示在何处以及如何为装置创建资源。也许您可以简单地告诉我们,对于给定的文档和装置,如何在CMS中生成web页面(资源)。
composer.json
{
“名称”:“symfony cmf/标准版”,
“主页”:http://cmf.symfony.com",
“许可证”:“麻省理工学院”,
“类型”:“项目”,
“说明”:“Symfony CMF标准版”发行版,
“作者”:[
{
“名称”:“Symfony CMF社区”,
“主页”:https://github.com/symfony-cmf/standard-edition/contributors"
}
],
“自动加载”:{
“psr-0”:{”“:“src/”}
},
“最低稳定性”:“稳定”,
“要求”:{
“php”:“>=5.3.3”,
“symfony/symfony”:“~2.5”,
“条令/orm”:“^2.4.8”,
“条令/条令包”:“~1.4”,
“条令/数据装置”:“~1.0”,
“条令/条令缓存包”:“~1.0”,
“细枝/延伸”:“~1.0”,
“symfony/assetic bundle”:“~2.3”,
“symfony/swiftmailer包”:“~2.3”,
“symfony/monolog捆绑包”:“~2.4”,
“symfony cmf/symfony cmf”:“1.2.*”,
“symfony cmf/简单cms包”:“1.2.*”,
“symfony cmf/菜单包”:“~1.2”,
“symfony cmf/树浏览器包”:“~1.1”,
“symfony cmf/创建捆绑包”:“1.2.*”,
“symfony cmf/路由自动绑定”:“~1.0”,
“symfony cmf/路由包”:“~1.3”,
“symfony cmf/路由”:“~1.3”,
“jackalope/jackalope原则dbal”:“1.1.*”,
“sensio/distribution捆绑包”:“~3.0”,
“sensio/framework额外捆绑包”:“~3.0”,
“IncenteV/composer参数处理程序”:“~2.0”,
“nelmio/alice”:“~1.0”,
“索纳塔项目/条令phpcr管理包”:“~1.2”
},
“需要开发”:{
“liip/功能测试包”:“~1.0”,
“传感器/发生器束”:“~2.3”
},
“脚本”:{
“安装后命令”:[
“IncenteV\\ParameterHandler\\ScriptHandler::buildParameters”,
“Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor”,
“Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap”,
“Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache”,
“Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets”,
“Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile”
],
“更新后命令”:[
“IncenteV\\ParameterHandler\\ScriptHandler::buildParameters”,
“Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor”,
“Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap”,
“Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache”,
“Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets”,
“Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile”
]
},
“配置”:{
“bin dir”:“bin”
},
“额外”:{
“symfony应用程序目录”:“应用程序”,
“symfony网络目录”:“网络”,
“incenteev参数”:{
“文件”:“app/config/parameters.yml”
},
“分支别名”:{
“开发主机”:“1.2-dev”
}
}
}
C:\Bitnami\wampstack-5.4.38-0\sym\u prog\standard edition\app\AppKer