Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phragment/storage/PhragmentFragment.php
Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | foreach ($children as $full_path => $child) { | ||||
if (array_key_exists($path, $mappings)) { | if (array_key_exists($path, $mappings)) { | ||||
if ($child->isDirectory() && $mappings[$path] === null) { | if ($child->isDirectory() && $mappings[$path] === null) { | ||||
// Don't create a version entry for a directory | // Don't create a version entry for a directory | ||||
// (unless it's been converted into a file). | // (unless it's been converted into a file). | ||||
continue; | continue; | ||||
} | } | ||||
// The file is being updated. | // The file is being updated. | ||||
// TODO | |||||
Lint: TODO Comment: This comment has a TODO. | |||||
$file = PhabricatorFile::newFromFileData( | $file = PhabricatorFile::newFromFileData( | ||||
$mappings[$path], | $mappings[$path], | ||||
array('name' => basename($path))); | array('name' => basename($path))); | ||||
$child->updateFromFile($viewer, $file); | $child->updateFromFile($viewer, $file); | ||||
} else { | } else { | ||||
// The file is being deleted. | // The file is being deleted. | ||||
$child->deleteFile($viewer); | $child->deleteFile($viewer); | ||||
} | } | ||||
} | } | ||||
// Iterate over the mappings to find new files. | // Iterate over the mappings to find new files. | ||||
foreach ($mappings as $path => $data) { | foreach ($mappings as $path => $data) { | ||||
if (!array_key_exists($base_path.'/'.$path, $children)) { | if (!array_key_exists($base_path.'/'.$path, $children)) { | ||||
// The file is being created. If the data is null, | // The file is being created. If the data is null, | ||||
// then this is explicitly a directory being created. | // then this is explicitly a directory being created. | ||||
$file = null; | $file = null; | ||||
if ($mappings[$path] !== null) { | if ($mappings[$path] !== null) { | ||||
// TODO | |||||
Lint: TODO Comment This comment has a TODO. Lint: TODO Comment: This comment has a TODO. | |||||
$file = PhabricatorFile::newFromFileData( | $file = PhabricatorFile::newFromFileData( | ||||
$mappings[$path], | $mappings[$path], | ||||
array('name' => basename($path))); | array('name' => basename($path))); | ||||
} | } | ||||
self::createFromFile( | self::createFromFile( | ||||
$viewer, | $viewer, | ||||
$file, | $file, | ||||
$base_path.'/'.$path, | $base_path.'/'.$path, | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |
This comment has a TODO.