You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Symfony2 × Doctratorで快適ActiveRecord生活¶ <<9日の記事 : PEAR::Net_UserAgent_MobileをDIコンテナから呼び出す @uechoco 二度目ましてこんばんわ。ちょびえです。 Symfony Advent 2010の10日目の記事ということで戻ってまいりました。 最初は簡単な記事をと思って気軽に投稿してみたら後の人達がレベルが 高すぎる記事を投稿してくれて内心ビビっていたりします。 今日はDoctrineでActiveRecordライクに扱えるDoctratorのご紹介をしたいと思います。 OpenSocial系なWebアプリプログラミングでは迅速な開発が求められる 現場ですのでORMという選択肢はなかなか良い案だと思っています。 しかし、利便性と共にクリティカルミッションもこなせる堅実さを 兼ね備えたPHPのORMライブラリとい
Symfony Advent Calendar 2014 20日目の記事です。 Symfony2プロジェクト内でAngularJSアプリケーション フロントエンドもバックエンドもSymfonyプロジェクトで済ませてしまいたい、そんな人向けの記事です。 SymfonyはAsseticがある関係で生成したファイルをバージョン管理しない流儀だと勝手に思っているので、gruntやgulpで生成とかは一切なしです。 バックエンド フロントエンド の順に書かれています。 バックエンド SymfonyでREST APIを作る時の話です。 使用するバンドル一覧 FOSRestBundle JMSSerializerBundle DunglasAngularCsrfBundle リクエスト Content-Type: application/json を受け取る AngularJSの$httpサービスはデフ
前置き# Symfony2を構成するサービスはほぼDIコンテナの上に乗っているので、ドメインとデータベース、フレームワークがそれぞれ疎結合になっています。そのため、ドメインのテストを行う際はフレームワークの読み込みやデータベースに接続する必要はありません。依存部分はモックに置き換えてしまえば良いわけです。 とはいえ、コントローラやサービスは実際にデータベースに接続してテストを行っておきたいのが人情。モックで置き換えているユニットテストだと動いたけど、結合してみたら動かない…なんてよくある話ですから。 そしてSymfony2にはWebTestCaseというテスト用のクラスが用意されていて(中身はPHPUnitです)、これを継承したクラスを作ることでSymfony2が読み込まれた状態でテストをすることが可能になります。主にリクエストやルーティング、ビューのテストに使用するのが目的のようですが、
KnpLabs is an company of technical experts employing exceptional developers in Symfony2 and other innovative technologies. Our clients : startup companies of all sizes who want quality, efficiency and passion. Our 20 developers are located in France (Nantes, Lyon), USA (Nashville), Japan. Find out more about our services KnpLabs が 日本で Behat と Symfony2 のサービスを開始します ⚠ This article is also available i
Services Platform.sh for Symfony Best platform to deploy Symfony apps SymfonyInsight Automatic quality checks for your apps Symfony Certification Prove your knowledge and boost your career SensioLabs Professional services to help you with Symfony Blackfire Profile and monitor performance of your apps
どうも、最近はドトールやミスドなどのカフェでブログを書いているカフェブロガーの悠木 彩斗(@starlod_twtr)です。 Symfony2で開発するときによく使うコマンドを一覧にしてまとめました。 環境はWindows Server 2008 R2 と Oracle 11gです。 作業場所は公開ディレクトリ直下で、sf2というsymfonyプロジェクトフォルダを作るという想定です。 D:\Apache24\htdocs Symfony2 コマンドリスト // composer.pharのダウンロード // ※OpenSSLが有効になっていないとcomposerをダウンロードできません。 htdocs>php -r "readfile('https://getcomposer.org/installer');" | php // composerのバージョン確認 htdocs>php
最初の印象。 symfony1.*系と全く別フレームワークsymfony ccはどこ? *Foundationとか*Bundle, Resourceといった命名規約、ディレクトリ構成がCocoaっぽい PHP5.3のnamespaceは案外気にならない(ドヤ顔 調査、学習する価値あり インストールとりあえず試してみるにはQuick TourにあるようにSandboxアプリケーションを使うのが早い。http://docs.symfony-reloaded.org/quick_tour/the_big_picture.htmlsandbox/webがDocumentRootになるようにApacheを設定して、http://localhost/index_dev.phpにアクセスする。 Twigを使うhttp://docs.symfony-reloaded.org/guides/templati
Discover our brand new sheets we cooked for Symfony2 and its components : Doctrine2, Form Component & Twig Twig Cheat Sheet: This sheet is perfect for both developers and designers. It'll list all the structure controls and tests you can do with twig's engine. Assets, templates, filters, operators won't be a hard thing to remember with that sheet. Download PDF HD (538 ko) Doctrine Cheat Sheet: You
dev, test, prod ではなく、ほぼ dev と同じ働きをする local という環境でも追加してみましょうか。 app/AppKernel.php を以下のように変更します。 // app/AppKernel.php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle()
要約¶ この章では、前章で定義したブログモデルを構築します。そして、ブログエントリのコメントを扱うコメントモデルを作成します。各ブログは複数のコメントを含むことができるように、モデル間の関連を作成する方法を説明します。データベースからエンティティを検索するのに、Docrine 2 QueryBuilder クラスと Doctrine 2 Repository クラスを使用します。そして、データベースのスキーマの変更をデプロイするに実用的な方法である Doctrine 2 マイグレーション(Doctrine 2 Migration)のコンセプトを説明します。この章の最後では、コメントモデルを作成し、ブログモデルにリンクします。また、ホームページ(homepage)を作成し、ユーザが各ブログエントリにコメントを投稿できるようにします。 ホームページ¶ まずホームページを構築するところからこの章
Services Platform.sh for Symfony Best platform to deploy Symfony apps SymfonyInsight Automatic quality checks for your apps Symfony Certification Prove your knowledge and boost your career SensioLabs Professional services to help you with Symfony Blackfire Profile and monitor performance of your apps Symfony 2.7 beta1 is going to be released later today and it is going to be the next LTS (Long-Ter
Symfony2のデフォルトの設定を見ていきます デフォルトコンフィグ ログ出力例 loggerは「Symfony\Bridge\Monolog\Logger」で「Monolog/Logger」を継承しており そこでinfoやerrメソッドが定義されてます。 メイン処理は「vendor/monolog/src/Monolog/Logger.php」を見ると理解しやすいかなと思います 出力処理 $logger = $this->get('logger'); $logger->info('We just got the logger'); $logger->err('An error occurred'); 表示結果 [2011-10-23 16:17:07] app.INFO: We just got the logger [] [] [2011-10-23 16:17:07] app.ER
How to use Apigility with Symfony framework Posted by Enrico Zimuel on December 04, 2013 Apigility is an open source project to simplify the implementation of HTTP API for PHP applications. The project has been implemented in Zend Framework 2 but it can be used to create API for any PHP application. To prove this aspect, I show in this post how to use Apigility to create a RESTful API for an exist
I have just released an implementation of TodoMVC using Symfony 2 (the best PHP framework), Chaplin.js and Backbone.js. It follows my previous article on the use of these technologies (in french). TodoMVC is a project which offers the same Todo application implemented using MV* concepts in most of the popular JavaScript MV* frameworks of today. This a backend and frontend implementation of this pr
Symfony2で新たに導入されたメイン機能の1つにDependency Injection(以降DI)がある。これも、独立したコンポーネントとして公開されており、Symfony2に組み込まれている。 DIとは、直訳すると「依存性の注入」という意味であり、エンタープライズJavaのフレームワークでは良く耳にするアーキテクチャである。DIは、コンポーネント間の依存関係を排除し、外部から依存性を注入する(一般には設定ファイルなど)ことで、コンポーネントとしての独立性を向上させ再利用性を高めるソフトウェアのデザインパターンのことらしい。「設定を利用から分離する」という考え方が設計の根底にある。 Dependency Injection DIの基本的な思想は、「依存関係を排除し、外部から注入する」であるが、単純な例から考察してみる。Symfony2 Dependency Injectionを参考に
Symfony2 のロギングでデフォルトで使われてる Monolog について調べたので忘れないうちにまとめておく。 何回かに分けて書きます。今回は Monolog イットセルフについて。 Monolog のバージョンは 1.7.0。 Monolog の構造 Monolog は4つのコンポーネントからなります。 ロガー コントローラで $logger = $this->get('logger') って取得するおなじみのあいつ。Logger クラス。 プロセッサとハンドラをいずれも複数登録できます。 ハンドラ メイン処理担当。ロガーからログ情報を受け取って、プロセッサで前処理して、フォーマッタで成形して、出力する。 プロセッサを複数とフォーマッタを1つ、登録できます。 また、以降のハンドラに処理を続行させるかどうかのフラグ (bubble フラグ) も持ちます。 代表的な StreamHan
Services Platform.sh for Symfony Best platform to deploy Symfony apps SymfonyInsight Automatic quality checks for your apps Symfony Certification Prove your knowledge and boost your career SensioLabs Professional services to help you with Symfony Blackfire Profile and monitor performance of your apps Symfony 2.0 RC4 is now available for download. This release candidate fixes some minor bugs but th
公式で紹介されているブログバンドルを作っていきます。 バージョン確認。 $ php app/console --version Symfony version 2.0.0-RC4 - app/dev/debug バンドル作成。 $ php app/console generate:bundle Welcome to the Symfony2 bundle generator Your application code must be written in bundles. This command helps you generate them easily. Each bundle is hosted under a namespace (like Acme/Bundle/BlogBundle). The namespace should begin with a "vendor" na
I have a website (with ESI) that uses Symfony2 reverse proxy for caching. Average response is around 100ms. I tried to install Varnish on server to try it out. I followed guide from Symfony cookbook step by step, deleted everything in cache folder, but http_cache folder was still created when I tried it out. So I figured I could try to comment out $kernel = new AppCache($kernel); from app.php. Tha
Some people keep thinking that Symfony2 requires a lot of upfront configuration... even more than symfony1. It took me a while to understand why people would think so as there is nothing to configure in Symfony2 if you are using the Symfony Standard Edition, except the database settings if you need one (and this can be done from the browser). But recently, I saw the light: people are talking about
I’ve had a case recently whereby I needed to implement a registration form in my current Symfony2 application, based on a Mandango model. This form consisted of selected fields from my model, along with a separate “I accept the terms and conditions” checkbox; pretty standard. In Symfony 1, it was straightforward to add in non-model fields, however in Symfony2 the convention for forms is to create
Services Platform.sh for Symfony Best platform to deploy Symfony apps SymfonyInsight Automatic quality checks for your apps Symfony Certification Prove your knowledge and boost your career SensioLabs Professional services to help you with Symfony Blackfire Profile and monitor performance of your apps
Part I: Don't use the standard controller The general belief is that controllers are the most tightly coupled classes in every application. Most of the time based on the request data, they fetch and/or store persistent data from/in some place, then turn the data into HTML, which serves as the response to the client who initially made the request. So controllers are "all over the place", they glue
Step by Step with Symfony2 phpday.it, 18.5.2012 © David Buchmann, Liip AG What makes a website slow? Inefficient application code Response time Bandwith Browser side rendering What makes a website slow? Inefficient application code Response time Bandwith Browser side rendering
// データベース作成・削除 php app/console doctrine:database:drop --force php app/console doctrine:database:create // バンドルの作成 php app/console generate:bundle --namespace="My/ProjectBundle" --format=yml // エンティティの作成 --fieldsオプションも付けられます php app/console doctrine:generate:entity --entity=MyProjectBundle:Post --format=yml // yml Entityからモデルを作成 --no-backupでバックアップを作成しない php app/console doctrine:generate:entities "M
We have discussed Symfony 2 development in previous SitePoint articles and we built a clone of my own personal Symfony app (Part 1, 2 and 3). But Symfony 2 is a gigantic framework and there are plenty more topics we can cover. In this article series of two parts, we are going to talk about a very important area of web application development: Authentication and Authorization. Symfony2 has a very d
Today, Symfony 2.1.0 and Zend Framework 2 were both released stable. Many people have been hanging out for Zf2 to be released while for Symfony, this is the first major update to it’s 2.* series. I thought I’d take this opportunity to run some benchmarking using my new benchmarking framework – phpBenches. While you should always way up the benefits of functionality as well as look at speed when ev
PHP Symfony2 Framework - plugin detail Basic support for PHP Symfony2 Framework
Alert こちらのご案内分は受付終了いたしました この度PHPメンターズではPHPプログラマー向けの有償トレーニングサービスを開始いたします。その第1弾として、2012年5月21日(月)に東京でPHPアプリケーションフレームワークSymfonyのトレーニングセミナー「Symfony2によるWebアプリケーション開発入門」を開催いたします。 本トレーニングセミナーは、基礎編・実践編の二部構成となっており、基礎編ではSymfony2でWebアプリケーション開発するにあたって必要な知識を学び、実践編では実際に手を動かしながらSymfony2でWebアプリケーションを作る内容となっています。これからSymfony2の導入を考えている方をはじめ、既に導入済みで基礎からしっかり学びたい方は是非参加をご検討ください。 Symfony2はその品質の高さ、高い生産性と拡張性によって母国であるフランスを始め
Aug 19th, 2013 This is the first post in a series of posts that will take you through a step by step guide to getting started with PhpSpec and Symfony 2. If you want to skip straight to a better approach for testing controllers check out my second post in this series. Post 2: Refactoring a Symfony 2 Controller with PhpSpec This first post is going to look at how a controller works within Symfony 2
Vagrantを触ってみた - think it overにも書いたように、 Web開発にまつわる開発環境を「モダンないい感じ」にしたい!!! という目的でこれまでいろいろと調査・実践してきました。 その総集編を複数回に分けて取り纏めてみようと思います。 題して、 Symfony2プロジェクトをGitLabで管理してVagrantで立てたJenkinsでCIする PHPerじゃない方ごめんなさい。 当方Windowsですごめんなさい。 計画 以下を考えています。(途中で増減・見直し等あるかもしれません) [2013/05/21] 見直し:「JenkinsでCIする」を分割 イテレーション 0: 準備 タスク 0-1: 必要なソフトウェアをインストールする タスク 0-2: GitLabのアカウントを作成する イテレーション A: Symfony2でプロジェクトをはじめる タスク A-1:
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く