示例#1
0
 /**
  * Sets a new adapter
  *
  * @param  string  $adapter   Adapter to use
  * @param  boolean $direction OPTIONAL False means Download, true means upload
  * @param  array   $options   OPTIONAL Options to set for this adapter
  * @throws \Zend\File\Transfer\Exception
  */
 public function setAdapter($adapter, $direction = false, $options = array())
 {
     if (end\Loader::isReadable('Zend/File/Transfer/Adapter/' . ucfirst($adapter) . '.php')) {
         $adapter = 'Zend_File_Transfer_Adapter_' . ucfirst($adapter);
     }
     if (!class_exists($adapter)) {
         end\Loader::loadClass($adapter);
     }
     $direction = (int) $direction;
     $this->_adapter[$direction] = new $adapter($options);
     if (!$this->_adapter[$direction] instanceof Adapter\AbstractAdapter) {
         throw new Exception("Adapter " . $adapter . " does not extend Zend_File_Transfer_Adapter_Abstract");
     }
     return $this;
 }
示例#2
0
 /**
  * @param string $className
  */
 public function enableManifest($className)
 {
     end\Loader::loadClass($className);
     $reflClass = new \ReflectionClass($className);
     if (!in_array("Zend_Tool_Framework_Manifest_Interface", $reflClass->getInterfaceNames())) {
         throw new Framework\Exception("Given class is not a manifest.");
     }
     $this->_doEnable($className);
 }