-
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
359 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<?php | ||
return [ | ||
|
||
/** | ||
return [ | ||
/* | ||
* The storage config | ||
*/ | ||
"storage" => [ | ||
/** | ||
'storage' => [ | ||
/* | ||
* Returns the folder name of the chunks. The location is in storage/app/{folder_name} | ||
*/ | ||
"chunks" => "chunks", | ||
"disk" => "local" | ||
'chunks' => 'chunks', | ||
'disk' => 'local', | ||
], | ||
"clear" => [ | ||
/** | ||
'clear' => [ | ||
/* | ||
* How old chunks we should delete | ||
*/ | ||
"timestamp" => "-3 HOURS", | ||
"schedule" => [ | ||
"enabled" => true, | ||
"cron" => "25 * * * *" // run every hour on the 25th minute | ||
] | ||
'timestamp' => '-3 HOURS', | ||
'schedule' => [ | ||
'enabled' => true, | ||
'cron' => '25 * * * *', // run every hour on the 25th minute | ||
], | ||
], | ||
"chunk" => [ | ||
'chunk' => [ | ||
// setup for the chunk naming setup to ensure same name upload at same time | ||
"name" => [ | ||
"use" => [ | ||
"session" => true, // should the chunk name use the session id? The uploader must send cookie!, | ||
"browser" => false // instead of session we can use the ip and browser? | ||
] | ||
] | ||
] | ||
'name' => [ | ||
'use' => [ | ||
'session' => true, // should the chunk name use the session id? The uploader must send cookie!, | ||
'browser' => false, // instead of session we can use the ip and browser? | ||
], | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,95 @@ | ||
<?php | ||
|
||
namespace Pion\Laravel\ChunkUpload\Config; | ||
|
||
/** | ||
* Class FileConfig | ||
* Class FileConfig. | ||
* | ||
* Enables loading a config settings from the Laravel Config facade. | ||
* | ||
* @package Pion\Laravel\ChunkUpload\Config | ||
*/ | ||
class FileConfig extends AbstractConfig | ||
{ | ||
/** | ||
* The file name of the config | ||
* The file name of the config. | ||
*/ | ||
const FILE_NAME = "chunk-upload"; | ||
const FILE_NAME = 'chunk-upload'; | ||
|
||
/** | ||
* Returns the disk name to use for the chunk storage | ||
* Returns the disk name to use for the chunk storage. | ||
* | ||
* @return string | ||
*/ | ||
public function chunksDiskName() | ||
{ | ||
return $this->get("storage.disk"); | ||
return $this->get('storage.disk'); | ||
} | ||
|
||
|
||
/** | ||
* The storage path for the chunks | ||
* The storage path for the chunks. | ||
* | ||
* @return string the full path to the storage | ||
* | ||
* @see FileConfig::get() | ||
*/ | ||
public function chunksStorageDirectory() | ||
{ | ||
return $this->get("storage.chunks"); | ||
return $this->get('storage.chunks'); | ||
} | ||
|
||
/** | ||
* Returns the time stamp string for clear command | ||
* Returns the time stamp string for clear command. | ||
* | ||
* @return string | ||
* | ||
* @see FileConfig::get() | ||
*/ | ||
public function clearTimestampString() | ||
{ | ||
return $this->get("clear.timestamp"); | ||
return $this->get('clear.timestamp'); | ||
} | ||
|
||
/** | ||
* Returns the shedule config array | ||
* Returns the shedule config array. | ||
* | ||
* @return array<enable,cron> | ||
*/ | ||
public function scheduleConfig() | ||
{ | ||
return $this->get("clear.schedule"); | ||
return $this->get('clear.schedule'); | ||
} | ||
|
||
/** | ||
* Should the chunk name add a session? | ||
* | ||
* @return boolean | ||
* @return bool | ||
*/ | ||
public function chunkUseSessionForName() | ||
{ | ||
return $this->get("chunk.name.use.session", true); | ||
return $this->get('chunk.name.use.session', true); | ||
} | ||
|
||
/** | ||
* Should the chunk name add a ip address? | ||
* | ||
* @return boolean | ||
* @return bool | ||
*/ | ||
public function chunkUseBrowserInfoForName() | ||
{ | ||
return $this->get("chunk.name.use.browser", false); | ||
return $this->get('chunk.name.use.browser', false); | ||
} | ||
|
||
/** | ||
* Returns a chunks config value | ||
* | ||
* @param string $key the config name is prepended to the key value | ||
* Returns a chunks config value. | ||
* | ||
* @param string $key the config name is prepended to the key value | ||
* @param mixed|null $default | ||
* | ||
* @return mixed | ||
* | ||
* @see \Config::get() | ||
*/ | ||
public function get($key, $default = null) | ||
{ | ||
return config(self::FILE_NAME.".".$key, $default); | ||
return config(self::FILE_NAME.'.'.$key, $default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.