Skip to content

Commit

Permalink
add function comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Schwirjow authored and Alexander Schwirjow committed Jul 18, 2018
1 parent 850eeef commit 44845a5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Resources/contao/classes/FontFaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public function updateFontFaces($dc)
}
}

/**
* Delete file while purging the font out of the database
*
* @param DataContainer $dc
*/
public function deleteFontFace($dc)
{
$fontName = $dc->activeRecord->name;
Expand Down Expand Up @@ -190,6 +195,13 @@ public function generateFilePath($fontName)
return sprintf("bundles/spotwebfontgenerator/css/webfont-%s.css", $slug);
}

/**
* Determine if a string is a relative path and if so
* convert it into a full URL
*
* @param string $strPath
* @return string
*/
private function pathToUrl($strPath)
{
if (filter_var($strPath, FILTER_VALIDATE_URL)) {
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/contao/classes/FontMaintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

class FontMaintenance extends Backend
{
/**
* Generate files only active fonts
*/
public function rebuildFontCSS()
{
$this->import('Database');
Expand All @@ -18,6 +21,9 @@ public function rebuildFontCSS()
}
}

/**
* Delete generated CSS files
*/
private function purgeFiles()
{
foreach (scandir(System::getContainer()->getParameter('kernel.project_dir').'/web/bundles/spotwebfontgenerator/css/') as $file) {
Expand Down

0 comments on commit 44845a5

Please sign in to comment.