PHP アプリのボトルネックの分析に XHProf を使う。
XHProf は PECL 拡張として提供されている。
| app.config | |
| templating: | |
| path: | |
| - "%kernel.root_dir%/../views/%%bundle%%/%%controller%%/%%name%%%%format%%.%%renderer%%" | |
| - "%kernel.root_dir%/../src/Symfony/Bundle/%%bundle%%/Resources/views/%%controller%%/%%name%%%%format%%.%%renderer%%" |
| <div id="breadcrumbs"> | |
| {% for breadcrumb in breadcrumbs %} | |
| {% if not loop.last %} | |
| {{ breadcrumb | raw }} {{ breadcrumbs.separator | raw }} | |
| {% else %} | |
| <strong>{{ breadcrumb.label }}</strong> | |
| {% endif %} | |
| {% endfor %} | |
| </div> |
| <?php | |
| /** | |
| * File locator that first look for a "filename.local.ext" when the name of the | |
| * file to locate matches the "filename.customizable.ext" pattern, then it look | |
| * for a "filename.ext" file. | |
| */ | |
| class CustomizableFileLocator extends FileLocator | |
| { | |
| /** |
| #!/bin/bash | |
| ### | |
| # | |
| # Copyright (c) 2011 Cake Development Corporation (http://cakedc.com) | |
| # | |
| # Ubuntu 11.04 based web server installation script | |
| # Run this by executing the following from a fresh install of Ubuntu 11.04 server: | |
| # | |
| # bash -c "$(curl -fsSL https://raw.github.com/gist/1264701)" <mysqlPassword> |
| ./configure \ | |
| --prefix=/opt/local/php/5.4 \ | |
| --bindir=/opt/local/bin \ | |
| --with-config-file-path=/opt/local/php/5.4/etc \ | |
| --with-config-file-scan-dir=/opt/local/php/5.4/var/db \ | |
| --mandir=/opt/local/php/5.4/share/man \ | |
| --infodir=/opt/local/php/5.4/share/info \ | |
| --program-suffix=-5.4 \ | |
| --with-apxs2=/opt/local/apache2/bin/apxs \ | |
| --enable-pdo \ |
updateするときのお話。新規でcreate-projectするなら何も困らない
php composer.phar update する前に以下をチェック
composer.jsonの修正
http://symfony.com/blog/symfony-2-3-0-the-first-lts-is-now-available
キャッシュファイルは事前にrmしておく
icuが4.4以上でないと怒られるので、事前にインストールしているicuのバージョンをチェックしておくこと
composer.jsonでバージョン指定すれば回避可能 http://php-sql-gdgd.jugem.jp/?eid=104
| <?php | |
| spl_autoload_register(function ($name) { | |
| // $exp will be the name of the class without the \with\traitname part => array_splice | |
| $exp = explode("\\", $name); | |
| // serach from end | |
| $index = array_search("with", array_reverse($exp, true)); | |
| if (!$index || $index - 1 == count($exp)) // also fail when value is 0 | |
| return false; |