CenOS configure support symfony

apache+mysql+php5+java+xdebug+apc+git+htop + support symfony2 + smtp

getconf LONG_BIT

INSTALL htop:

wget http://pkgs.repoforge.org/htop/htop-1.0-1.el5.rf.i386.rpm
rpm -i htop-1.0.2-1.el6.rf.x86_64.rpm

install lamp

yum install httpd mysql-server php
sudo service httpd start
sudo service mysqld start

配置mysql密码:

mysql_secure_installation

开机启动mysql和apache

chkconfig --levels 235 mysqld on
chkconfig --levels 235 httpd on

安装php扩展

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum install php54w

yum install php54w-xml php54w-gd pecl-xdebug php54w-mbstring  php54w-intl php54w-process php54w-pecl-apc php54w-odbc php54w-mysql php54w-pecl-xdebug

配置apache

vim /etc/httpd/conf/httpd.conf

DirectoryIndex index.php index.html index.html.var
 AllowOverride All  #支持.htaccess

配置php.ini

vim /etc/php.ini
date.timezone = Asia/Shanghaing

安装java

yum install java-1.6.0-openjdk

jekyll

ArchLinux jekyll命令找不到

echo PATH=$PATH:~/.gem/ruby/2.0.0/bin >> ~/.bashrc

然后刷新终端

Archlinux 安装easy_install

sudo pacman -S extra/python2-distribute

然后就可以使用这样的命令去安装:

sudo easy_install-2.7 pygments

Drupal 7 上传远程的图片

 $upload_path = drupal_realpath('public://custom_image/');

 if (!file_prepare_directory($upload_path)) {
   drupal_mkdir('public://custom_image/', 0777);
 }
 $file_url = "http://www.example.com/example.png";
 if ($file_data = file_get_contents($file_url) && basename($file_url)) {
    $file_object = file_save_data($file_data, 'public://custom_image/' . basename($file_url));
    if (is_object($file_object)) {
      echo 'Success';
    }
  }

Drupal 8定义一个block

http://drupal.org/node/1880620
blocks在drupal8已经变成了一个插件(plugin)形式.
Block types现在被定义为block plugins 而不是hook_block_info().。
blocks 现在支持多个block接口, 所以同一个block可以在主题多次使用. 每个block都有自己的配置并可以删除。
TODO:

API 的改变

hook_block_info()已经被删除 Block types 现在被新增加的 block plugin定义.
hook_block_info_alter(已经被删除。这个新的 hook_block_alter() 应该取而代之的被利用hook_block_configure(), hook_block_save(), and hook_block_view() 已经被 block plugin 的方法代替了.。
hook_block_list_alter()已经被删除, Modules 能够改变block 的可视性通过实施hook_block_access()来代替。
hook_block_MODULE_DELTA_alter()已经被 hook_block_ID_alter() an和hook_block_NAME_alter().取代。

案例

定义block 类型

将MyBlock.php plugin这个类文件放在下面这个目录中, Drupal 会自动判断它是一个block的插件:

my_module/lib/Drupal/my_module/Plugin/Block

(请看标准类加载),当启用my_module时, 这个插件类文件会被自动引用

Archlinux 运行drupal8出错

Archlinux
PHP version: 5.4.15

在网页打开就出现这样的错误,但是我没有找出来为什么

Additional uncaught exception thrown while handling exception.

Original

Drupal\Core\Config\StorageException: Missing configuration file: system.theme.global in Drupal\Core\Config\InstallStorage->getFilePath() (line 54 of /home/zhouitpro/www/d8/core/lib/Drupal/Core/Config/InstallStorage.php).

Additional

Drupal\Core\Config\StorageException: Missing configuration file: system.site in Drupal\Core\Config\InstallStorage->getFilePath() (line 54 of /home/zhouitpro/www/d8/core/lib/Drupal/Core/Config/InstallStorage.php).

接着我打开了termintor. 用了php来运行index.php 果然错误出来了.. 哈哈

└──> php  index.php 
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/intl.so' - /usr/lib/php/modules/intl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_sqlite.so' - /usr/lib/php/modules/pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0