示例#1
0
 /**
  * {@inheritdoc}
  */
 public function getFilePlugin(File $file)
 {
     if ($file->internalPathname()->localAdapter() instanceof LinkAwareAdapterInterface) {
         return new LinkFilePlugin($file);
     }
     return null;
 }
示例#2
0
 /**
  * @param \Filicious\File     $path
  * @param int|string|callable $_ List of flags, bitmask filters File::LIST_*, glob patterns or callables function($file) { return true|false; }
  */
 public function __construct(File $path, $_ = null)
 {
     $filters = func_get_args();
     foreach ($filters as $filter) {
         if (is_int($filter)) {
             if ($filter & static::CURRENT_AS_PATHNAME) {
                 $this->flags |= static::CURRENT_AS_PATHNAME;
             } else {
                 if ($filter & static::CURRENT_AS_BASENAME) {
                     $this->flags |= static::CURRENT_AS_BASENAME;
                 } else {
                     if ($filter & static::CURRENT_AS_FILE) {
                         $this->flags |= static::CURRENT_AS_FILE;
                     } else {
                         if ($filter & static::CURRENT_AS_SELF) {
                             $this->flags |= static::CURRENT_AS_SELF;
                         } else {
                             if ($filter & static::KEY_AS_PATHNAME) {
                                 $this->flags |= static::KEY_AS_PATHNAME;
                             } else {
                                 if ($filter & static::KEY_AS_FILENAME) {
                                     $this->flags |= static::KEY_AS_FILENAME;
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     parent::__construct($path->internalPathname(), $filters);
 }