Skip to content

Commit

Permalink
Minor documentation changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
h3xstream committed Dec 25, 2011
1 parent cee78ef commit 11e2734
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
13 changes: 7 additions & 6 deletions classes/Artists.class.php
Expand Up @@ -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();
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions classes/Cache.inter.php
Expand Up @@ -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();
}
Expand Down
12 changes: 10 additions & 2 deletions classes/CrawlerLastFM.class.php
Expand Up @@ -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) {
Expand All @@ -77,6 +77,9 @@ private function request($url) {
}
}

/**
* Require CURL extension to be install.
*/
private function requestCurl($url) {
$lines = array();

Expand All @@ -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");
Expand All @@ -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();

Expand Down
5 changes: 2 additions & 3 deletions classes/DatabaseCache.class.php
Expand Up @@ -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 ".
Expand All @@ -76,7 +76,6 @@ public function generate() {
}
}


//

$crawler = new CrawlerLastFM();
Expand All @@ -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.");
}
}
Expand Down
3 changes: 1 addition & 2 deletions classes/Errors.class.php
@@ -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 {

Expand Down
4 changes: 1 addition & 3 deletions classes/OneColumnLayout.class.php
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion classes/TwoColumnsLayout.class.php
Expand Up @@ -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
Expand Down

0 comments on commit 11e2734

Please sign in to comment.