diff --git a/lib/Alchemy/Phrasea/Border/File.php b/lib/Alchemy/Phrasea/Border/File.php index f05e62a7e7..3e861ddfd4 100644 --- a/lib/Alchemy/Phrasea/Border/File.php +++ b/lib/Alchemy/Phrasea/Border/File.php @@ -21,12 +21,10 @@ use Alchemy\Phrasea\Border\Attribute\AttributeInterface; use MediaVorus\Media\MediaInterface; use MediaVorus\MediaVorus; use MediaVorus\Exception\FileNotFoundException; -use PHPExiftool\Writer; use PHPExiftool\Driver\TagFactory; use PHPExiftool\Driver\Metadata\Metadata; use PHPExiftool\Driver\Metadata\MetadataBag as ExiftoolMetadataBag; use PHPExiftool\Driver\Value\Mono as MonoValue; -use PHPExiftool\Exiftool; use PHPExiftool\Exception\ExceptionInterface as PHPExiftoolException; /** @@ -149,8 +147,6 @@ class File } } - $reader = $metadatas = null; - return $this->uuid; } diff --git a/lib/Alchemy/Phrasea/Command/Plugin/AbstractPluginCommand.php b/lib/Alchemy/Phrasea/Command/Plugin/AbstractPluginCommand.php index 41cd31b4b3..5831d03a65 100644 --- a/lib/Alchemy/Phrasea/Command/Plugin/AbstractPluginCommand.php +++ b/lib/Alchemy/Phrasea/Command/Plugin/AbstractPluginCommand.php @@ -23,7 +23,7 @@ abstract class AbstractPluginCommand extends Command $output->write("Validating plugins..."); foreach ($this->container['plugins.explorer'] as $directory) { - $manifests[] = $manifest = $this->container['plugins.plugins-validator']->validatePlugin($directory); + $manifests[] = $this->container['plugins.plugins-validator']->validatePlugin($directory); } $output->writeln(" OK"); diff --git a/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php b/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php index f179dfb03d..22c29d93d1 100644 --- a/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php +++ b/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php @@ -28,7 +28,7 @@ abstract class AbstractDelivery implements ControllerProviderInterface { $file = $record->get_subdef($subdef); - $pathIn = $pathOut = $file->get_pathfile(); + $pathOut = $file->get_pathfile(); if ($watermark === true && $file->get_type() === \media_subdef::TYPE_IMAGE) { $pathOut = \recordutils_image::watermark($app, $file); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php b/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php index 3b1f93a861..0f5902a471 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php @@ -118,8 +118,6 @@ class Databoxes implements ControllerProviderInterface */ public function getDatabases(Application $app, Request $request) { - $createBase = $mountBase = false; - $sbasIds = array_merge( array_keys($app['authentication']->getUser()->ACL()->get_granted_sbas(array('bas_manage'))) , array_keys($app['authentication']->getUser()->ACL()->get_granted_sbas(array('bas_modify_struct'))) diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php index 516e85de2d..4497f3981b 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php @@ -248,7 +248,7 @@ class Lazaret implements ControllerProviderInterface $attributesToKeep = $request->request->get('attributes', array()); //Mandatory parameter - if (null === $baseId = $request->request->get('bas_id')) { + if (null === $request->request->get('bas_id')) { $ret['message'] = _('You must give a destination collection'); return $app->json($ret); diff --git a/lib/Alchemy/Phrasea/Controller/Root/Account.php b/lib/Alchemy/Phrasea/Controller/Root/Account.php index 99ca56c729..5d35cb83f0 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/Account.php +++ b/lib/Alchemy/Phrasea/Controller/Root/Account.php @@ -324,7 +324,7 @@ class Account implements ControllerProviderInterface return $app['twig']->render('account/account.html.twig', array( 'user' => $app['authentication']->getUser(), 'evt_mngr' => $app['events-manager'], - 'notifications' => $app['events-manager']->list_notifications_available($app['authentication']->getUser()->get_id()), + 'notifications' => $app['events-manager']->list_notifications_available(), )); } @@ -412,7 +412,7 @@ class Account implements ControllerProviderInterface $requestedNotifications = (array) $request->request->get('notifications', array()); - foreach ($app['events-manager']->list_notifications_available($app['authentication']->getUser()->get_id()) as $notifications) { + foreach ($app['events-manager']->list_notifications_available() as $notifications) { foreach ($notifications as $notification) { $notifId = $notification['id']; $notifName = sprintf('notification_%d', $notifId); diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php index d37df48483..be982a05d0 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php @@ -562,7 +562,6 @@ class Thesaurus implements ControllerProviderInterface { set_time_limit(300); - $imported = false; $err = ''; if (null === $bid = $request->get("bid")) { @@ -595,7 +594,6 @@ class Thesaurus implements ControllerProviderInterface if (($fp = fopen($file, 'rb'))) { $iline = 0; $curdepth = -1; - $tid = array(-1 => -1, 0 => -1); while ( ! $err && ! feof($fp) && ($line = fgets($fp)) !== FALSE) { $iline ++; if (trim($line) == '') { @@ -629,7 +627,6 @@ class Thesaurus implements ControllerProviderInterface $curdepth = $depth; $nid = (int) ($node->getAttribute('nextid')); - $id = $node->getAttribute('id') . '.' . $nid; $pid = $node->getAttribute('id'); $te_id = ($pid ? ($pid . '.') : 'T') . $nid; @@ -645,7 +642,6 @@ class Thesaurus implements ControllerProviderInterface $nsy = 0; foreach ($tsy as $syn) { $lng = $request->get('piv'); - $hit = ''; $kon = ''; if (($ob = strpos($syn, '[')) !== false) { @@ -659,10 +655,8 @@ class Thesaurus implements ControllerProviderInterface if (($ob = strpos($syn, '[')) !== false) { if (($cb = strpos($syn, ']', $ob)) !== false) { - $hit = trim(substr($syn, $ob + 1, $cb - $ob - 1)); $syn = substr($syn, 0, $ob) . substr($syn, $cb + 1); } else { - $hit = trim(substr($syn, $ob + 1)); $syn = substr($syn, 0, $ob); } } @@ -707,7 +701,6 @@ class Thesaurus implements ControllerProviderInterface } if (! $err) { - $imported = true; $databox->saveThesaurus($dom); } } @@ -784,7 +777,7 @@ class Thesaurus implements ControllerProviderInterface foreach ($rs as $row) { try { - $connbas = \connection::getPDOConnection($app, $row['sbas_id']); + \connection::getPDOConnection($app, $row['sbas_id']); } catch (\Exception $e) { continue; } @@ -966,7 +959,6 @@ class Thesaurus implements ControllerProviderInterface if ($domct && $domst) { $xpathct = new \DOMXPath($domct); - $xpathst = new \DOMXPath($domst); $ctchanged = false; $candidates2del = array(); @@ -1035,7 +1027,7 @@ class Thesaurus implements ControllerProviderInterface private function fixThesaurus($app, &$domct, &$domth, &$connbas) { - $oldversion = $version = $domth->documentElement->getAttribute("version"); + $version = $domth->documentElement->getAttribute("version"); if ('' === trim($version)) { $version = '1.0.0'; @@ -1057,7 +1049,7 @@ class Thesaurus implements ControllerProviderInterface public function loadThesaurus(Application $app, Request $request) { - if (null === $bid = $request->get("bid")) { + if (null === $request->get("bid")) { return new Response('Missing bid parameter', 400); } @@ -1090,7 +1082,7 @@ class Thesaurus implements ControllerProviderInterface if ($domct && $domth) { $oldversion = $domth->documentElement->getAttribute("version"); - if (($version = $this->fixThesaurus($app, $domct, $domth, $connbas)) != $oldversion) { + if ($this->fixThesaurus($app, $domct, $domth, $connbas) != $oldversion) { $updated = true; $databox->saveCterms($domct); $databox->saveThesaurus($domth); @@ -1266,7 +1258,7 @@ class Thesaurus implements ControllerProviderInterface try { $databox = $app['phraseanet.appbox']->get_databox((int) $bid); - $connbas = \connection::getPDOConnection($app, $bid); + \connection::getPDOConnection($app, $bid); $dom = $databox->get_dom_cterms(); $xpath = new \DOMXPath($dom); @@ -1884,9 +1876,6 @@ class Thesaurus implements ControllerProviderInterface $r->setAttribute("id", "C"); } } else { - $xmlct = str_replace(array("\r", "\n", "\t"), array("", "", ""), $domct->saveXML()); - $xmlte = str_replace(array("\r", "\n", "\t"), array("", "", ""), $dom->saveXML()); - $databox->saveThesaurus($dom); $r = $refresh_list->appendChild($ret->createElement("refresh")); @@ -1902,11 +1891,9 @@ class Thesaurus implements ControllerProviderInterface if ($sl = $ret2->getElementsByTagName("sy_list")->item(0)) { $sl = $ret->importNode($sl, true); - $sy_list = $root->appendChild($sl); } if ($request->get('debug')) { - printf("url: %s
\n", $url); printf("
" . $ret2->saveXML() . "
"); } } @@ -2651,7 +2638,6 @@ class Thesaurus implements ControllerProviderInterface if ($sl = $ret2->getElementsByTagName("sy_list")->item(0)) { $sl = $ret->importNode($sl, true); - $sy_list = $root->appendChild($sl); } if ($request->get('debug')) { @@ -3018,9 +3004,6 @@ class Thesaurus implements ControllerProviderInterface } } elseif ($n->nodeName == "sy") { $t = $n->getAttribute("v"); - if ($k = $n->getAttribute("k")) { - // $t .= " ($k)"; - } $allsy .= ( $allsy ? " ; " : "") . $t; } } @@ -3113,7 +3096,7 @@ class Thesaurus implements ControllerProviderInterface public function searchCandidateXml(Application $app, Request $request) { - if (null === $bid = $request->get("bid")) { + if (null === $request->get("bid")) { return new Response('Missing bid parameter', 400); } diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php index d887f07dcb..2a6bac4ca1 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php @@ -933,13 +933,9 @@ class Xmlhttp implements ControllerProviderInterface } if ($dom) { - $term0 = ''; - $firstTerm0 = ''; - $xpath = new \DOMXPath($dom); if ($thid == 'T' || $thid == 'C') { $q = '/' . $xqroot; - $term0 = $dbname; } else { $q = '/' . $xqroot . '//te[@id=\'' . $thid . '\']'; } @@ -1454,7 +1450,7 @@ class Xmlhttp implements ControllerProviderInterface $xp = '//te[@id="' . $tid . '"]/sy'; $nodes = $xpathct->query($xp); if ($nodes->length == 1) { - $sy = $term = $nodes->item(0); + $sy = $nodes->item(0); $syid = str_replace('.', 'd', $sy->getAttribute('id')) . 'd'; $lid .= ( $lid ? ',' : '') . "'" . $syid . "'"; $field = $sy->parentNode->parentNode->getAttribute('field'); @@ -1625,7 +1621,6 @@ class Xmlhttp implements ControllerProviderInterface $html = ''; $sbid = (int) $request->get('sbid'); - $dbname = ''; try { $databox = $app['phraseanet.appbox']->get_databox($sbid); diff --git a/lib/Alchemy/Phrasea/Form/Login/PhraseaRegisterForm.php b/lib/Alchemy/Phrasea/Form/Login/PhraseaRegisterForm.php index 1b0b7a4c14..01e2888c0a 100644 --- a/lib/Alchemy/Phrasea/Form/Login/PhraseaRegisterForm.php +++ b/lib/Alchemy/Phrasea/Form/Login/PhraseaRegisterForm.php @@ -152,14 +152,4 @@ class PhraseaRegisterForm extends AbstractType { return $this->available[$name]['type']; } - - private function getLabel($name) - { - return $this->available[$name]['label']; - } - - private function getConstraints($name, array $constraints = array()) - { - return isset($this->available[$name]['constraints']) ? $this->available[$name]['constraints'] : array(); - } } diff --git a/lib/Alchemy/Phrasea/Helper/User/Edit.php b/lib/Alchemy/Phrasea/Helper/User/Edit.php index 8d22e09402..5cfc9fe37a 100644 --- a/lib/Alchemy/Phrasea/Helper/User/Edit.php +++ b/lib/Alchemy/Phrasea/Helper/User/Edit.php @@ -229,8 +229,6 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper $rs = $stmt->fetchAll(\PDO::FETCH_ASSOC); $stmt->closeCursor(); - $msk_and = null; - $msk_xor = null; $tbits_and = array(); $tbits_xor = array(); diff --git a/lib/Alchemy/Phrasea/Helper/User/Manage.php b/lib/Alchemy/Phrasea/Helper/User/Manage.php index 2c0dc57eea..34fd6f587f 100644 --- a/lib/Alchemy/Phrasea/Helper/User/Manage.php +++ b/lib/Alchemy/Phrasea/Helper/User/Manage.php @@ -81,8 +81,6 @@ class Manage extends Helper public function search() { - $request = $this->request; - $offset_start = (int) $this->request->get('offset_start'); $offset_start = $offset_start < 0 ? 0 : $offset_start; $results_quantity = (int) $this->request->get('per_page'); diff --git a/lib/Alchemy/Phrasea/Helper/WorkZone.php b/lib/Alchemy/Phrasea/Helper/WorkZone.php index 04ef770b4e..aaa444a2e7 100644 --- a/lib/Alchemy/Phrasea/Helper/WorkZone.php +++ b/lib/Alchemy/Phrasea/Helper/WorkZone.php @@ -78,6 +78,5 @@ class WorkZone extends Helper protected function sortBaskets(array $baskets) { - $tmp_baskets = array(); } } diff --git a/lib/Alchemy/Phrasea/Out/Module/PDF.php b/lib/Alchemy/Phrasea/Out/Module/PDF.php index 0761623052..8c4a28cf9b 100644 --- a/lib/Alchemy/Phrasea/Out/Module/PDF.php +++ b/lib/Alchemy/Phrasea/Out/Module/PDF.php @@ -219,15 +219,12 @@ class PDF $this->pdf->AddPage(); $oldMargins = $this->pdf->getMargins(); - $tmargin = $oldMargins['top']; $lmargin = $oldMargins['left']; - $bmargin = $oldMargins['bottom']; $rmargin = $oldMargins['right']; $this->pdf->SetLeftMargin($lmargin + 55); $ndoc = 0; - $lastpage = $this->pdf->PageNo(); foreach ($this->records as $rec) { /* @var $rec record_adapter */ $subdef = $rec->get_subdef('thumbnail'); @@ -324,7 +321,6 @@ class PDF $rec->set_number($this->pdf->PageNo()); } $lmargin = $this->pdf->GetX(); - $tmargin = $this->pdf->GetY(); $himg = 0; $y = 0; $miniConv = NULL; diff --git a/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php b/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php index 774525e9fb..3f390d91b7 100644 --- a/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php +++ b/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php @@ -27,7 +27,7 @@ class PhraseaPDF extends \TCPDF public function Footer() { - $ml = $this->SetLeftMargin(0); + $this->SetLeftMargin(0); $mr = $this->SetRightMargin(0); $this->SetY(-15); diff --git a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php index a44de4cd47..8104305cf3 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php @@ -454,8 +454,6 @@ class PhraseaEngineQueryParser public function _extendThesaurusOnTerms(&$tree, &$copy, $useFullText, $useThesaurus, $keepfuzzy, $depth, $path) { - if ($depth == 0) - $ret = $tree; if (!$useThesaurus) { return; // full-text only : inchangé } @@ -586,7 +584,7 @@ class PhraseaEngineQueryParser $ambigus = 0; if ($tree["CLASS"] == "OPK" && $tree["NODETYPE"] == PHRASEA_OP_COLON) { - $ambigus = $this->setTids($tree, $bid, $domthe, $searchsynonyms); + $ambigus = $this->setTids($tree, $bid, $domthe); } elseif ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") { $ambigus += $this->thesaurus2($tree["LB"], $bid, $name, $domthe, $searchsynonyms, $depth + 1); $ambigus += $this->thesaurus2($tree["RB"], $bid, $name, $domthe, $searchsynonyms, $depth + 1); @@ -597,7 +595,6 @@ class PhraseaEngineQueryParser public function propAsHTML(&$node, &$html, $path, $depth = 0) { - global $parm; if ($depth > 0) { $tsy = array(); $lngfound = "?"; @@ -676,9 +673,6 @@ class PhraseaEngineQueryParser public function _queryAsHTML($tree, $depth = 0) { - if ($depth == 0) { - $ambiguites = array("n" => 0, "refs" => array()); - } switch ($tree["CLASS"]) { case "SIMPLE": case "QSIMPLE": @@ -720,7 +714,7 @@ class PhraseaEngineQueryParser } } - public function setTids(&$tree, $bid, &$domthe, $searchsynonyms) + public function setTids(&$tree, $bid, &$domthe) { if ($this->debug) print("============================ setTids:\n\$tree=" . var_export($tree, true) . "\n"); @@ -761,7 +755,6 @@ class PhraseaEngineQueryParser // $this->thesaurusDOMNodes[] = $nodes->item(0); } else { // on cherche plusieurs id's, on utilisera la syntaxe 'regexp' (l'extension repérera elle meme la syntaxe car la value finira par '$') - $val = ""; foreach ($nodes as $node) { if (!isset($tree["CONTEXT"])) $ambigus++; @@ -865,7 +858,6 @@ class PhraseaEngineQueryParser switch ($tree["CLASS"]) { case "SIMPLE": case "QSIMPLE": - $prelink = $postlink = ""; $w = is_array($tree["VALUE"]) ? implode(" ", $tree["VALUE"]) : $tree["VALUE"]; $tab = "\n" . str_repeat("\t", $depth); if (isset($tree["TIDS"]) && count($tree["TIDS"]) > 1) { diff --git a/lib/Doctrine/Repositories/StoryWZRepository.php b/lib/Doctrine/Repositories/StoryWZRepository.php index a0f5ddd1d0..5e0827390f 100644 --- a/lib/Doctrine/Repositories/StoryWZRepository.php +++ b/lib/Doctrine/Repositories/StoryWZRepository.php @@ -96,7 +96,7 @@ class StoryWZRepository extends EntityRepository if ($story) { try { - $record = $story->getRecord($app); + $story->getRecord($app); } catch (NotFoundHttpException $e) { $this->getEntityManager()->remove($story); $this->getEntityManager()->flush(); @@ -122,7 +122,7 @@ class StoryWZRepository extends EntityRepository foreach ($stories as $key => $story) { try { - $record = $story->getRecord($app); + $story->getRecord($app); } catch (NotFoundHttpException $e) { $this->getEntityManager()->remove($story); $this->getEntityManager()->flush(); @@ -146,7 +146,7 @@ class StoryWZRepository extends EntityRepository foreach ($stories as $key => $story) { try { - $record = $story->getRecord($app); + $story->getRecord($app); } catch (NotFoundHttpException $e) { $this->getEntityManager()->remove($story); $this->getEntityManager()->flush(); diff --git a/lib/classes/ACL.php b/lib/classes/ACL.php index 48f226d3a5..a88d474787 100644 --- a/lib/classes/ACL.php +++ b/lib/classes/ACL.php @@ -687,7 +687,6 @@ class ACL implements cache_cacheableInterface } $base_id = $collection->get_base_id(); - $datas = $this->_rights_bas[$base_id]; foreach ($rights as $right) { if (!$this->has_right_on_base($base_id, $right)) { diff --git a/lib/classes/API/V1/Timer.php b/lib/classes/API/V1/Timer.php index 59c3c43834..5b5f233b05 100644 --- a/lib/classes/API/V1/Timer.php +++ b/lib/classes/API/V1/Timer.php @@ -9,7 +9,6 @@ use Symfony\Component\HttpKernel\KernelEvents; class API_V1_Timer implements ServiceProviderInterface { - private $app; private $starting; public function __construct() diff --git a/lib/classes/API/V1/adapter.php b/lib/classes/API/V1/adapter.php index e93dccc500..773c5d6eb5 100644 --- a/lib/classes/API/V1/adapter.php +++ b/lib/classes/API/V1/adapter.php @@ -1239,7 +1239,7 @@ class API_V1_adapter extends API_V1_Abstract { $result = new API_V1_result($this->app, $request, $this); - $usr_id = $session = $this->app['authentication']->getUser()->get_id(); + $usr_id = $this->app['authentication']->getUser()->get_id(); $result->set_datas(array('baskets' => $this->list_baskets($usr_id))); diff --git a/lib/classes/Bridge/Api/Dailymotion.php b/lib/classes/Bridge/Api/Dailymotion.php index de5c7c921d..0a2bff6b8b 100644 --- a/lib/classes/Bridge/Api/Dailymotion.php +++ b/lib/classes/Bridge/Api/Dailymotion.php @@ -375,7 +375,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I switch ($object) { case self::ELEMENT_TYPE_VIDEO : $url = sprintf("POST /video/%s", $object_id); - $result = $this->_api->call($url, $params, $this->oauth_token); + $this->_api->call($url, $params, $this->oauth_token); break; default: throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); @@ -432,7 +432,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I $url = sprintf('POST /%s/%s/%ss', $destination, $container_id, $element_type); - $result = $this->_api->call($url, array('ids' => implode(",", $array)), $this->oauth_token); + $this->_api->call($url, array('ids' => implode(",", $array)), $this->oauth_token); return $this->get_container_from_id(self::CONTAINER_TYPE_PLAYLIST, $container_id); break; @@ -458,10 +458,10 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I $url = sprintf("DELETE /%s/%s", $object, $object_id); switch ($object) { case self::ELEMENT_TYPE_VIDEO: - $result = $this->_api->call($url, array(), $this->oauth_token); + $this->_api->call($url, array(), $this->oauth_token); break; case self::CONTAINER_TYPE_PLAYLIST: - $result = $this->_api->call($url, array(), $this->oauth_token); + $this->_api->call($url, array(), $this->oauth_token); break; default: throw new Bridge_Exception_ObjectUnknown('Unknown object ' . $object); diff --git a/lib/classes/Bridge/Api/Flickr.php b/lib/classes/Bridge/Api/Flickr.php index 8a58f80f8c..3b5ac101e3 100644 --- a/lib/classes/Bridge/Api/Flickr.php +++ b/lib/classes/Bridge/Api/Flickr.php @@ -837,7 +837,6 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf $xml = $response->getXml(); $complete = isset($xml->uploader->ticket["complete"]) ? (string) $xml->uploader->ticket["complete"] : null; - $invalid = isset($xml->uploader->ticket["invalid"]) ? (string) $xml->uploader->ticket["invalid"] : null; if ($complete) { if ((int) $complete == 0) diff --git a/lib/classes/Bridge/Api/Youtube.php b/lib/classes/Bridge/Api/Youtube.php index 576ef05448..5a9dd092ba 100644 --- a/lib/classes/Bridge/Api/Youtube.php +++ b/lib/classes/Bridge/Api/Youtube.php @@ -564,7 +564,6 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter } if ($error = $this->parse_xml_error($response->getBody())) { - $type = $error['type']; $code = $error['code']; if ($code == "too_many_recent_calls") { diff --git a/lib/classes/User/Adapter.php b/lib/classes/User/Adapter.php index 8532fb039b..f65c1d8781 100644 --- a/lib/classes/User/Adapter.php +++ b/lib/classes/User/Adapter.php @@ -1079,7 +1079,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface protected function load_notifications_preferences(Application $app) { - $notifications = $app['events-manager']->list_notifications_available($this->id); + $notifications = $app['events-manager']->list_notifications_available(); foreach ($notifications as $notification_group => $nots) { foreach ($nots as $notification) { diff --git a/lib/classes/User/Query.php b/lib/classes/User/Query.php index ad10d3c752..45f650c9f4 100644 --- a/lib/classes/User/Query.php +++ b/lib/classes/User/Query.php @@ -266,8 +266,6 @@ class User_Query implements User_QueryInterface $sql .= $this->generate_field_constraints('lastModel', $this->templates); } - $baslist = array(); - if (count($this->base_ids) == 0) { if ($this->bases_restrictions) throw new Exception('No base available for you, not enough rights'); diff --git a/lib/classes/caption/Field/Value.php b/lib/classes/caption/Field/Value.php index d273654b43..b1722c1632 100644 --- a/lib/classes/caption/Field/Value.php +++ b/lib/classes/caption/Field/Value.php @@ -191,7 +191,6 @@ class caption_Field_Value implements cache_cacheableInterface $this->delete_data_from_cache(); $this->databox_field->delete_data_from_cache(); - $sbas_id = $this->record->get_sbas_id(); $this->record->get_caption()->delete_data_from_cache(); return $this; @@ -247,7 +246,6 @@ class caption_Field_Value implements cache_cacheableInterface { $this->value = $value; - $sbas_id = $this->databox_field->get_databox()->get_sbas_id(); $connbas = $this->databox_field->get_connection(); $params = array( @@ -491,7 +489,6 @@ class caption_Field_Value implements cache_cacheableInterface */ public function delete_data_from_cache($option = null) { - $databox = $this->record->get_databox(); $this->value = $this->VocabularyId = $this->VocabularyType = null; $this->record->delete_data_from_cache(record_adapter::CACHE_TITLE); diff --git a/lib/classes/databox.php b/lib/classes/databox.php index 54c6edfd2b..2aac36fc7c 100644 --- a/lib/classes/databox.php +++ b/lib/classes/databox.php @@ -586,7 +586,7 @@ class databox extends base */ public static function mount(Application $app, $host, $port, $user, $password, $dbname, registry $registry) { - $connection = new connection_pdo('test', $host, $port, $user, $password, $dbname, array(), $app['debug']); + new connection_pdo('test', $host, $port, $user, $password, $dbname, array(), $app['debug']); $conn = $app['phraseanet.appbox']->get_connection(); $sql = 'SELECT MAX(ord) as ord FROM sbas'; @@ -838,9 +838,6 @@ class databox extends base $this->_sxml_structure = $this->_dom_structure = $this->_xpath_structure = null; - $com_struct = $this->get_dom_structure(); - $xp_struct = $this->get_xpath_structure(); - $this->meta_struct = null; $this->app['phraseanet.appbox']->delete_data_from_cache(appbox::CACHE_LIST_BASES); @@ -1139,7 +1136,6 @@ class databox extends base unset($e); } - $thesaurus = false; try { $sql = 'SELECT value AS thesaurus FROM pref WHERE prop="thesaurus" LIMIT 1;'; $stmt = $this->get_connection()->prepare($sql); @@ -1418,7 +1414,6 @@ class databox extends base $stmt = $this->get_connection()->prepare($sql); $stmt->execute(array(':terms' => $terms, ':locale' => $locale)); $stmt->closeCursor(); - $update = true; $this->cgus = null; $this->delete_data_from_cache(self::CACHE_CGUS); diff --git a/lib/classes/databox/field.php b/lib/classes/databox/field.php index fdcfeed475..51eaa5387b 100644 --- a/lib/classes/databox/field.php +++ b/lib/classes/databox/field.php @@ -434,7 +434,6 @@ class databox_field implements cache_cacheableInterface } else { $meta = $nodes->item(0); - $current_name = $meta->nodeName; if ($this->name != $meta->nodeName) { $old_meta = $meta; $meta = $dom_struct->createElement($this->name); diff --git a/lib/classes/databox/status.php b/lib/classes/databox/status.php index 5ef8246636..2c22b9d335 100644 --- a/lib/classes/databox/status.php +++ b/lib/classes/databox/status.php @@ -260,7 +260,7 @@ class databox_status $doc = $databox->get_dom_structure(); if ($doc) { $xpath = $databox->get_xpath_structure(); - $entries = $xpath->query($q = "/record/statbits/bit[@n=" . $bit . "]"); + $entries = $xpath->query("/record/statbits/bit[@n=" . $bit . "]"); foreach ($entries as $sbit) { if ($p = $sbit->previousSibling) { diff --git a/lib/classes/databox/subdefsStructure.php b/lib/classes/databox/subdefsStructure.php index 596e6f92e7..6d838f8407 100644 --- a/lib/classes/databox/subdefsStructure.php +++ b/lib/classes/databox/subdefsStructure.php @@ -231,7 +231,7 @@ class databox_subdefsStructure implements IteratorAggregate, Countable foreach ($labels as $code => $label) { $child = $dom_struct->createElement('label'); - $labelElement = $child->appendChild($dom_struct->createTextNode($label)); + $child->appendChild($dom_struct->createTextNode($label)); $lang = $child->appendChild($dom_struct->createAttribute('lang')); $lang->value = $code; $subdef->appendChild($child); diff --git a/lib/classes/deprecated/inscript.api.php b/lib/classes/deprecated/inscript.api.php index 0dadb5e8c0..72906dc234 100644 --- a/lib/classes/deprecated/inscript.api.php +++ b/lib/classes/deprecated/inscript.api.php @@ -110,10 +110,8 @@ function giveMeBases(Application $app, $usr = null) $cguColl = false; $collInscript = $baseInscript; - $defined = false; $cguSpec = false; if (false !== $xml = simplexml_load_string($collection->get_prefs())) { - $defined = true; foreach ($xml->xpath('/baseprefs/caninscript') as $caninscript) { $tmp = (string) $caninscript; if ($tmp === "1") @@ -170,7 +168,7 @@ function giveMeBases(Application $app, $usr = null) return $inscriptions; } -function giveMeBaseUsr(Application $app, $usr, $lng) +function giveMeBaseUsr(Application $app, $usr) { $noDemand = true; @@ -308,7 +306,7 @@ function giveModInscript($usr, $lng) '
' . '
'; - $demandes = giveMeBaseUsr($app, $usr, $lng); + $demandes = giveMeBaseUsr($app, $usr); $out .= $demandes['tab']; @@ -331,75 +329,3 @@ function giveModInscript($usr, $lng) return $out; } - -function giveInscript(Application $app, $lng, $demandes = null) -{ - $out = '' . - '' . - '' . - '' . - '' . - ''; - - $inscriptions = giveMeBases($app); - - foreach ($inscriptions as $sbasId => $baseInsc) { - - if (($baseInsc['CollsCGU'] || $baseInsc['Colls']) && $baseInsc['inscript']) {// il y a des coll ou s'inscrire ! - //je pr�sente la base - $out .= ''; - - if ($baseInsc['Colls']) {//des coll ou on peut s'inscrire sans cgu specifiques - //je check si ya des cgu pour la base - if ($baseInsc['CGU']) { - $out .= ''; - //$out .= ''; - } - foreach ($baseInsc['Colls'] as $collId => $collName) { - - $baseId = phrasea::baseFromColl($sbasId, $collId, $app); - $ch = "checked"; - if (( ! is_null($demandes) && ! isset($demandes[$baseId]))) - $ch = ""; - $out .= '' . - '' . - '' . - '' . - ''; - } - } - if ($baseInsc['CollsCGU']) { - foreach ($baseInsc['CollsCGU'] as $collId => $collDesc) { - - $baseId = phrasea::baseFromColl($sbasId, $collId, $app); - - $ch = "checked"; - if ( ! is_null($demandes) && ! isset($demandes[$baseId])) - $ch = ""; - $out .= '' . - '' . - // '' . - // '' . - // '' . - '' . - '' . - '' . - '' . - ''; - } - } - } - } - $out .= '
   

' . phrasea::sbas_labels($sbasId, $app) . '

' . _('login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes') . '
' . _('login::register::CGU: ouvrir dans une nouvelle fenetre') . '
'.(string) $baseInsc['CGU'].'
' . $collName . '' . - '' . - '' . _('login::register: Faire une demande d\'acces') . '' . - '

' . _('login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes') . - '
' . _('login::register::CGU: ouvrir dans une nouvelle fenetre') . '
' . - // ''.(string) $collDesc['CGU'].'' . - // '
' . $collDesc['name'] . '' . - '' . - '' . _('login::register: Faire une demande d\'acces') . '' . - '
'; - - return $out; -} diff --git a/lib/classes/eventsmanager/broker.php b/lib/classes/eventsmanager/broker.php index 0cec21b9af..8a4436e420 100644 --- a/lib/classes/eventsmanager/broker.php +++ b/lib/classes/eventsmanager/broker.php @@ -4,7 +4,6 @@ use Alchemy\Phrasea\Application; class eventsmanager_broker { - private static $_instance = false; protected $events = array(); protected $notifications = array(); protected $pool_classes = array(); @@ -113,7 +112,6 @@ class eventsmanager_broker public function get_notifications_as_array($page = 0) { - $unread = 0; $total = 0; $sql = 'SELECT count(id) as total, sum(unread) as unread @@ -125,7 +123,6 @@ class eventsmanager_broker $stmt->closeCursor(); if ($row) { - $unread = $row['unread']; $total = $row['total']; } @@ -203,7 +200,6 @@ class eventsmanager_broker public function get_notifications() { $unread = 0; - $total = 0; $sql = 'SELECT count(id) as total, sum(unread) as unread FROM notifications WHERE usr_id = :usr_id'; @@ -215,7 +211,6 @@ class eventsmanager_broker if ($row) { $unread = $row['unread']; - $total = $row['total']; } if ($unread < 3) { @@ -226,7 +221,7 @@ class eventsmanager_broker WHERE usr_id = :usr_id AND unread="1" ORDER BY created_on DESC'; } - $ret = $bloc = array(); + $ret = array(); $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt->execute(array(':usr_id' => $this->app['authentication']->getUser()->get_id())); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC); @@ -258,8 +253,6 @@ class eventsmanager_broker ); } - $html = ''; - return $ret; } @@ -280,21 +273,8 @@ class eventsmanager_broker return $this; } - public function mailed($notification, $usr_id) + public function list_notifications_available() { - $sql = 'UPDATE notifications SET mailed="0" - WHERE usr_id = :usr_id AND id = :notif_id'; - - $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); - $stmt->execute(array(':usr_id' => $usr_id, ':notif_id' => $notifications)); - $stmt->closeCursor(); - - return; - } - - public function list_notifications_available($usr_id) - { - $personnal_notifications = array(); foreach ($this->notifications as $notification) { diff --git a/lib/classes/eventsmanager/notify/autoregister.php b/lib/classes/eventsmanager/notify/autoregister.php index e9b2c62977..c45ce1b63a 100644 --- a/lib/classes/eventsmanager/notify/autoregister.php +++ b/lib/classes/eventsmanager/notify/autoregister.php @@ -147,7 +147,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract $usr_id = (string) $sx->usr_id; try { - $registered_user = User_Adapter::getInstance($usr_id, $this->app); + User_Adapter::getInstance($usr_id, $this->app); } catch (Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/downloadmailfail.php b/lib/classes/eventsmanager/notify/downloadmailfail.php index b10124bf84..8ca9d55593 100644 --- a/lib/classes/eventsmanager/notify/downloadmailfail.php +++ b/lib/classes/eventsmanager/notify/downloadmailfail.php @@ -82,16 +82,6 @@ class eventsmanager_notify_downloadmailfail extends eventsmanager_notifyAbstract $mailed = false; if ($this->shouldSendNotificationFor($params['usr_id'])) { - $user = User_Adapter::getInstance($params['usr_id'], $this->app); - $name = $user->get_display_name(); - - $to = array('email' => $user->get_email(), 'name' => $name); - - $from = array( - 'email' => $this->app['phraseanet.registry']->get('GV_defaulmailsenderaddr'), - 'name' => $this->app['phraseanet.registry']->get('GV_homeTitle') - ); - if (parent::email()) $mailed = true; } @@ -110,10 +100,7 @@ class eventsmanager_notify_downloadmailfail extends eventsmanager_notifyAbstract public function datas($datas, $unread) { $sx = simplexml_load_string($datas); - $usr_id = (int) $sx->usr_id; $reason = (int) $sx->reason; - $lst = (string) $sx->lst; - $ssttid = (int) $sx->ssttid; $dest = (string) $sx->dest; if ($reason == self::MAIL_NO_VALID) { diff --git a/lib/classes/eventsmanager/notify/feed.php b/lib/classes/eventsmanager/notify/feed.php index 5784bd9f5b..7d4eb3ee44 100644 --- a/lib/classes/eventsmanager/notify/feed.php +++ b/lib/classes/eventsmanager/notify/feed.php @@ -79,11 +79,6 @@ class eventsmanager_notify_feed extends eventsmanager_notifyAbstract $start = 0; $perLoop = 100; - $from = array( - 'email' => $entry->get_author_email(), - 'name' => $entry->get_author_name() - ); - do { $results = $Query->limit($start, $perLoop)->execute()->get_results(); diff --git a/lib/classes/eventsmanager/notify/order.php b/lib/classes/eventsmanager/notify/order.php index e923b21ed5..6912c421a3 100644 --- a/lib/classes/eventsmanager/notify/order.php +++ b/lib/classes/eventsmanager/notify/order.php @@ -145,7 +145,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract $order_id = (string) $sx->order_id; try { - $registered_user = User_Adapter::getInstance($usr_id, $this->app); + User_Adapter::getInstance($usr_id, $this->app); } catch (Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/orderdeliver.php b/lib/classes/eventsmanager/notify/orderdeliver.php index 5ef08084ee..b5a64f198b 100644 --- a/lib/classes/eventsmanager/notify/orderdeliver.php +++ b/lib/classes/eventsmanager/notify/orderdeliver.php @@ -151,7 +151,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract $n = (int) $sx->n; try { - $registered_user = User_Adapter::getInstance($from, $this->app); + User_Adapter::getInstance($from, $this->app); } catch (Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/ordernotdelivered.php b/lib/classes/eventsmanager/notify/ordernotdelivered.php index e8adf56217..bd92be9074 100644 --- a/lib/classes/eventsmanager/notify/ordernotdelivered.php +++ b/lib/classes/eventsmanager/notify/ordernotdelivered.php @@ -113,7 +113,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac $n = (int) $sx->n; try { - $registered_user = User_Adapter::getInstance($from, $this->app); + User_Adapter::getInstance($from, $this->app); } catch (Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/push.php b/lib/classes/eventsmanager/notify/push.php index ecb994ad29..742e43bccb 100644 --- a/lib/classes/eventsmanager/notify/push.php +++ b/lib/classes/eventsmanager/notify/push.php @@ -126,7 +126,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract $from = (string) $sx->from; try { - $registered_user = User_Adapter::getInstance($from, $this->app); + User_Adapter::getInstance($from, $this->app); } catch (Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/register.php b/lib/classes/eventsmanager/notify/register.php index 32522e58c7..ca87912432 100644 --- a/lib/classes/eventsmanager/notify/register.php +++ b/lib/classes/eventsmanager/notify/register.php @@ -157,7 +157,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract $usr_id = (string) $sx->usr_id; try { - $registered_user = User_Adapter::getInstance($usr_id, $this->app); + User_Adapter::getInstance($usr_id, $this->app); } catch (Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/validate.php b/lib/classes/eventsmanager/notify/validate.php index c209d2003d..e0a4709177 100644 --- a/lib/classes/eventsmanager/notify/validate.php +++ b/lib/classes/eventsmanager/notify/validate.php @@ -137,7 +137,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract $ssel_id = (string) $sx->ssel_id; try { - $registered_user = User_Adapter::getInstance($from, $this->app); + User_Adapter::getInstance($from, $this->app); } catch (Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/validationreminder.php b/lib/classes/eventsmanager/notify/validationreminder.php index bc08597d2b..3f3572be7b 100644 --- a/lib/classes/eventsmanager/notify/validationreminder.php +++ b/lib/classes/eventsmanager/notify/validationreminder.php @@ -137,7 +137,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra $ssel_id = (string) $sx->ssel_id; try { - $registered_user = User_Adapter::getInstance($from, $this->app); + User_Adapter::getInstance($from, $this->app); } catch (Exception $e) { return array(); } diff --git a/lib/classes/ftpclient.php b/lib/classes/ftpclient.php index 1de3f6f6b6..3c0102039a 100644 --- a/lib/classes/ftpclient.php +++ b/lib/classes/ftpclient.php @@ -12,7 +12,7 @@ class ftpclient { $host = mb_substr($host, -1, 1) == '/' ? mb_substr($host, 0, (mb_strlen($host) - 1)) : $host; - if (($p = mb_strpos($host, 'ftp://')) !== false) + if (mb_strpos($host, 'ftp://') !== false) $host = mb_substr($host, 6); $host = $proxy ? $proxy : $host; diff --git a/lib/classes/module/console/taskrun.php b/lib/classes/module/console/taskrun.php index 582d844161..f743f0d1f8 100644 --- a/lib/classes/module/console/taskrun.php +++ b/lib/classes/module/console/taskrun.php @@ -109,7 +109,6 @@ class module_console_taskrun extends Command ); $tmpTask = $task_manager->getTask($task_id, null); - $taskname = $tmpTask->getName(); unset($tmpTask); if (($ttyloglevel = strtoupper($input->getOption('ttyloglevel'))) != '') { diff --git a/lib/classes/module/report.php b/lib/classes/module/report.php index 5e5af5eba3..0607e84634 100644 --- a/lib/classes/module/report.php +++ b/lib/classes/module/report.php @@ -727,7 +727,7 @@ class module_report * effectue le mechanism de pagination * @param resultset $rs */ - protected function calculatePages($rs) + protected function calculatePages() { if ($this->nb_record && $this->total > $this->nb_record) { $this->previous_page = $this->nb_page - 1; @@ -843,7 +843,7 @@ class module_report //construct results $this->buildResult($this->app, $rs); //calculate prev and next page - $this->calculatePages($rs); + $this->calculatePages(); //do we display navigator ? $this->setDisplayNav(); //assign all variables diff --git a/lib/classes/module/report/activity.php b/lib/classes/module/report/activity.php index 476a5e81d0..d70ffd116d 100644 --- a/lib/classes/module/report/activity.php +++ b/lib/classes/module/report/activity.php @@ -131,7 +131,7 @@ class module_report_activity extends module_report $this->result[] = $res; //calculate prev and next page - $this->calculatePages($rs); + $this->calculatePages(); //display navigator $this->setDisplayNav(); //set report @@ -251,7 +251,7 @@ class module_report_activity extends module_report $this->total = sizeof($this->result); //calculate prev and next page - $this->calculatePages($rs); + $this->calculatePages(); //do we display navigator ? $this->setDisplayNav(); //set report @@ -357,7 +357,6 @@ class module_report_activity extends module_report $this->setChamp($rs); $this->setDisplay($tab); - $save_date = ""; $total = array('tot_doc' => 0, 'tot_prev' => 0, 'tot_dl' => 0); $i = -1; @@ -398,7 +397,7 @@ class module_report_activity extends module_report $this->result[$nb_row]['preview'] = '' . $total['tot_prev'] . ''; $this->result[$nb_row]['total'] = '' . $total['tot_dl'] . ''; } - $this->calculatePages($rs); + $this->calculatePages(); $this->setDisplayNav(); $this->setReport(); @@ -482,7 +481,7 @@ class module_report_activity extends module_report $this->result[$i][$on] = 'TOTAL'; } //calculate prev and next page - $this->calculatePages($rs); + $this->calculatePages(); //do we display navigator ? $this->setDisplayNav(); //set report @@ -609,7 +608,7 @@ class module_report_activity extends module_report '' . p4string::format_octets($total['poidprev']) . ''; } $this->total = sizeof($this->result); - $this->calculatePages($rs); + $this->calculatePages(); $this->setDisplayNav(); $this->setReport(); @@ -653,7 +652,6 @@ class module_report_activity extends module_report $rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $stmt->closeCursor(); - $save_id = ""; foreach ($rs as $row) { $kttd = 'top_ten_doc'; $kttp = 'top_ten_poiddoc'; @@ -692,7 +690,6 @@ class module_report_activity extends module_report $result[$kttpp][$id]['id'] = $id; } } - $save_id = $id; } return $result; diff --git a/lib/classes/module/report/dashboard/feed.php b/lib/classes/module/report/dashboard/feed.php index 2ba0b0f364..d5b34eff52 100644 --- a/lib/classes/module/report/dashboard/feed.php +++ b/lib/classes/module/report/dashboard/feed.php @@ -96,7 +96,6 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI public function __construct(Application $app, $sbasid, $sbas_collection, $dmin, $dmax) { $this->app = $app; - $conn = connection::getPDOConnection($app, $sbasid); $this->dmin = $dmin; $this->dmax = $dmax; $this->dminsql = $this->dateToSqlDate('dmin'); diff --git a/lib/classes/module/report/nav.php b/lib/classes/module/report/nav.php index 58300d229f..a93dc79564 100644 --- a/lib/classes/module/report/nav.php +++ b/lib/classes/module/report/nav.php @@ -142,7 +142,7 @@ class module_report_nav extends module_report } $this->total = sizeof($this->result); - $this->calculatePages($rs); + $this->calculatePages(); $this->setDisplayNav(); $this->setReport(); @@ -200,7 +200,7 @@ class module_report_nav extends module_report $this->report['legend'][] = $row['os']; } $this->total = sizeof($this->result); - $this->calculatePages($rs); + $this->calculatePages(); $this->setDisplayNav(); $this->setReport(); @@ -261,7 +261,7 @@ class module_report_nav extends module_report } $this->total = sizeof($this->result); - $this->calculatePages($rs); + $this->calculatePages(); $this->setDisplayNav(); $this->setReport(); @@ -320,7 +320,7 @@ class module_report_nav extends module_report $this->report['legend'][] = $row['combo']; } $this->total = sizeof($this->result); - $this->calculatePages($rs); + $this->calculatePages(); $this->setDisplayNav(); $this->setReport(); @@ -401,7 +401,7 @@ class module_report_nav extends module_report $this->report['legend'][] = $appli; } $this->total = sizeof($this->result); - $this->calculatePages($rs); + $this->calculatePages(); $this->setDisplayNav(); $this->setReport(); @@ -475,7 +475,7 @@ class module_report_nav extends module_report _('report:: Information sur l\'utilisateur %s'), $login ); } - $this->calculatePages($rs); + $this->calculatePages(); $this->setDisplayNav(); $this->setReport(); @@ -566,7 +566,7 @@ class module_report_nav extends module_report $this->result = $rs; $this->total = sizeof($this->result); - $this->calculatePages($rs); + $this->calculatePages(); $this->setDisplayNav(); $this->setReport(); diff --git a/lib/classes/module/report/question.php b/lib/classes/module/report/question.php index c26c85fb5e..14343c4fab 100644 --- a/lib/classes/module/report/question.php +++ b/lib/classes/module/report/question.php @@ -84,7 +84,6 @@ class module_report_question extends module_report protected function buildResult(Application $app, $rs) { - $tab = array(); $i = 0; foreach ($rs as $row) { if ($this->enable_limit && ($i > $this->nb_record)) diff --git a/lib/classes/p4file.php b/lib/classes/p4file.php index e726fa529c..33b5476082 100644 --- a/lib/classes/p4file.php +++ b/lib/classes/p4file.php @@ -17,7 +17,7 @@ class p4file $ret = false; if ($registry->get('GV_h264_streaming') && is_file($file)) { - if (($pos = mb_strpos($file, $registry->get('GV_mod_auth_token_directory_path'))) === false) { + if (mb_strpos($file, $registry->get('GV_mod_auth_token_directory_path')) === false) { return false; } diff --git a/lib/classes/patch/320a.php b/lib/classes/patch/320a.php index 6361ea7348..93882b9a8f 100644 --- a/lib/classes/patch/320a.php +++ b/lib/classes/patch/320a.php @@ -77,8 +77,6 @@ class patch_320a implements patchInterface $rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $stmt->closeCursor(); - $tasks = array(); - $sql = 'UPDATE task2 SET `class` = :class WHERE task_id = :task_id'; $stmt = $appbox->get_connection()->prepare($sql); foreach ($rs as $row) { diff --git a/lib/classes/patch/370a8.php b/lib/classes/patch/370a8.php index e6fb3834f6..01efe1bcc3 100644 --- a/lib/classes/patch/370a8.php +++ b/lib/classes/patch/370a8.php @@ -64,14 +64,12 @@ class patch_370a8 implements patchInterface */ public function apply(base $appbox, Application $app) { - $taskManager = $app['task-manager']; - $ttasks = array(); $conn = $appbox->get_connection(); $sql = 'SELECT task_id, active, name, class, settings FROM task2 WHERE class=\'task_period_workflow01\' OR class=\'task_period_ftv\''; if (($stmt = $conn->prepare($sql)) !== FALSE) { $stmt->execute(); - $ttasks = $row = $stmt->fetchAll(); + $ttasks = $stmt->fetchAll(); $stmt->closeCursor(); } diff --git a/lib/classes/patchthesaurus/203.php b/lib/classes/patchthesaurus/203.php index adb7a8df97..0f17b51a1a 100644 --- a/lib/classes/patchthesaurus/203.php +++ b/lib/classes/patchthesaurus/203.php @@ -19,7 +19,6 @@ class patchthesaurus_203 public function patch($version, &$domct, &$domth, connection_pdo &$connbas) { - global $debug; global $ctchanged, $thchanged, $needreindex; $unicode = new unicode(); @@ -106,8 +105,6 @@ class patchthesaurus_203 public function fixRejected(connection_pdo &$connbas, &$node, $rejected) { - global $debug; - if ($node->nodeType != XML_ELEMENT_NODE) { return; } @@ -138,8 +135,6 @@ class patchthesaurus_203 public function fixIds(connection_pdo &$connbas, &$node) { - global $debug; - if ($node->nodeType != XML_ELEMENT_NODE) { return; } diff --git a/lib/classes/patchthesaurus/204.php b/lib/classes/patchthesaurus/204.php index 7511113566..0e57818a36 100644 --- a/lib/classes/patchthesaurus/204.php +++ b/lib/classes/patchthesaurus/204.php @@ -19,7 +19,6 @@ class patchthesaurus_204 public function patch($version, &$domct, &$domth, connection_pdo &$connbas) { - global $debug; global $ctchanged, $thchanged, $needreindex; $unicode = new unicode(); @@ -109,8 +108,6 @@ class patchthesaurus_204 public function fixRejected(connection_pdo &$connbas, &$node, $rejected) { - global $debug; - if ($node->nodeType != XML_ELEMENT_NODE) { return; } @@ -141,8 +138,6 @@ class patchthesaurus_204 public function fixIds(connection_pdo &$connbas, &$node) { - global $debug; - if ($node->nodeType != XML_ELEMENT_NODE) { return; } diff --git a/lib/classes/record/adapter.php b/lib/classes/record/adapter.php index 54650dcf3d..0465a4eb62 100644 --- a/lib/classes/record/adapter.php +++ b/lib/classes/record/adapter.php @@ -973,8 +973,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface { $newfilename = $this->record_id . '_0_' . $name . '.' . $media->getFile()->getExtension(); - $base_url = ''; - $subdef_def = false; if ($name == 'document') { @@ -1351,7 +1349,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface $app['filesystem']->copy($file->getFile()->getRealPath(), $pathhd . $newname, true); $media = $app['mediavorus']->guess($pathhd . $newname); - $subdef = media_subdef::create($app, $record, 'document', $media); + media_subdef::create($app, $record, 'document', $media); $record->delete_data_from_cache(\record_adapter::CACHE_SUBDEFS); @@ -1500,8 +1498,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface public function delete() { $connbas = $this->get_databox()->get_connection(); - $sbas_id = $this->get_databox()->get_sbas_id(); - $conn = $this->app['phraseanet.appbox']->get_connection(); $ftodel = array(); foreach ($this->get_subdefs() as $subdef) { @@ -1529,12 +1525,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface $stmt->execute(array(':record_id' => $this->get_record_id())); $stmt->closeCursor(); - $sql = 'SELECT id FROM metadatas WHERE record_id = :record_id'; - $stmt = $connbas->prepare($sql); - $stmt->execute(array(':record_id' => $this->get_record_id())); - $rs = $stmt->fetchAll(); - $stmt->closeCursor(); - $sql = "DELETE FROM metadatas WHERE record_id = :record_id"; $stmt = $connbas->prepare($sql); $stmt->execute(array(':record_id' => $this->get_record_id())); @@ -1582,10 +1572,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface $stmt->execute(array(':record_id' => $this->get_record_id())); $stmt->closeCursor(); - $base_ids = array_map(function($collection) { - return $collection->get_base_id(); - }, $this->databox->get_collections()); - $orderElementRepository = $this->app['EM']->getRepository('\Entities\OrderElement'); /* @var $repository \Repositories\OrderElementRepository */ diff --git a/lib/classes/record/preview.php b/lib/classes/record/preview.php index 5d24318577..49a60c2461 100644 --- a/lib/classes/record/preview.php +++ b/lib/classes/record/preview.php @@ -127,7 +127,6 @@ class record_preview extends record_adapter $this->original_item = $this->container; if ($pos == 0) { $number = 0; - $title = _('preview:: regroupement '); } else { $children = $this->container->get_children(); foreach ($children as $child) { @@ -219,7 +218,6 @@ class record_preview extends record_adapter case 'RESULT': $perPage = 56; $index = ($pos - 3) < 0 ? 0 : ($pos - 3); - $page = (int) ceil($pos / $perPage); $results = $search_engine->query($query, $index, $perPage); $this->train = $results->getResults()->toArray(); @@ -593,8 +591,6 @@ class record_preview extends record_adapter $views = $dwnls = array(); $top = 1; $day = 30; - $min = 0; - $average = 0; while ($day >= 0) { diff --git a/lib/classes/recordutils/image.php b/lib/classes/recordutils/image.php index 24040b8b50..2a72e1b80c 100644 --- a/lib/classes/recordutils/image.php +++ b/lib/classes/recordutils/image.php @@ -191,7 +191,6 @@ class recordutils_image extends recordutils $domprefs->normalizeDocument(); - $text_xpos = 0; $text_width = $image_width; $logopos = null; @@ -224,9 +223,7 @@ class recordutils_image extends recordutils $text_width -= $logo_reswidth; if ($logopos == 'LEFT') { $logo_xpos = 0; - $text_xpos = $logo_reswidth; } else { - $text_xpos = 0; $logo_xpos = ($image_width - $logo_reswidth); } } diff --git a/lib/classes/set/export.php b/lib/classes/set/export.php index 271aacdb23..b99d1937be 100644 --- a/lib/classes/set/export.php +++ b/lib/classes/set/export.php @@ -431,8 +431,6 @@ class set_export extends set_abstract 'subdefs' => array() ); - $rename_done = false; - $BF = false; if ($includeBusinessFields && $user->ACL()->has_right_on_base($download_element->get_base_id(), 'canmodifrecord')) { @@ -457,7 +455,6 @@ class set_export extends set_abstract $title = strip_tags($download_element->get_title(null, null, true)); $files[$id]['export_name'] = $unicode->remove_nonazAZ09($title, true, true, true); - $rename_done = true; } else { $files[$id]["export_name"] = $infos['filename']; } @@ -804,12 +801,6 @@ class set_export extends set_abstract } } - $export_types = array( - 'download' => 0, - 'mail-export' => 2, - 'ftp' => 4 - ); - $list_base = array_unique(array_keys($tmplog)); if (!$anonymous) { diff --git a/lib/classes/set/exportftp.php b/lib/classes/set/exportftp.php index 5cacf88257..170e8de46b 100644 --- a/lib/classes/set/exportftp.php +++ b/lib/classes/set/exportftp.php @@ -31,8 +31,6 @@ class set_exportftp extends set_export */ public function export_ftp($usr_to, $host, $login, $password, $ssl, $retry, $passif, $destfolder, $makedirectory, $logfile) { - $conn = $this->app['phraseanet.appbox']->get_connection(); - $email_dest = ''; if ($usr_to) { $user_t = User_Adapter::getInstance($usr_to, $this->app); diff --git a/lib/classes/setup.php b/lib/classes/setup.php index d3b5dda5c2..39c05c3187 100644 --- a/lib/classes/setup.php +++ b/lib/classes/setup.php @@ -28,11 +28,8 @@ class setup { $GV = require(__DIR__ . "/../../lib/conf.d/_GV_template.inc"); - $debug = $log_errors = false; $vars = array(); - $error = false; - $extra_conf = ''; foreach ($GV as $section) { foreach ($section['vars'] as $variable) { @@ -94,11 +91,6 @@ class setup } } - if ($variable['name'] === 'GV_debug' && $datas[$variable['name']] === '1') - $debug = true; - if ($variable['name'] === 'GV_log_errors' && $datas[$variable['name']] === '1') - $log_errors = true; - if ($variable['type'] !== 'integer' && $variable['type'] !== 'boolean') $datas[$variable['name']] = $datas[$variable['name']]; diff --git a/lib/classes/task/abstract.php b/lib/classes/task/abstract.php index 365f9f1923..1759c31247 100644 --- a/lib/classes/task/abstract.php +++ b/lib/classes/task/abstract.php @@ -99,8 +99,6 @@ abstract class task_abstract */ protected $maxmegs; protected $runner; - private $input; - private $output; /** * delay between two loops @@ -794,22 +792,6 @@ abstract class task_abstract } } - public function traceRam($msg = '') - { - static $lastt = null; - $t = explode(' ', ($ut = microtime())); - if ($lastt === null) { - $lastt = $t; - } - $dt = ($t[0] - $lastt[0]) + ($t[1] - $lastt[1]); - - $m = memory_get_usage() >> 10; - $d = debug_backtrace(false); - - $lastt = $t; - $this->logger->addDebug(memory_get_usage() . " -- " . memory_get_usage(true)); - } - public function log($message, $level=self::LOG_INFO) { // nb : self::log_levels ARE standard log levels, ok with monolog @@ -875,17 +857,6 @@ abstract class task_abstract return $task; } - public function getUsage() - { - global $argc, $argv; - $t = "usage: " . $argv[0] . " [options]\noptions:\n"; - foreach ($this->argt as $n => $v) { - $t .= "\t" . $n . $v["usage"] . "\n"; - } - - return $t; - } - /** * * @return int id of the task diff --git a/lib/classes/task/period/RecordMover.php b/lib/classes/task/period/RecordMover.php index cabb81524a..e0e07ba11f 100644 --- a/lib/classes/task/period/RecordMover.php +++ b/lib/classes/task/period/RecordMover.php @@ -46,7 +46,6 @@ class task_period_RecordMover extends task_appboxAbstract $dom->formatOutput = true; if ($dom->loadXML($oldxml)) { - $xmlchanged = false; foreach (array( 'str:period' , 'boo:logsql' @@ -72,7 +71,6 @@ class task_period_RecordMover extends task_appboxAbstract $ns->appendChild($dom->createTextNode($pvalue ? '1' : '0')); break; } - $xmlchanged = true; } } diff --git a/lib/classes/task/period/archive.php b/lib/classes/task/period/archive.php index 6cfaa97992..55b70dfdc4 100644 --- a/lib/classes/task/period/archive.php +++ b/lib/classes/task/period/archive.php @@ -92,7 +92,6 @@ class task_period_archive extends task_abstract $dom->formatOutput = true; $dom->preserveWhiteSpace = false; if ($dom->loadXML($oldxml)) { - $xmlchanged = false; foreach (array( 'str:base_id' , 'str:hotfolder' @@ -125,7 +124,6 @@ class task_period_archive extends task_abstract $ns->appendChild($dom->createTextNode($pvalue ? '1' : '0')); break; } - $xmlchanged = true; } } @@ -296,7 +294,8 @@ class task_period_archive extends task_abstract { $this->debug = false; - $conn = $this->dependencyContainer['phraseanet.appbox']->get_connection(); + // test if connection is available + $this->dependencyContainer['phraseanet.appbox']->get_connection(); $this->sxTaskSettings = simplexml_load_string($this->settings); @@ -378,7 +377,7 @@ class task_period_archive extends task_abstract $loop = 0; while ($this->running) { try { - $conn = connection::getPDOConnection($this->dependencyContainer); + connection::getPDOConnection($this->dependencyContainer); } catch (Exception $e) { $this->log($e->getMessage()); if ($this->getRunner() == self::RUNNER_SCHEDULER) { @@ -1184,7 +1183,7 @@ class task_period_archive extends task_abstract if ($n->getAttribute('isdir') == '1') { if ($n->getAttribute('grp')) { // a grp folder : special work - $this->ArchiveGrp($dom, $n, $path, $path_archived, $path_error, $nodesToDel); + $this->archiveGrp($dom, $n, $path, $path_archived, $path_error, $nodesToDel); } else { // ...normal subfolder : recurse $name = $n->getAttribute('name'); @@ -1807,7 +1806,6 @@ class task_period_archive extends task_abstract } $file = $node->getAttribute('name'); - $cid = $node->getAttribute('cid'); $captionFileNode = null; $rootpath = p4string::delEndSlash(trim((string) ($this->sxTaskSettings->hotfolder))); @@ -1857,8 +1855,6 @@ class task_period_archive extends task_abstract */ private function archiveFileAndCaption(\DOMDocument $dom, \DOMElement $node, \DOMElement $captionFileNode = null, $path, $path_archived, $path_error, $grp_rid, array &$nodesToDel) { - $ret = false; - $file = $node->getAttribute('name'); $cid = $node->getAttribute('cid'); $captionFileName = $captionFileNode ? $captionFileNode->getAttribute('name') : null; @@ -1893,9 +1889,9 @@ class task_period_archive extends task_abstract $collection = collection::get_from_coll_id($this->dependencyContainer, $databox, (int) $cid); if ($captionFileName === null) { - $record = $this->createRecord($collection, $path . '/' . $file, null, $grp_rid); + $this->createRecord($collection, $path . '/' . $file, null, $grp_rid); } else { - $record = $this->createRecord($collection, $path . '/' . $file, $path . '/' . $captionFileName, $grp_rid); + $this->createRecord($collection, $path . '/' . $file, $path . '/' . $captionFileName, $grp_rid); } $node->setAttribute('archived', '1'); @@ -1940,8 +1936,6 @@ class task_period_archive extends task_abstract $this->log($e->getMessage()); } } - if (!$node->getAttribute('keep')) // do not count copy of special files as a real event - $ret = true; } if ($node->getAttribute('error') && $this->move_error) { @@ -1968,10 +1962,6 @@ class task_period_archive extends task_abstract $this->log($e->getMessage()); } } - // do not count copy of special files as a real event - if (!$node->getAttribute('keep')) { - $ret = true; - } } if (!$node->getAttribute('keep')) { diff --git a/lib/classes/task/period/cindexer.php b/lib/classes/task/period/cindexer.php index 399000bd2c..dce38a6258 100644 --- a/lib/classes/task/period/cindexer.php +++ b/lib/classes/task/period/cindexer.php @@ -128,7 +128,6 @@ class task_period_cindexer extends task_abstract $dom = new DOMDocument(); $dom->formatOutput = true; if ($dom->loadXML($oldxml)) { - $xmlchanged = false; foreach (array("str:host", "str:port", "str:base", "str:user", "str:password", "str:socket", "boo:nolog", "str:clng", "boo:winsvc_run", "str:charset", 'str:debugmask', 'str:stem', 'str:sortempty') as $pname) { $ptype = substr($pname, 0, 3); $pname = substr($pname, 4); @@ -151,7 +150,6 @@ class task_period_cindexer extends task_abstract $ns->appendChild($dom->createTextNode($pvalue ? '1' : '0')); break; } - $xmlchanged = true; } } @@ -389,13 +387,8 @@ class task_period_cindexer extends task_abstract { $cmd = $this->getIndexer(); - $nullfile = '/dev/null'; $this->method = self::METHOD_PROC_OPEN; - if (defined('PHP_WINDOWS_VERSION_BUILD')) { - $nullfile = '/dev/null'; - } - if ( ! file_exists($cmd) || ! is_executable($cmd)) { $this->setState(self::STATE_STOPPED); $this->log(sprintf('File \'%s\' does not exists', $cmd)); @@ -459,8 +452,6 @@ class task_period_cindexer extends task_abstract $args_nopwd[] = '--run'; } - $logdir = $this->dependencyContainer['root.path'] . '/logs/'; - $this->new_status = NULL; // new status to set at the end $this->exception = NULL; // exception to throw at the end @@ -503,13 +494,6 @@ class task_period_cindexer extends task_abstract $process = proc_open($execmd, $descriptors, $pipes, dirname($cmd), null, array('bypass_shell' => true)); - $pid = NULL; - if (is_resource($process)) { - $proc_status = proc_get_status($process); - if ($proc_status['running']) { - $pid = $proc_status['pid']; - } - } $qsent = ''; $timetokill = NULL; $sock = NULL; diff --git a/lib/classes/task/period/ftp.php b/lib/classes/task/period/ftp.php index 11b7409566..c2b60b06b8 100644 --- a/lib/classes/task/period/ftp.php +++ b/lib/classes/task/period/ftp.php @@ -52,7 +52,6 @@ class task_period_ftp extends task_appboxAbstract $dom->preserveWhiteSpace = false; $dom->formatOutput = true; if ((@$dom->loadXML($oldxml)) != FALSE) { - $xmlchanged = false; foreach (array('str:proxy', 'str:proxyport', 'str:period', 'pop:syslog') as $pname) { $ptype = substr($pname, 0, 3); $pname = substr($pname, 4); @@ -76,7 +75,6 @@ class task_period_ftp extends task_appboxAbstract $ns->appendChild($dom->createTextNode($pvalue ? '1' : '0')); break; } - $xmlchanged = true; } } @@ -274,15 +272,10 @@ class task_period_ftp extends task_appboxAbstract protected function processOneContent(appbox $appbox, $export) { - $conn = $appbox->get_connection(); - - $id = $export->getId(); - $state = ""; $ftp_server = $export->getAddr(); $ftp_user_name = $export->getLogin(); $ftp_user_pass = $export->getPwd(); - $usr_id = $export->getUsrId(); $ftpLog = $ftp_user_name . "@" . p4string::addEndSlash($ftp_server) . $export->getDestfolder(); @@ -498,8 +491,6 @@ class task_period_ftp extends task_appboxAbstract public function finalize(appbox $appbox, FtpExport $export) { - $conn = $appbox->get_connection(); - if ($export->getCrash() >= $export->getNbretry()) { $this->send_mails($appbox, $export); diff --git a/lib/classes/task/period/ftpPull.php b/lib/classes/task/period/ftpPull.php index bf082519fa..dee274b728 100644 --- a/lib/classes/task/period/ftpPull.php +++ b/lib/classes/task/period/ftpPull.php @@ -100,7 +100,6 @@ class task_period_ftpPull extends task_appboxAbstract public function printInterfaceJS() { - global $parm; ?>