Esempio n. 1
0
 /**
  * Initializes the identifier prefix when setting the cache.
  *
  * @param \TYPO3\FLOW3\Cache\Frontend\FrontendInterface $cache
  * @return void
  */
 public function setCache(\TYPO3\FLOW3\Cache\Frontend\FrontendInterface $cache)
 {
     parent::setCache($cache);
     $processUser = extension_loaded('posix') ? posix_getpwuid(posix_geteuid()) : array('name' => 'default');
     $pathHash = substr(md5(FLOW3_PATH_WEB . PHP_SAPI . $processUser['name'] . $this->context), 0, 12);
     $this->identifierPrefix = 'FLOW3_' . $pathHash;
 }
Esempio n. 2
0
 /**
  * Helper function to resolve reference to another machine.
  *
  * @param $reference_name    Name of the reference in AbstractMachine::references.
  * @param $properties_cache  Properties of referencing machine.
  * @return Reference to referred machine.
  */
 protected function resolveMachineReference($reference_name, $properties_cache)
 {
     if (!isset($this->references[$reference_name])) {
         throw new \InvalidArgumentException('Unknown reference: ' . $reference_name);
     }
     // Get reference configuration
     $r = $this->references[$reference_name];
     // Get referenced machine id
     $ref_machine_id = array();
     foreach ($r['machine_id'] as $mid_prop) {
         $ref_machine_id[] = $properties_cache[$mid_prop];
     }
     // Get referenced machine type
     $ref_machine_type = $r['machine_type'];
     return new Reference($this->backend->getMachine($ref_machine_type), $ref_machine_id);
 }
 /**
  * Initializes the identifier prefix when setting the cache.
  *
  * @param \TYPO3\Flow\Cache\Frontend\FrontendInterface $cache
  * @return void
  */
 public function setCache(\TYPO3\Flow\Cache\Frontend\FrontendInterface $cache)
 {
     parent::setCache($cache);
     $pathHash = substr(md5(FLOW_PATH_ROOT . $this->context . $cache->getIdentifier()), 0, 12);
     $this->identifierPrefix = 'Flow_' . $pathHash . '_';
 }
Esempio n. 4
0
 /**
  * Construct this backend
  *
  * @param \TYPO3\FLOW3\Core\ApplicationContext $context FLOW3's application context
  * @param array $options Configuration options
  * @throws \TYPO3\FLOW3\Cache\Exception if php redis module is not loaded
  */
 public function __construct(\TYPO3\FLOW3\Core\ApplicationContext $context, array $options = array())
 {
     if (!extension_loaded('redis')) {
         throw new \TYPO3\FLOW3\Cache\Exception('The PHP extension "redis" must be installed and loaded in order to use the phpredis redis backend.', 1279462933);
     }
     parent::__construct($context, $options);
 }
Esempio n. 5
0
 /**
  * Initializes the identifier prefix when setting the cache.
  *
  * @param \TYPO3\FLOW3\Cache\Frontend\FrontendInterface $cache
  * @return void
  */
 public function setCache(\TYPO3\FLOW3\Cache\Frontend\FrontendInterface $cache)
 {
     parent::setCache($cache);
     $this->identifierPrefix = 'FLOW3_' . md5($cache->getIdentifier() . \TYPO3\FLOW3\Utility\Files::getUnixStylePath($_SERVER['SCRIPT_FILENAME']) . PHP_SAPI) . '_';
 }
Esempio n. 6
0
 public function __construct(array $options = array())
 {
     parent::__construct($options);
     $this->_connect();
 }