Пример #1
0
 /**
  * XML Map File AutoLoader
  *
  * @param string $file
  *   XML Map File to work with
  *
  * @throws Next\LoaderException
  *   XML Filename was not set
  *
  * @throws Next\LoaderException
  *   XML File is not readable
  */
 public function __construct($file)
 {
     // XML File must exist
     if (!is_file($file)) {
         require_once '/../LoaderException.php';
         throw LoaderException::unfullfilledRequirements('XML File File <strong>%s</strong> doesn\'t exists', array($file));
     }
     // ... and must be readable
     if (!is_readable($file)) {
         require_once __DIR__ . '/LoaderException.php';
         throw LoaderException::unfullfilledRequirements('XML File <strong>%s</strong> is not readable', LoaderException::UNFULFILLED_REQUIREMENTS, $file);
     }
     self::$map = file_get_contents($file);
 }