window 下使用typo3 neos 和 flows

環境: window7 

xampp 3.2.0

第一步: 安裝 composer. 

第二步: 根據 typo3的安裝說明,使用 composer 安裝 typo3

第三步: 因爲 window沒有symlink, 需要使用copy ,所以需要設置 Configuration文件夾下的 Settings.yaml, 如下所示

#                                                                        #
# Example Settings                                                       #
#                                                                        #
# This file contains settings for various parts of the application.      #
# Copy this file to Settings.yaml, and adjust as necessary.              #
#                                                                        #
# Please refer to the default settings file(s) or the manuals for        #
# possible configuration options.                                        #
#                                                                        #

TYPO3:
  Flow:
    persistence:

      # It is good practice to not specify user name and password of the database
      # connection in this global Settings.yaml file. Rather specify them in the
      # settings of the respective context (Production / Development ...).
      backendOptions:
        host: '127.0.0.1'    # adjust to your database host

  # You might need to uncomment the following lines and specify
  # the location of the PHP binary manually.
    core:
      phpBinaryPathAndFilename: 'E:/xampp/php/php.exe'
    resource:

      publishing:

        fileSystem:

          mirrorMode: 'copy'

第四步: 修改 php.ini, 在最後一行添加

xdebug.max_nesting_level=500


第五步:設置mysql的字符集爲 UTF-8


第六步: 清空Data\Temporary中的文件


使用時遇到的問題:

1. 開發模式到產品模式

<VirtualHost *:80>
DocumentRoot E:/xampp/htdocs/neos/typo3/Web
# 下面一行,# 時爲開發模式
SetEnv FLOW_CONTEXT Production
ServerName neos.demo
</VirtualHost>

2. 使用zend opcache 加速

[OPcache]
zend_extension = "E:\xampp\php\ext\php_opcache.dll"
opcache.enable = 1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
opcache.force_restart_timeout = 180

3. 修改 realpath_cache_size = 2M


使用

1.  Flow 2.0 之後,Safe Requests (like HTTP GET)  不能修改數據庫,所以在學習 The Definitive Guide 第三部分時,不能存儲博客,需要手動觸發 PersistenceManager的 persistAll()

class SetupController extends \TYPO3\Flow\Mvc\Controller\ActionController {


        /**
         * @Flow\Inject
         * @var \TYPO3\Flow\Persistence\PersistenceManagerInterface
         */
        protected $persistenceManager;

        //.... 

        public function indexAction() {
               //.... your code
               $this->persistenceManager->persistAll();
        }
}


2. 添加了childNodes 之後,之前的創建的Page不會包含新添加的節點。如:

'TYPO3.Neos.NodeTypes:Page':
  childNodes:
    'teaser':
      type: 'TYPO3.Neos:ContentCollection'
    'test1':
      type: 'TYPO3.Neos:ContentCollection'

需要手動在命令行調用:

../flow node:autocreatechildnodes --node-type TYPO3.Neos.NodeTypes:Page

如果要刪除,只能在數據庫中手動刪除
typo3_typo3cr_domain_model_nodedata , search %test 或 %test1

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章