<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Engine_Iframely
{

  const IFRAMELY_HOST = 'iframely';
  const SOCIALENGINE_HOST = 'socialengine';
  const OWN_HOST = 'self';
  const DEFAULT_HOST = 'socialengine';

  static public function factory($options = array())
  {
    $host = "";
    if( !empty($options['host']) ) {
      $host = $options['host'];
      unset($options['host']);
    }
    if($host == "socialengine" || empty($host)){
      $host = 'socialenginecustom';
    }
    $class = 'Engine_Service_Iframely_Host_' . ucfirst($host);
    Engine_Loader::loadClass($class);
    if( !class_exists($class, false) ) {
      throw new Engine_Image_Exception(sprintf('Missing class for host "%s"', $host));
    }
    return new $class($options);
  }

  static public function getHostingList()
  {
    return array(
			self::SOCIALENGINE_HOST,
      self::IFRAMELY_HOST,
      //self::OWN_HOST,
    );
  }
}
