Skip to content

Instantly share code, notes, and snippets.

<?php
function DB($query)
{
static $db = null;
static $result = array();
if (is_file($query) === true)
{
$db = new PDO('sqlite:' . $query, null, null, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));
<?php
class MY_Controller extends Controller
{
public function __construct()
{
parent::__construct();
}
}
<?php
class Rapidshare_Com
{
/**
* @var string
*/
public static $cookie = 'rs_cookie_data.php';
/**
<?php
// Carico la classe Rapidshare_Com
require_once('rapidshare_com.php');
// Creo l'oggetto.
Rapidshare_Com::factory();
// Eventualmente se volessi modificare il percorso del cookie.
Rapidshare_Com::$cookie = 'percorso/rapidshare_cookie.php';
<?php
class Rapidshare_Com
{
public function __construct()
{
// constructor.
}
}
<?php
class Rapidshare_Com
{
/**
* @var string
*/
public static $cookie = 'rs_cookie_data.php';
public function __construct()
<?php public static $cookie = 'rs_cookie_data.php';
<?php
// Controllo se è attivo cURL.
if ( ! function_exists('curl_init') )
{
die('cURL not found.');
}
<?php
/**
* Login
*
* @return array
* @author Namaless
**/
public static function login($username, $password)
{
<?php
/**
* Logout
*
* @return array
* @author Namaless
**/
public static function logout()
{