-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplified the process of adding more search sites
- Loading branch information
Showing
15 changed files
with
173 additions
and
41 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
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
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
namespace OCA\NCDownloader\Tools; | ||
|
||
class File | ||
{ | ||
|
||
private $dirName; | ||
|
||
//$dir_name = iconv("utf-8", "gb2312", $dir_name); | ||
|
||
public function __construct($dirname, $suffix = "php") | ||
{ | ||
|
||
$this->dirName = $dirname; | ||
$this->suffix = $suffix; | ||
|
||
if (!is_dir($dirname)) { | ||
throw new \Exception("directory ${dirname} doesn't exit"); | ||
} | ||
|
||
} | ||
|
||
public static function create($dir, $suffix) | ||
{ | ||
return new static($dir, $suffix); | ||
} | ||
|
||
public function scandir($recursive = false) | ||
{ | ||
if ($recursive) { | ||
return $this->scandirRecursive(); | ||
} | ||
|
||
$files = \glob($this->dirName . DIRECTORY_SEPARATOR . "*.{$this->suffix}"); | ||
$this->Files = $files; | ||
return $files; | ||
} | ||
|
||
protected function scandirRecursive() | ||
{ | ||
|
||
$directory = new \RecursiveDirectoryIterator($this->dirName); | ||
$iterator = new \RecursiveIteratorIterator($directory); | ||
$iterators = new \RegexIterator($iterator, '/.*\.' . $this->suffix . '$/', \RegexIterator::GET_MATCH); | ||
|
||
$files = array(); | ||
foreach ($iterators as $info) { | ||
if ($info) { | ||
$files[] = reset($info); | ||
} | ||
} | ||
$this->Files = $files; | ||
return $files; | ||
} | ||
public function getBasename($file){ | ||
return basename($file,".".$this->suffix); | ||
} | ||
} |
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
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,4 +1,8 @@ | ||
<?php | ||
extract($_); | ||
?> | ||
<div id="app-ncdownloader-wrapper"> | ||
<?php print_unescaped($this->inc('Navigation'));?> | ||
<?php print_unescaped($this->inc('Content'));?> | ||
<div id="app-settings-data" data-search-sites=<?php print $search_sites;?> data-settings='<?php print($settings);?>' ></div> | ||
</div> |
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