Skip to content

Commit f7bb0c5

Browse files
committed
trimmed comment bloat. returning boolean on eloquent save.
1 parent b66be28 commit f7bb0c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+178
-730
lines changed

application/config/application.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
'Response' => 'System\\Response',
9393
'Session' => 'System\\Session',
9494
'Str' => 'System\\Str',
95+
'Test' => 'System\\Test',
9596
'Text' => 'System\\Text',
9697
'View' => 'System\View',
9798
),

system/auth.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ public static function user()
4141
throw new \Exception("You must specify a session driver before using the Auth class.");
4242
}
4343

44-
// -----------------------------------------------------
45-
// Get the authentication model.
46-
// -----------------------------------------------------
4744
$model = static::model();
4845

4946
// -----------------------------------------------------
@@ -65,9 +62,6 @@ public static function user()
6562
*/
6663
public static function login($username, $password)
6764
{
68-
// -----------------------------------------------------
69-
// Get the authentication model.
70-
// -----------------------------------------------------
7165
$model = static::model();
7266

7367
// -----------------------------------------------------
@@ -82,19 +76,10 @@ public static function login($username, $password)
8276
// -----------------------------------------------------
8377
$password = (isset($user->salt)) ? Hash::make($password, $user->salt)->value : sha1($password);
8478

85-
// -----------------------------------------------------
86-
// Verify that the passwords match.
87-
// -----------------------------------------------------
8879
if ($user->password == $password)
8980
{
90-
// -----------------------------------------------------
91-
// Set the user property.
92-
// -----------------------------------------------------
9381
static::$user = $user;
9482

95-
// -----------------------------------------------------
96-
// Store the user ID in the session.
97-
// -----------------------------------------------------
9883
Session::put(static::$key, $user->id);
9984

10085
return true;
@@ -111,14 +96,7 @@ public static function login($username, $password)
11196
*/
11297
public static function logout()
11398
{
114-
// -----------------------------------------------------
115-
// Remove the user ID from the session.
116-
// -----------------------------------------------------
11799
Session::forget(static::$key);
118-
119-
// -----------------------------------------------------
120-
// Clear the current user variable.
121-
// -----------------------------------------------------
122100
static::$user = null;
123101
}
124102

system/cache/driver/file.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ public function get($key, $default = null)
3838
}
3939

4040
// --------------------------------------------------
41-
// Verify that the cache file exists.
41+
// Does the cache item even exist?
4242
// --------------------------------------------------
4343
if ( ! file_exists(APP_PATH.'cache/'.$key))
4444
{
4545
return $default;
4646
}
4747

48-
// --------------------------------------------------
49-
// Read the contents of the cache file.
50-
// --------------------------------------------------
5148
$cache = file_get_contents(APP_PATH.'cache/'.$key);
5249

5350
// --------------------------------------------------
@@ -74,10 +71,6 @@ public function get($key, $default = null)
7471
*/
7572
public function put($key, $value, $minutes)
7673
{
77-
// --------------------------------------------------
78-
// The expiration time is stored as a UNIX timestamp
79-
// at the beginning of the cache file.
80-
// --------------------------------------------------
8174
file_put_contents(APP_PATH.'cache/'.$key, (time() + ($minutes * 60)).serialize($value), LOCK_EX);
8275
}
8376

system/config.php

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,10 @@ class Config {
1717
*/
1818
public static function get($key)
1919
{
20-
// ---------------------------------------------
21-
// Parse the configuration key.
22-
// ---------------------------------------------
2320
list($file, $key) = static::parse($key);
2421

25-
// ---------------------------------------------
26-
// Load the configuration file.
27-
// ---------------------------------------------
2822
static::load($file);
2923

30-
// ---------------------------------------------
31-
// Return the requested item.
32-
// ---------------------------------------------
3324
return (array_key_exists($key, static::$items[$file])) ? static::$items[$file][$key] : null;
3425
}
3526

@@ -42,19 +33,10 @@ public static function get($key)
4233
*/
4334
public static function set($file, $value)
4435
{
45-
// ---------------------------------------------
46-
// Parse the configuration key.
47-
// ---------------------------------------------
4836
list($file, $key) = static::parse($key);
4937

50-
// ---------------------------------------------
51-
// Load the configuration file.
52-
// ---------------------------------------------
5338
static::load($file);
5439

55-
// ---------------------------------------------
56-
// Set the item's value.
57-
// ---------------------------------------------
5840
static::$items[$file][$key] = $value;
5941
}
6042

@@ -66,22 +48,13 @@ public static function set($file, $value)
6648
*/
6749
private static function parse($key)
6850
{
69-
// ---------------------------------------------
70-
// Get the key segments.
71-
// ---------------------------------------------
7251
$segments = explode('.', $key);
7352

74-
// ---------------------------------------------
75-
// Validate the key format.
76-
// ---------------------------------------------
7753
if (count($segments) < 2)
7854
{
7955
throw new \Exception("Invalid configuration key [$key].");
8056
}
8157

82-
// ---------------------------------------------
83-
// Return the file and item name.
84-
// ---------------------------------------------
8558
return array($segments[0], implode('.', array_slice($segments, 1)));
8659
}
8760

@@ -93,25 +66,16 @@ private static function parse($key)
9366
*/
9467
public static function load($file)
9568
{
96-
// ---------------------------------------------
97-
// If the file has already been loaded, bail.
98-
// ---------------------------------------------
9969
if (array_key_exists($file, static::$items))
10070
{
10171
return;
10272
}
10373

104-
// ---------------------------------------------
105-
// Verify that the configuration file exists.
106-
// ---------------------------------------------
10774
if ( ! file_exists($path = APP_PATH.'config/'.$file.EXT))
10875
{
10976
throw new \Exception("Configuration file [$file] does not exist.");
11077
}
11178

112-
// ---------------------------------------------
113-
// Load the configuration file.
114-
// ---------------------------------------------
11579
static::$items[$file] = require $path;
11680
}
11781

system/cookie.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ public static function forever($key, $value, $path = '/', $domain = null, $secur
5353
*/
5454
public static function put($key, $value, $minutes = 0, $path = '/', $domain = null, $secure = false)
5555
{
56-
// ----------------------------------------------------------
57-
// If the lifetime is less than zero, delete the cookie.
58-
// ----------------------------------------------------------
5956
if ($minutes < 0)
6057
{
6158
unset($_COOKIE[$key]);

system/crypt.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,7 @@ public static function encrypt($value)
4848
mt_srand();
4949
}
5050

51-
// -----------------------------------------------------
52-
// Create the input vector.
53-
// -----------------------------------------------------
5451
$iv = mcrypt_create_iv(static::iv_size(), $random);
55-
56-
// -----------------------------------------------------
57-
// Encrypt the value using MCrypt.
58-
// -----------------------------------------------------
5952
$value = mcrypt_encrypt(static::$cipher, static::key(), $value, static::$mode, $iv);
6053

6154
// -----------------------------------------------------
@@ -72,14 +65,8 @@ public static function encrypt($value)
7265
*/
7366
public static function decrypt($value)
7467
{
75-
// -----------------------------------------------------
76-
// Decode the base64 value.
77-
// -----------------------------------------------------
7868
$value = base64_decode($value, true);
7969

80-
// -----------------------------------------------------
81-
// Validate the base64 conversion.
82-
// -----------------------------------------------------
8370
if ( ! $value)
8471
{
8572
throw new \Exception('Decryption error. Input value is not valid base64 data.');
@@ -95,9 +82,6 @@ public static function decrypt($value)
9582
// -----------------------------------------------------
9683
$value = substr($value, static::iv_size());
9784

98-
// -----------------------------------------------------
99-
// Decrypt the value using MCrypt.
100-
// -----------------------------------------------------
10185
return rtrim(mcrypt_decrypt(static::$cipher, static::key(), $value, static::$mode, $iv), "\0");
10286
}
10387

@@ -108,9 +92,6 @@ public static function decrypt($value)
10892
*/
10993
private static function key()
11094
{
111-
// -----------------------------------------------------
112-
// Validate the application key.
113-
// -----------------------------------------------------
11495
if (is_null($key = Config::get('application.key')) or $key == '')
11596
{
11697
throw new \Exception("The encryption class can not be used without an encryption key.");

system/db.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ class DB {
1717
*/
1818
public static function connection($connection = null)
1919
{
20-
// ---------------------------------------------------
21-
// If no connection was given, use the default.
22-
// ---------------------------------------------------
2320
if (is_null($connection))
2421
{
2522
$connection = Config::get('db.default');
@@ -31,14 +28,8 @@ public static function connection($connection = null)
3128
// ---------------------------------------------------
3229
if ( ! array_key_exists($connection, static::$connections))
3330
{
34-
// ---------------------------------------------------
35-
// Get the database configurations.
36-
// ---------------------------------------------------
3731
$config = Config::get('db.connections');
3832

39-
// ---------------------------------------------------
40-
// Verify the connection has been defined.
41-
// ---------------------------------------------------
4233
if ( ! array_key_exists($connection, $config))
4334
{
4435
throw new \Exception("Database connection [$connection] is not defined.");
@@ -63,14 +54,8 @@ public static function connection($connection = null)
6354
*/
6455
public static function query($sql, $bindings = array(), $connection = null)
6556
{
66-
// ---------------------------------------------------
67-
// Create a new PDO statement from the SQL.
68-
// ---------------------------------------------------
6957
$query = static::connection($connection)->prepare($sql);
7058

71-
// ---------------------------------------------------
72-
// Execute the query with the bindings.
73-
// ---------------------------------------------------
7459
$result = $query->execute($bindings);
7560

7661
// ---------------------------------------------------

system/db/connector.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,13 @@ public static function connect($config)
3636
{
3737
$connection = new \PDO($config->driver.':host='.$config->host.';dbname='.$config->database, $config->username, $config->password, static::$options);
3838

39-
// ---------------------------------------------------
40-
// Set the correct character set.
41-
// ---------------------------------------------------
4239
if (isset($config->charset))
4340
{
4441
$connection->prepare("SET NAMES '".$config->charset."'")->execute();
4542
}
4643

4744
return $connection;
4845
}
49-
// ---------------------------------------------------
50-
// If the driver isn't supported, bail out.
51-
// ---------------------------------------------------
5246
else
5347
{
5448
throw new \Exception('Database driver '.$config->driver.' is not supported.');

0 commit comments

Comments
 (0)