Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions api/src/Page/DC.php
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,6 @@ function _data_collections($single = null)
$sample_joins[2]
$extj[2]
WHERE $sess[2] $where3


ORDER BY sta DESC, id DESC";

$dcs = $this->db->paginate($q, $args);
Expand All @@ -1003,7 +1001,7 @@ function _data_collections($single = null)
$dc['VIS'] = $this->arg('prop') . '-' . $dc['VN'];

foreach (array('X1', 'X2', 'X3', 'X4') as $x) {
$dc[$x] = file_exists($dc[$x]) || file_exists($dc[$x].'.gz') ? 1 : 0;
$dc[$x] = @file_exists($dc[$x]) || @file_exists($dc[$x].'.gz') ? 1 : 0;
}

// Data collections
Expand Down Expand Up @@ -1127,7 +1125,7 @@ function _chk_image()
$sn = 0;
$images = array();
foreach (array('X1', 'X2', 'X3', 'X4') as $j => $im) {
$exists = file_exists($dc[$im]) || file_exists($dc[$im].'.gz');
$exists = @file_exists($dc[$im]) || @file_exists($dc[$im].'.gz');
array_push($images, $exists ? 1 : 0);
if ($im == 'X1' && $exists)
$sn = 1;
Expand All @@ -1142,7 +1140,7 @@ function _chk_image()

$this->profile('diffraction image');
$die = 0;
if (file_exists($di))
if (@file_exists($di))
$die = 1;
if ($this->staff && $this->has_arg('debug'))
$debug['diffraction_thumb'] = array('file' => $di, 'exists' => file_exists($di) ? 1 : 0);
Expand Down Expand Up @@ -1170,7 +1168,7 @@ function _edge($id)
$ch = str_replace('.png', '', $info[0]['PTH']);

$data = array(array(), array(), array());
if (file_exists($ch)) {
if (@file_exists($ch)) {
$dat = explode("\n", file_get_contents($ch));

foreach ($dat as $i => $d) {
Expand Down Expand Up @@ -1224,7 +1222,7 @@ function _mca($id)
$max_elements = 5;
$compton_cutoff = $info['ENERGY'] - 1100;

if (file_exists($results)) {
if (@file_exists($results)) {
$dat = explode("\n", file_get_contents($results));
foreach ($dat as $d) {
if (empty($d) || strpos($d, '#') === 0) {
Expand Down Expand Up @@ -1252,7 +1250,7 @@ function _mca($id)
}
}

if (file_exists($info['DAT'])) {
if (@file_exists($info['DAT'])) {
$dat = explode("\n", file_get_contents($info['DAT']));

foreach ($dat as $i => $d) {
Expand Down Expand Up @@ -1669,9 +1667,9 @@ function _rd($aid, $id)
$file = $info['FILEPATH'] . '/' . $info['FILENAME'];

$rows = array();
if (file_exists($file)) {
if (@file_exists($file)) {
$log = file_get_contents($file);
} elseif (file_exists($file.'.gz')) {
} elseif (@file_exists($file.'.gz')) {
$log = gzdecode(file_get_contents($file.'.gz'));
}
if (isset($log)) {
Expand Down Expand Up @@ -1838,7 +1836,7 @@ function _plot()
$pth = $info['DATFULLPATH'] ? $info['DATFULLPATH'] : str_replace($info['VISIT'], $info['VISIT'] . '/.ispyb', $this->ads($info['DIR']) . $info['IMP'] . '/' . $info['SCAN'] . '.dat');

$data = array();
if (file_exists($pth) && is_readable(($pth))) {
if (@file_exists($pth) && is_readable(($pth))) {
$dat = explode("\n", file_get_contents($pth));

foreach ($dat as $i => $d) {
Expand Down
Loading