-
-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from khoaofgod/final
Fix Autoload Confict
- Loading branch information
Showing
3 changed files
with
90 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/* | ||
* As reported, HOA Project cause some conflict problem with Autoload of Composer. | ||
* This is not phpFastCache problem, we used same autoload with Google Re-Capcha. | ||
* So, Until HOA, or the your project fixed the autoload. | ||
* All you need is put this line on your config. | ||
*/ | ||
|
||
// In your Setting / Config.php or Index.php | ||
define("PHPFASTCACHE_LEGACY",true); | ||
|
||
// If you use composer, then it auto included our "src/phpFastCache/phpFastCache.php" on vendor folder already, you don't need to do anything else | ||
|
||
require_once __DIR__.'/../src/autoload.php'; | ||
|
||
// run Files Example | ||
require_once __DIR__.'/files.php'; | ||
|
||
/* | ||
* It also bring back the __c() legacy function | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/* | ||
* If Any problem with Autoload on other project | ||
* Try to put this line on your config project | ||
* define("PHPFASTCACHE_LEGACY",true); | ||
* and just keep include phpFastCache/phpFastCache.php or Composer Autoloader | ||
*/ | ||
|
||
use phpFastCache\CacheManager; | ||
|
||
require_once __DIR__.'/../Core/DriverInterface.php'; | ||
require_once __DIR__.'/../Core/DriverAbstract.php'; | ||
require_once __DIR__.'/../Core/phpFastCache.php'; | ||
require_once __DIR__.'/../Core/phpFastCacheExtensions.php'; | ||
require_once __DIR__.'/../Exceptions/phpFastCacheCoreException.php'; | ||
require_once __DIR__.'/../Exceptions/phpFastCacheDriverException.php'; | ||
|
||
require_once __DIR__.'/../Drivers/files.php'; | ||
require_once __DIR__.'/../Drivers/memcache.php'; | ||
require_once __DIR__.'/../Drivers/memcached.php'; | ||
require_once __DIR__.'/../Drivers/mongodb.php'; | ||
require_once __DIR__.'/../Drivers/predis.php'; | ||
require_once __DIR__.'/../Drivers/redis.php'; | ||
require_once __DIR__.'/../Drivers/sqlite.php'; | ||
|
||
require_once __DIR__.'/../CacheManager.php'; | ||
require_once __DIR__.'/../phpFastCache.php'; | ||
|
||
|
||
/** | ||
* __c() Short alias | ||
* @param string $storage | ||
* @param array $config | ||
* @return mixed | ||
*/ | ||
if (!function_exists("__c")) { | ||
function __c($storage = 'auto', $config = array()) | ||
{ | ||
return CacheManager::getInstance($storage, $config); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters