本文整理汇总了PHP中File::allFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP File::allFiles方法的具体用法?PHP File::allFiles怎么用?PHP File::allFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类File
的用法示例。
在下文中一共展示了File::allFiles方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeupPages
function makeupPages()
{
$pages_path = Manager::getPath('pages');
if (file_exists($pages_path)) {
foreach (\File::allFiles($pages_path) as $file) {
Manager::page(str_replace('.twig', '', $file->getFilename()));
}
}
}
示例2: getStartupSeedFiles
public function getStartupSeedFiles($db)
{
//$db is tenant or craiglorious
$directory = database_path("seeds/csv_startup_data/" . $db);
$files = \File::allFiles($directory);
return $files;
}
示例3: __construct
public function __construct()
{
// Carbon Language
Carbon::setLocale('tr');
// create home page if non exist
count(Menu::where('slug', '/anasayfa')->get()) == 0 ? Menu::create(['title' => 'Anasayfa', 'slug' => '/anasayfa', 'eng_title' => 'Home', 'eng_slug' => '/home'])->save() : null;
// create config file if non exist
!\File::exists(storage_path('.config')) ? \File::put(storage_path('.config'), json_encode(['brand' => 'Brand Name', 'mail' => 'info@brand.com', 'active' => 1, 'eng' => '0', 'one_page' => '0', 'googlemap' => '', 'header' => ''])) : null;
$this->config = json_decode(\File::get(storage_path('.config')));
!\File::exists(storage_path('app/custom/css')) ? \File::makeDirectory(storage_path('app/custom/css'), 0755, true) : null;
!\File::exists(storage_path('app/custom/js')) ? \File::makeDirectory(storage_path('app/custom/js'), 0755, true) : null;
// get css & js files from custom folder
// css
$css = \File::allFiles(storage_path('app/custom/css'));
if (!empty($css)) {
foreach ($css as $cs) {
$this->css[$cs->getCtime()] = $cs->getRelativePathname();
}
// sort by date
ksort($this->css);
}
// js
$js = \File::allFiles(storage_path('app/custom/js'));
if (!empty($js)) {
foreach ($js as $j) {
$this->js[$j->getCtime()] = $j->getRelativePathname();
}
// sort by date
ksort($this->js);
}
}
示例4: show
public function show($id)
{
$classified = Classified::find($id);
$classifiedCategory = ClassifiedCategory::find($classified->classified_category_id);
$classifiedImages = array();
if (File::exists(public_path() . '/uploads/' . $id)) {
$classifiedImages = File::allFiles(public_path() . '/uploads/' . $id);
}
return View::make('classifieds.index', array('classified' => $classified, 'images' => $classifiedImages, 'classifiedCategory' => $classifiedCategory));
}
示例5: run
public function run()
{
$directory = 'storage/surveyimages';
$files = File::allFiles($directory);
foreach ($files as $file) {
$filename = explode("/", $file);
// echo (string)$filename[2], "\n";
SurveyImage::firstOrCreate(array('images' => $filename[2]));
}
}
示例6: getLoadImages
public function getLoadImages(Filesystem $filesystem)
{
$toJson = [];
$files = \File::allFiles(public_path('uploads/all/'));
/** @var \SplFileInfo $file */
foreach ($files as $file) {
$toJson[] = ['image' => '/uploads/all/' . $file->getBasename(), 'thumb' => '/uploads/all/' . $file->getBasename()];
}
return $toJson;
}
示例7: getExistingBillTemplates
/**
* Get Existing Bill Templates
*/
protected function getExistingBillTemplates()
{
$path = __DIR__ . '/../../../../';
$billsTypes = \File::allFiles($path . "resources/components/bills");
$customPath = base_path() . '/resources/views/bills';
$customBillTypes = \File::isDirectory($customPath) ? \File::allFiles($customPath) : [];
foreach (array_merge($billsTypes, $customBillTypes) as $billFile) {
app('veer')->loadedComponents['billsTypes'][array_get(pathinfo($billFile), 'filename')] = array_get(pathinfo($billFile), 'filename');
}
}
示例8: _getBundles
/**
*
*
* @return array
*/
private function _getBundles()
{
$this->comment('Searching files...');
$bundles = array();
foreach (\File::allFiles(app_path('views')) as $file) {
$this->getOutput()->write('.');
foreach (\Jboysen\LaravelGcc\GCCompiler::findHelperMatches(\File::get($file)) as $bundle) {
$bundles[] = $bundle;
}
}
$this->getOutput()->writeln('Done!');
return $bundles;
}
示例9: getExcel
public function getExcel()
{
$projects = [];
$files = File::allFiles(base_path() . '/excelPlace/');
//$files = file('http://localhost:8888/excelPlace/');
//return $files;
foreach ($files as $file) {
if (pathinfo($file)['extension'] == "xlsx" || pathinfo($file)['extension'] == "xls") {
$projects[pathinfo($file)['filename']] = pathinfo($file)['basename'];
}
}
return $projects;
}
示例10: getBrowse
public function getBrowse()
{
if (!Input::has('CKEditor')) {
return App::abort(403, 'Unauthorized action.');
}
$fnnumber = Input::get('CKEditorFuncNum');
$path = public_path() . '\\assets\\ckeditor\\upload\\thumbnail';
$allfiles = File::allFiles($path);
$files = array();
foreach ($allfiles as $file) {
array_push($files, basename((string) $file));
}
return View::make('faq.filebrowse')->with(compact('files', 'fnnumber'));
}
示例11: run
public function run()
{
$dir = dirname(dirname(dirname(__DIR__)));
$dir = $dir . "\\makeyourikorma\\public\\img\\uniques\\";
echo "Directorio de iamgenes unicas: {$dir} \n";
$file_set = File::allFiles($dir);
foreach ($file_set as $file) {
$filename = (string) $file;
$type = explode("\\", dirname($filename));
$type = $type[count($type) - 1];
$uri = str_replace("\\", '/', explode('img', $filename)[1]);
$uri = 'img' . $uri;
\DB::table('uniqueImages')->insert(array('route' => $uri, 'type' => $type));
}
}
示例12: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
if (is_dir(app_path('Http/Forms'))) {
foreach (\File::allFiles(app_path('Http/Forms')) as $f) {
$class = \App::getNamespace() . 'Http\\Forms\\' . str_replace('.php', '', $f->getFilename());
Register::container($class);
}
}
//добавим геттеры в контейнеры
//добавим сеттеры в контейнеры
foreach (Register::$containers as $container) {
$this->info($container);
foreach ($this->form_element_methods_get as $method) {
$params = $this->getMethodParams($container, $method);
$this->putPhpDoc($container, 'string', $method, $params);
}
foreach ($this->form_element_methods_set as $method) {
$params = $this->getMethodParams($container, $method);
$this->putPhpDoc($container, $container, $method, $params);
}
}
//добавим элементы в контейнеры
$i = 0;
foreach (Register::$elements as $name => $data) {
$this->info(++$i . ') ' . $name);
$class = Arr::get($data, 'class');
foreach (Register::$containers as $container) {
$params = $this->getMethodParams($class, 'laraform');
$method = \Illuminate\Support\Str::camel('put_' . $name);
$this->putPhpDoc($container, $class, $method, $params);
}
foreach ($this->form_element_methods_get as $method) {
$params = $this->getMethodParams($class, $method);
$this->putPhpDoc($class, 'string', $method, $params);
}
foreach ($this->form_element_methods_set as $method) {
$params = $this->getMethodParams($class, $method);
$this->putPhpDoc($class, $class, $method, $params);
}
}
$data = $this->ret;
$content = \View::make('quickform::ide-helper', ['data' => $data, 'tab' => "\t"]);
file_put_contents(base_path() . '/_ide_helper_laraform.php', $content);
$this->info('IDE helper сгенерирован для ' . count($this->classes) . ' элементов');
}
示例13: listPublicFiles
/**
* lists all files in a public folder
*
* @param string
* @return array lists all files
*/
public static function listPublicFiles($dir_rel, $prefix_url = false)
{
$list_files = array();
$dir_rel = '/' . $dir_rel;
$dir_abs = public_path() . $dir_rel;
if (\File::exists($dir_abs)) {
$files = \File::allFiles($dir_abs);
foreach ($files as $file) {
$filename = (string) $dir_rel . $file->getRelativePathName();
if ($prefix_url) {
$filename = \Config::get('app.url') . $filename;
}
$list_files[] = $filename;
}
asort($list_files);
}
return $list_files;
}
示例14: run
public function run()
{
$dir = dirname(dirname(dirname(__DIR__)));
$dir = $dir . "\\makeyourikorma\\public\\img\\variants\\";
echo "Directorio de iamgenes con variantes: {$dir} \n";
$file_set = File::allFiles($dir);
foreach ($file_set as $file) {
$filename = (string) $file;
$uri = str_replace("\\", '/', explode('img', $filename)[1]);
$uri = 'img' . $uri;
$id_color = explode("\\", $filename);
$id_color = $id_color[count($id_color) - 1];
$id_color = explode('.', $id_color);
$id = $id_color[0];
$id_color = $id_color[1];
\DB::table('variantImages')->insert(array('route' => $uri, 'id_color' => $id_color, 'image_id' => $id));
}
}
示例15: setup
protected function setup()
{
$basePath = 'views/backend/';
$path = app_path($basePath);
$files = File::allFiles($path);
$arr = array();
foreach ($files as $file) {
$filename = str_replace($path, '', str_replace('.tpl', '', (string) $file));
$tmp = array_filter(explode('/', $filename));
$content = File::get((string) $file, '');
$html = trim(preg_replace('/\\s+/', ' ', preg_replace('/<!-- (.*)-->/Uis', '', $content)));
$dotpath = implode('.', $tmp);
array_set($arr, $dotpath, $html);
}
$contents = 'var TPL = ' . json_encode($arr);
$response = Response::make($contents, 200);
$response->header('Content-Type', 'application/javascript');
return $response;
}