Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
288781c0
Commit
288781c0
authored
Sep 29, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added comments to cache classes.
parent
cc625e24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
driver.php
laravel/cache/drivers/driver.php
+20
-2
file.php
laravel/cache/drivers/file.php
+1
-0
No files found.
laravel/cache/drivers/driver.php
View file @
288781c0
...
...
@@ -15,8 +15,13 @@ abstract class Driver {
/**
* Get an item from the cache.
*
* A default value may also be specified, and will be returned in the requested
* item does not exist in the cache.
* <code>
* // Get an item from the cache driver
* $name = Cache::driver('name');
*
* // Return a default value if the requested item isn't cached
* $name = Cache::get('name', 'Taylor');
* </code>
*
* @param string $key
* @param mixed $default
...
...
@@ -41,6 +46,11 @@ abstract class Driver {
/**
* Write an item to the cache for a given number of minutes.
*
* <code>
* // Put an item in the cache for 15 minutes
* Cache::put('name', 'Taylor', 15);
* </code>
*
* @param string $key
* @param mixed $value
* @param int $minutes
...
...
@@ -52,6 +62,14 @@ abstract class Driver {
* Get an item from the cache. If the item doesn't exist in the cache, store
* the default value in the cache and return it.
*
* <code>
* // Get an item from the cache, or cache a value for 15 minutes if it doesn't exist
* $name = Cache::remember('name', 'Taylor', 15);
*
* // Use a closure for deferred execution
* $count = Cache::remember('count', function() { return User::count(); }, 15);
* </code>
*
* @param string $key
* @param mixed $default
* @param int $minutes
...
...
laravel/cache/drivers/file.php
View file @
288781c0
...
...
@@ -61,6 +61,7 @@ class File extends Driver {
*/
public
function
put
(
$key
,
$value
,
$minutes
)
{
// The expiration time is stored as a UNIX timestamp at the beginning of the file.
F
::
put
(
$this
->
path
.
$key
,
(
time
()
+
(
$minutes
*
60
))
.
serialize
(
$value
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment