The generated JSON file is described by res/schema/repository-schema-1.0.json.
Since: 1.0
Author: Bernhard Schussek (bschussek@gmail.com)
Author: Titouan Galopin (galopintitouan@gmail.com)
Inheritance: extends AbstractEditableRepository, implements Psr\Log\LoggerAwareInterface
 /**
  * {@inheritdoc}
  */
 protected function addFilesystemResource($path, FilesystemResource $resource)
 {
     // Read children before attaching the resource to this repository
     $children = $resource->listChildren();
     parent::addFilesystemResource($path, $resource);
     // Recursively add all child resources
     $basePath = '/' === $path ? $path : $path . '/';
     foreach ($children as $name => $child) {
         $this->addFilesystemResource($basePath . $name, $child);
     }
 }
Exemple #2
0
 /**
  * Creates a new repository.
  *
  * @param string $path          The path to the JSON file. If relative, it
  *                              must be relative to the base directory.
  * @param string $baseDirectory The base directory of the store. Paths
  *                              inside that directory are stored as relative
  *                              paths. Paths outside that directory are
  *                              stored as absolute paths.
  * @param bool   $validateJson  Whether to validate the JSON file against
  *                              the schema. Slow but spots problems.
  */
 public function __construct($path, $baseDirectory, $validateJson = false)
 {
     // Does not accept ChangeStream objects
     // The ChangeStream functionality is implemented by the repository itself
     parent::__construct($path, $baseDirectory, $validateJson);
 }