Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apc required #59

Closed
kilica opened this issue Feb 26, 2015 · 3 comments
Closed

apc required #59

kilica opened this issue Feb 26, 2015 · 3 comments

Comments

@kilica
Copy link

kilica commented Feb 26, 2015

とりあえずご報告です。

composer create-project bear/skeleton MyVendor.MyPackage ~1.0@dev
cd MyVendor.MyPackage
composer install

で、該当のURLを開くと、

PHP Fatal error: Call to undefined function Doctrine\Common\Cache\apc_fetch() in /var/www/MyVendor.MyPackage/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php on line 40

となりました。
apt-get で apc を入れるとエラーは解消。

@koriym
Copy link
Member

koriym commented Feb 26, 2015

報告ありがとうございます!
apcはオプションにします。
apcはオプションにしました。

@koriym
Copy link
Member

koriym commented Feb 26, 2015

bootstrap.php

$app = (new Bootstrap)->newApp(new AppMeta(__NAMESPACE__), $context, new ApcCache);

このApcCacheの部分が問題です

対処法がいくつかあります。

  1. bootstrap.phpを変更
$cache = function_exists('apc_fetch') ? new ApcCache : new FilesystemCache($appMeta->tmpDir);
$app = (new Bootstrap)->newApp($appMeta, $context, $cache);
  1. Bootstrap::newApp()の中に1同様の処理を

  2. FilesystemCacheで固定。ユーザーが環境に合わせて手で変える。

4)ApcCacheで固定。ユーザーが環境に合わせて手で変える。

koriym added a commit to bearsunday/BEAR.Package that referenced this issue Feb 26, 2015
@koriym
Copy link
Member

koriym commented Feb 28, 2015

2)にして解決しました。

$app = (new Bootstrap)->newApp($appMeta, $context, $cache);

$app = (new Bootstrap)->newApp($appMeta, $context);

という風に三番目の引数を無指定にするとApcがなければファイルキャッシュを使うようになります。

@koriym koriym closed this as completed Feb 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants