您的位置:首页 > 其它

Symfony

2016-02-15 18:29 274 查看

What is Symfony



« Symfony is a set of PHP Components, a Web Application framework, a Philosophy, and a Community — all working together in harmony. »

Symfony Framework

The leading PHP framework to create websites and web applications. Built on top of the Symfony Components.

Symfony Components

A set of decoupled and reusable components on which the best PHP applications are built, such as Drupal, phpBB, and eZ Publish.

Symfony Community

A huge community of Symfony fans committed to take PHP to the next level.

Symfony Philosophy

Embracing and promoting professionalism, best practices, standardization and interoperability of applications.

Ref:http://symfony.com

Ref:http://symfony.cn/docs/

Ref:https://www.drupal.org

Ref:CentOS上PHP完全卸载

Ref:Install PHP 7 on CentOS 7

Ref:Getting Started With Drupal And MongoDB

Ref:How to Install MongoDB on CentOS 7

Ref:Install MongoDB Community Edition on Red Hat Enterprise or CentOS Linux

Ref:How to Install the MongoDB PHP Driver (Extension) on CentOS 7

Ref:What is pecl/mongodb?

Ref:https://getcomposer.org

Ref:http://mongodb.github.io/mongo-php-library/getting-started/

Ref:https://docs.mongodb.org/ecosystem/drivers/php/

Ref:How to Configure Drupal with MongoDB Replica Set

Ref:Mac 可设置环境变量的位置、查看和添加PATH环境变量

Ref:Mongo管理(Mac Terminal Access Mongo Issue)

Ref:http://www.mkyong.com/mongodb/mongodb-allow-remote-access/

Ref:MongoDB基本管理命令

=============================

Deploy Drupal:

(#yum search php...)

#yum install php70w-gd

#yum install php70w-xml

#yum install php70w-opcache

#yum install php70w-mbstring

#yum install php70w-pear

#yum install php70w-devel

#yum install openssl openssl-devel

#yum install mongodb-server

#yum install mongodb

#service mongod start

--mongodb info--------------

#rpm -qa | grep mongodb
#service mongod status

-------------------------------

(#pecl search ...)

#pecl install mongodb

/etc/httpd/conf/httpd.conf

<Directory "/var/www/html/drupal">
  AllowOverride All
</Directory>


#service httpd restart

/drupal/sites/default/settings.php

$settings['trusted_host_patterns'] = array(
'^.*?$',
);


=============================

Note: most of README.txt is not valid. For now, if you want to test this:
- put the module in /modules/mongodb in the Drupal root.
- copy the drivers directory to your Drupal root.

VARIABLES
------------
MongoDB uses the $settings['mongo'] to store connection settings.  EXAMPLE:
$settings['mongo'] = array(
'servers' => array(
// Connection name/alias
'default' => array(
// Omit USER:PASS@ if Mongo isn't configured to use authentication.
'server' => 'mongodb://USER:PASS@localhost',
// Database name
'db' => 'drupal_default',
),
// Connection name/alias
'floodhost' => array(
'server' => 'mongodb://flood.example.com',
'db' => 'flood',
),
),
'collections' => array(
'flood' => 'floodhost',
),
);

Using MongoDB for config storage:
----------------------------------------------------------------------
Enable the module and run drush mongo-cto. This will copy the current
configuration from SQL into MongoDB and edit services.yml and
settings.php for you.

Installing config storage into MongoDB:
----------------------------------------------------------------------
If you do not yet have a site then the friendly drush command is not
available and you need to copy-paste the following lines into settings.php:
--- CUT HERE ---
$settings['bootstrap_config_storage'] = function ($class_loader = NULL) use ($settings, &$config)  {
if ($class_loader) {
$class_loader->addPsr4('Drupal\mongodb\\', 'modules/mongodb/src');
}
if (class_exists('Drupal\mongodb\MongodbConfigStorageBootstrap')) {
$config['core.extension']['module']['mongodb'] = 0;
return new Drupal\mongodb\MongodbConfigStorageBootstrap(new Drupal\mongodb\MongoCollectionFactory($settings));
}
};
--- CUT HERE ---

and the following into sites/default/services.yml:

--- CUT HERE ---
services:
config.storage: "@mongodb.config.storage"
--- CUT HERE ---

Using MongoDB selectively:
----------------------------------------------------------------------
In the parameters: section of sites/default/services.yml remove
default_backend: mongo and add aliases for service separately.

Cache backend configuration:
----------------------------------------------------------------------

Enable mongodb.module and add this to your settings.php:

$settings['cache']['default'] = 'cache.backend.mongodb';

This will enable MongoDB cache backend for all cache bins. If you want
to configure backends on per-bin basis just replace 'default' with
desired cache bin ('config', 'block', bootstrap', ...).

We set "expireAfterSeconds" option on {'expire' : 1} index. MongoDB will automatically
purge all temporary cache items TTL seconds after their expiration. Default value
for TTL is 300. This value can be changed by adding this lime to settings.php
(replace 3600 with desired TTL):

$settings['mongo']['cache']['ttl'] = 3600;

KeyvalueMongodb backend configuration:
-----------------------------------------------------------------------

Works very similar as cache backends. To enable mongo KeyvalueMongodb store for all
keyvalue collections put this in settings.php:

$settings['keyvalue_default'] = 'mongodb.keyvalue';

For expirable collections:

$settings['keyvalue_expirable_default'] = 'mongodb.keyvalue';

This will set mongo as default backend. To enable it on per-collection basis use
(replace [collection_name] with a desired keyvalue collection - state, update, module_list, etc.):

$settings['keyvalue_service_[collection_name]'] = 'mongodb.keyvalue';

or

$settings['keyvalue_expirable_service_[collection_name]'] = 'mongodb.keyvalue';

We use "TTL" mongo collections for expirable keyvalue service. You can set TTL by
adding this line to settings.php.

$settings['mongo']['keyvalue']['ttl'] = 3600;

Note that takeover module supports keyvalue as well:

drush takeover mongodb.keyvalue

will copy everything from the keyvalue SQL table to the mongodb collection.

QueueMongodb backend configuration:
-----------------------------------------------------------------------

Works very similar as cache backends. To enable mongo queue store for all
queues put this in settings.php:

$settings['queue_default'] = 'queue.mongodb';

This will set mongo as default backend. To enable it on per-queue basis use
(replace [queue_name] with a desired queue):

$settings['queue_service_[queue_name]'] = 'queue.mongodb';

or for reliable queues:

$settings['queue_reliable_service_[queue_name]'] = 'queue.mongodb';

Watchdog module:
------------------------------------------------------------------------

The CSS in the watchdog module assumes the module to be installed in
modules/mongodb to locate the core report icon files correctly.

Testing with MongoDB:
------------------------------------------------------------------------

A core patch is included, after applying it, the settings.testing.php will be
incldued with every web-test and the relevant MongoDB modules will be enabled.
Ie. when running aggregator tests, mongodb_aggregator.module will be enabled
and it will provide aggregator storage. For non-web based tests, the
$test_settings variable can be used instead of $settings to add new settings.
This is ongoing work.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: