Permalink
Browse files

Minor documentation changes.

  • Loading branch information...
1 parent cee78ef commit 11e273472c3efdcb9d666786b3927a40a7002f5e @h3xstream committed Dec 25, 2011
@@ -2,15 +2,15 @@
include_once("Config.class.php");
/**
- * Acces the artist data
+ * Facade to acces the artist information (name and logo).
*/
class Artists {
private static $baseDirectoryLogos = Config::FOLDER_LOGOS;
/**
* @param string Name of the artist
- * @return Artist Infos of the artist
+ * @return Artist Info of the artist
*/
public static function getArtistByName($name) {
//$db = MySQLNative::getInstance();
@@ -37,7 +37,7 @@ public static function getArtistByName($name) {
}
/**
- * @return array List of artists
+ * @return array Complete list of artists added
*/
public static function getListArtists() {
$db = Config::$dbInstance;
@@ -72,8 +72,8 @@ public static function emptyList() {
}
/**
- * Add a artist to the list in db
- * @param Artist $artist Basic infos of the artist
+ * Add an artist to the database.
+ * @param Artist $artist Basic info of the artist
*/
public static function addArtist(Artist $artist) {
$db = Config::$dbInstance;
@@ -87,8 +87,9 @@ public static function addArtist(Artist $artist) {
}
/**
+ * Load an image resource base on its name.
*
- * @param Artist $artist Infos of the artist
+ * @param Artist $artist Info of the artist
* @return resource Resource of the image
*/
public static function imageFromArtist(Artist $artist) {
@@ -27,8 +27,8 @@ public function generate();
/**
* Ouput the result.
- * No content (exept header) should have been ouput before this method call.
- * Therefore header can still be add.
+ * No content (except header) should have been ouput before this method call.
+ * To allow header to be add.
*/
public function outputResult();
}
@@ -63,7 +63,7 @@ public function getListTopArtists($username,$type='overall',$nbArtists=0) {
/**
* Get the content of the URL specified
- * @param string $url Path containing http://
+ * @param string $url Path starting with http://
*/
private function request($url) {
switch(Config::REQUEST_METHOD) {
@@ -77,6 +77,9 @@ private function request($url) {
}
}
+ /**
+ * Require CURL extension to be install.
+ */
private function requestCurl($url) {
$lines = array();
@@ -99,6 +102,9 @@ private function requestCurl($url) {
return $lines;
}
+ /**
+ * The function fopen need to be allow. (see phpinfo)
+ */
private function requestFopen($url) {
$lines = array();
$remoteRead = fopen($url, "r");
@@ -116,7 +122,9 @@ private function requestFopen($url) {
return $lines;
}
-
+ /**
+ * The function file_get_contents need to be allow. (see phpinfo)
+ */
private function requestFileGet($url) {
$lines = array();
@@ -59,7 +59,7 @@ public function generate() {
}
else { //First request : generate picture and store it in db
- //Check if number of generation is reach
+ //Check if the maximum number of generations is reach
$sql = "SELECT count(idimage) as nbgen ".
"FROM lastfm_images_cache_blob ".
@@ -76,7 +76,6 @@ public function generate() {
}
}
-
//
$crawler = new CrawlerLastFM();
@@ -91,7 +90,7 @@ public function generate() {
$this->imgGen->show();
ob_end_flush();
}
- else {
+ else { //An invalid/block/empty account
throw new Exception("No artist found.");
}
}
@@ -1,8 +1,7 @@
<?php
/**
- * Handle errors/exceptions.
- * Handle multiple ways to show an error. (text/image).
+ * Handle multiple ways to show errors (text/image).
*/
class Errors {
@@ -5,7 +5,7 @@
include_once("Config.class.php");
/**
- * Generate a image with logos in one column
+ * Generate an image with logos on one column
*/
class OneColumnLayout implements Layout {
//Various settings
@@ -79,8 +79,6 @@ public function show() {
$currentHeight = self::$marginTop;
foreach($listImageRessources as $image) {
$widthImg = imagesx($image);
- //echo $this->width."-2 * ".self::$marginSide);
- //echo $widthImg."--".$expectWidth."<br/>";
imagecopymerge($container,
$image,
@@ -5,7 +5,7 @@
include_once("Config.class.php");
/**
- * Generate a image with logos in two columns
+ * Generate an image with logos on two columns
*/
class TwoColumnsLayout implements Layout {
private static $marginTop = 4; //Between the first logo and top

0 comments on commit 11e2734

Please sign in to comment.