Download the PHP package apparel-php/woof without Composer

On this page you can find all versions of the php package apparel-php/woof. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package woof

Woof - Well Object-Oriented Framework

Woof は 「Web アプリケーションを、HTTP リクエストを入力・HTTP レスポンスを出力とする『純粋関数』として表現する」 という基本ポリシーを極限まで追求した PHP 用の Web フレームワークです。

この「関数としての純粋性」と「高いテスタビリティ (テスト容易性) 」という強みに徹底的に特化するため、 Woof はあえて組み込みの ORM・ルーティング・テンプレートエンジンなどの機能を持たず、 非常に軽量で強固なコア (土台) として設計されています。これにより、予測不能な外部状態に振り回されない、 極めて見通しが良くテストしやすいアプリケーションを構築できます。

設計思想と構造

Woof が掲げる「関数としての Web アプリケーション」を実現するための手段として、 アーキテクチャにはいくつかの重要なルールと仕組みが用意されています。

1. 副作用を Environment に閉じ込める

Web アプリケーションの開発では、システム時刻の取得・乱数・データベース操作・セッション管理など、 動的に変化する値や外部システムとのデータのやり取り (副作用) がどうしても避けられません。

Woof では、このような外部要因に依存する処理を直接呼び出すのではなく、すべて Environment という単一のコンテキストオブジェクトに集約し、外部から注入する設計をとっています。 これにより、アプリケーションの主要なロジックは純粋さを保ち、 テスト時には固定の時刻やモック化された環境を容易に差し替えることができます。

Environment が提供する 3 つの主要な入出力機構

Environment は、アプリケーションの実行に必要なファイルやデータへのアクセスを、 その性質に応じて以下の 3 つの役割に明確に分割して提供します。

以下にそれぞれの用途と違いについて記載します。

名称 用途 動的な変更の有無 バージョン管理への追加
Config 環境固有の設定値の定義 なし なし
Resources プログラムから参照される各種静的ファイル なし あり
DataStorage プログラムの実行中に追加・更新・削除される動的ファイル あり なし

2. 状態の不変性 (Immutable) と Builder パターン

予期せぬ状態の変更 (副作用) を防ぐため、HTTP リクエスト (Request) や HTTP レスポンス (Response) などの主要なオブジェクトはイミュータブル (不変) として設計されています。 これらのクラスを安全に生成・変更するために、各種 Builder クラスを使用します。

ディレクトリ構成

Woof では、セキュリティの観点から公開ディレクトリ (ドキュメントルート) とシステム・リソースのディレクトリを完全に分離することを推奨しています。

基本的な開発の流れ

以下は、Woof を使った最もシンプルなアプリケーションの例です。リクエストの解析から処理、レスポンスの出力までの流れをステップごとに記述します。

1. 処理クラス (Controller) の作成

Woof\Web\Controller インターフェースを実装し、入力を受け取って出力を返す handle メソッドを定義します。

2. エンドポイント (index.php) の実装

フロントコントローラーとなる index.php では、環境を構築し、クライアントからのリクエストを取り出して処理に渡します。

3. 実践的な Controller と View の実装例

実際の開発では Woof\Web\Operator クラスと外部のテンプレートエンジンを組み合わせて、より実践的にレスポンスを構築します。 ここでは、テンプレートエンジンとして Binder を採用し、 現在時刻や Cookie からの情報を HTML に埋め込んで出力する例を示します。

HTML テンプレートの作成 (resources/time.html)

まず、Resources の読み込み対象となる resources ディレクトリ内に HTML の雛形を作成します。

View クラスの作成

Woof\Web\View インターフェースを実装し、テンプレートの読み込みと値のバインドを行うクラスを作成します。 Controller からは「現在時刻」と「前回の訪問時刻」という純粋なデータのみを受け取り、表示文言の構築は View の責務とします。

Controller クラスの作成

Controller では Environment や Request から情報を取得し、Operator を使って Cookie の発行と View の指定をスマートに記述します。

4. 実装のコツとテストの考え方

Woof の「純粋関数」という強みを最大限に活かすため、以下のプラクティスを守ることを推奨します。

実際の開発における拡張とベストプラクティス

Woof は関数的なコア機能に特化しているため、実際のアプリケーション開発では周辺機能 (ルーティング・ユーザー認証・データベースアクセスなど) を手動で実装するか、既存のライブラリを導入するなどして実現する必要があります。

公式ドキュメント (Wiki)

より詳細な機能の仕様 (セッション管理・キャッシュ制御・テスト戦略など) や、具体的な実装パターンについては、公式 Wiki をご参照ください。

インストール

Composer からインストールできます。 例えば下記のコマンドを実行することで vendor ディレクトリ内に追加されて、使えるようになります。

動作要件: PHP 7.0 以上


All versions of woof with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package apparel-php/woof contains the following files

Loading the files please wait ...