orkestra/apc-bundle

为 Symfony 2 PHP 框架的 APC 缓存包

安装次数: 7,353

依赖者: 0

建议者: 0

安全性: 0

星标: 3

关注者: 2

分支: 2

开放问题: 0

类型:symfony-bundle

dev-master 2013-04-05 18:42 UTC

This package is not auto-updated.

Last update: 2024-09-14 13:07:33 UTC


README

为 Symfony 2 PHP 框架的 APC 包

英文

此包包含

  • 一个用于删除用户或/和 OPCode 缓存的命令。
  • 一个用于轻松使用 APC 的服务。
  • 一个带有用于 PHP4 编写的使用内存的 APC 管理页面(我不是作者,见 Extra 文件夹)。

安装

步骤 1: 使用 composer 下载 OrkestraAPCBundle

在您的 composer.json 中,添加 OrkestraAPCBundle

{
    "require": {
        "orkestra/apc-bundle": "dev-master"
    }
}

现在,您必须使用此命令更新您的 vendors

$ php composer.phar update orkestra/apc-bundle

步骤 2: 在 AppKernel.php 中添加

<?php
// app/AppKernel.php

public function registerBundles()
{
	$bundles = array(
		// ...
		new Orkestra\APCBundle\OrkestraAPCBundle()
	);
}

步骤 3: 配置您的 config.yml

基本配置

# app/config/config.yml
orkestra_apc:
	# Your website URL. Use by the clear command.
    website_url: http://orkestra.dev

完整配置

# app/config/config.yml
orkestra_apc:
	# Your website URL. Use by the clear command.
    website_url: http://orkestra.dev
	# Location of the "web" folder. Edit this option only if you have moved this folder.
	web_dir: %kernel.root_dir%/../web
	# The clear command will create a file in your web folder, if the removal doesn't work (you will be warned), a password is safety.
    access_password: my_password

如何使用

APC 类使用

<?php

$apc = $this->container->get('orkestra.apc');
$apc->set('new_value', 'example', 300); // 300 seconds before timeout (auto delete)

if ($apc->exist('new_value')) {
	$apc->get('new_value');
}
$apc->delete('new_value');

最后,命令使用

Usage:
 php app/console apc:clear [--opcode] [--user]
Options:
 --opcode  Clear only the opcode cache
 --user    Clear only the user cache
Help:
 Note: without options, both caches will be deleted

问题或新功能?

请随意在 问题跟踪器 中发布您的问题或功能请求!

法语

Ce bundle contient

  • 一个命令,用于删除用户和/或 OPCode 缓存。
  • 一个服务,可轻松使用 APC。
  • 一个带有 PHP4 编写的使用内存的 APC 管理页面(我不是作者,见 Extra 文件夹)。

安装

第一部分:使用 composer 下载 OrkestraAPCBundle

在您的 composer.json 中,添加 OrkestraAPCBundle

{
    "require": {
        "orkestra/apc-bundle": "dev-master"
    }
}

现在,您必须使用此命令更新您的 vendors

$ php composer.phar update orkestra/apc-bundle

第二部分:在 AppKernel.php 中添加

<?php
// app/AppKernel.php

public function registerBundles()
{
  $bundles = array(
		// ...
		new Orkestra\APCBundle\OrkestraAPCBundle()
	);
}

第三部分:配置您的 config.yml

最小配置

# app/config/config.yml
orkestra_apc:
	# URL de votre site. Utilisé par la commande de clear.
    website_url: http://orkestra.dev

完整配置

# app/config/config.yml
orkestra_apc:
	# URL de votre site. Utilisée par la commande de clear.
    website_url: http://orkestra.dev
	# Emplacement du dossier "web". Modifiez cette option seulement si vous avez déplacé le dossier.
	web_dir: %kernel.root_dir%/../web
	# La commande de clear va créer un fichier dans votre dossier web, si jamais la suppression ne fonctionne pas (vous serez averti), un mot de passe est toujours plus sécurisant.
    access_password: my_password

示例

APC 类使用

<?php

$apc = $this->container->get('orkestra.apc');
$apc->set('new_value', 'example', 300); // 300 seconds before timeout (auto delete)

if ($apc->exist('new_value')) {
    $apc->get('new_value');
}
$apc->delete('new_value');

最后,命令使用

Usage:
 php app/console apc:clear [--opcode] [--user]
Options:
 --opcode  Supprime seulement le cache OPCode
 --user    Supprime seulement le cache utilisateur
Help:
 Note: si aucune option n'est renseignée, les deux caches seront supprimés

有问题或新功能?

请通过 问题跟踪器 发布您的问题或新功能!