From 0e78f83d80878c1536a459191b217095ef7f2b2a Mon Sep 17 00:00:00 2001 From: Nikita Mosiyash Date: Tue, 9 Aug 2016 12:51:34 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=D0=92=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5?= =?UTF-8?q?=D1=81=D1=81=D0=B5=20=D1=81=D0=BA=D0=B0=D0=BD=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=B2=D0=B0=D1=82=D1=8B?= =?UTF-8?q?=D0=B2=D0=B0=D0=B5=D1=82=D1=81=D1=8F=20Exception,=20=D1=87?= =?UTF-8?q?=D1=82=D0=BE=D0=B1=D1=8B=20=D0=BE=D0=B1=D1=89=D0=B8=D0=B9=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B5=D1=80=D1=8B=D0=B2=D0=B0=D0=BB=D1=81=D1=8F.?= =?UTF-8?q?=20=D0=91=D1=8B=D0=B2=D0=B0=D0=B5=D1=82,=20=D1=87=D1=82=D0=BE?= =?UTF-8?q?=20=D1=81=D0=BA=D0=B0=D0=BD=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B0=D0=BD=D0=B0=D0=B2=D0=BB=D0=B8=D0=B2?= =?UTF-8?q?=D0=B0=D0=B5=D1=82=D1=81=D1=8F,=20=D0=BD=D0=B0=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=BC=D0=B5=D1=80,=20=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=B2=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D1=81=D1=83=D1=82=D1=81=D1=82=D0=B2=D1=83=D0=B5?= =?UTF-8?q?=D1=82=20symfony=20console=20=D1=81=20=D1=82=D0=B5=D1=81=D1=82-?= =?UTF-8?q?=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=BE=D0=BC=20NotLoadableClass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Framework/Generator/IndexGenerator.php | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/Padawan/Framework/Generator/IndexGenerator.php b/src/Padawan/Framework/Generator/IndexGenerator.php index 588b681..d6b84c1 100644 --- a/src/Padawan/Framework/Generator/IndexGenerator.php +++ b/src/Padawan/Framework/Generator/IndexGenerator.php @@ -63,16 +63,20 @@ public function generateProjectIndex(Project $project, $rewrite = true) $files = $this->filesFinder->findProjectFiles($project); $all = count($files); foreach ($files as $file) { - $start = microtime(1); - $this->processFile($index, $file, $rewrite); - $end = microtime(1) - $start; - - $this->getLogger()->debug("Indexing: [$end]s"); - $this->getLogger()->debug("Memory: " . memory_get_usage()); - $globalTime += $end; - ++$done; - $process = floor($done / $all * 100); - $this->getLogger()->info("Progress: $process%"); + try { + $start = microtime(1); + $this->processFile($index, $file, $rewrite); + $end = microtime(1) - $start; + + $this->getLogger()->debug("Indexing: [$end]s"); + $this->getLogger()->debug("Memory: " . memory_get_usage()); + $globalTime += $end; + ++$done; + $process = floor($done / $all * 100); + $this->getLogger()->info("Progress: $process%"); + } catch (Exception $e) { + $this->getLogger()->error(get_class($e).": ".$e->getMessage().". Trace: ".$e->getTraceAsString()); + } } $this->getLogger()->info("[ $globalTime ]"); gc_enable(); From 055a2f70da5f2e4fa151438057ba5c8eb1f3c367 Mon Sep 17 00:00:00 2001 From: Nikita Date: Tue, 9 Aug 2016 13:03:55 +0700 Subject: [PATCH 2/3] fix --- src/Padawan/Framework/Generator/IndexGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Padawan/Framework/Generator/IndexGenerator.php b/src/Padawan/Framework/Generator/IndexGenerator.php index d6b84c1..182905d 100644 --- a/src/Padawan/Framework/Generator/IndexGenerator.php +++ b/src/Padawan/Framework/Generator/IndexGenerator.php @@ -74,7 +74,7 @@ public function generateProjectIndex(Project $project, $rewrite = true) ++$done; $process = floor($done / $all * 100); $this->getLogger()->info("Progress: $process%"); - } catch (Exception $e) { + } catch (\Exception $e) { $this->getLogger()->error(get_class($e).": ".$e->getMessage().". Trace: ".$e->getTraceAsString()); } } From 1ca469fc848bb4e717095d8b3bf32b93ede6d0f9 Mon Sep 17 00:00:00 2001 From: Nikita Date: Tue, 9 Aug 2016 14:19:43 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=B2=D0=B0=D1=82=20Error=20?= =?UTF-8?q?=D0=B8=D0=B7=20=D0=BF=D0=B0=D1=80=D1=81=D0=B5=D1=80=D0=B0=20nik?= =?UTF-8?q?ic.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Padawan/Framework/Generator/IndexGenerator.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Padawan/Framework/Generator/IndexGenerator.php b/src/Padawan/Framework/Generator/IndexGenerator.php index 182905d..da5c764 100644 --- a/src/Padawan/Framework/Generator/IndexGenerator.php +++ b/src/Padawan/Framework/Generator/IndexGenerator.php @@ -76,6 +76,8 @@ public function generateProjectIndex(Project $project, $rewrite = true) $this->getLogger()->info("Progress: $process%"); } catch (\Exception $e) { $this->getLogger()->error(get_class($e).": ".$e->getMessage().". Trace: ".$e->getTraceAsString()); + } catch (\Error $e) { + $this->getLogger()->error(get_class($e).": ".$e->getMessage().". Trace: ".$e->getTraceAsString()); } } $this->getLogger()->info("[ $globalTime ]");