Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 days ago.
Improve this question
In Laravel's routes directory i created G01 folder and inside this folder i have another folder such as H220.
this is my route:
Route::get('/glob', function () {
$model_name = 'G01';
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('./'.$model_name.'/H220'),
RecursiveIteratorIterator::SELF_FIRST
);
});
finally when i refresh the page with this address:127.0.0.1/glob i get this error:
UnexpectedValueException
RecursiveDirectoryIterator::__construct(./G01/H220): Failed to open directory: No such file or directory
//PHP 8.1.13 9.26.1
i want to find all folders that there are into for example G01 folder
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I'm facing issues on laravel - I have route in my web.php file:
Route::get('/logout', 'Auth/LoginController#logout')
and when I'm trying to use it I'm receiving alert:
Target class [App\Http\Controllers\Auth/LoginController] does not exist.
changing route to Auth\LoginController#logout resolves the issue - but I think this is wrong solution.
and yes- I'm running it on windows so in theory \ is correct but previously in other projects laravel didn't had this issue
It's correct solution, that's how PHP is declare it's namespaces
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I can´t found my syntax error:
$params['title_header'] = ''.$article_info->name.' > MODELS';
Can you help me to find him?
I´m coding in a laravel controller.php file.
You don't have a close parenthesis after opening str_slug() after article_id.
$params['title_header'] = ''.$article_info->name.' > MODELS';
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
After hours of searching here and Google, I decided to ask for help.
I want the code posted to create a subdirectory in directory uploads, named by the variable $userDir. It does not give any errors in php error logs but it also does not create the sub-directory.
Code:
<?php
$userDir = $_POST['user_dir'];
$targetFolder = '/uploads';
if (!file_exists($targetFolder.'/'.$userDir)) {
mkdir($targetFolder.'/'.$userDir, 0700, true);
}
//* Some other code here
?>
Does anyone know why it does not create the folder?
Then the folder may already exist - but not where you think it is.
Try replacing your mkdir line to:
if (!file_exists(getcwd().$targetFolder.'/'.$userDir)) {
mkdir(getcwd().$targetFolder.'/'.$userDir, 0700, true);
}
Correct your target path :
$targetPath = $_SERVER['DOCUMENT_ROOT'].$targetFolder.'/'.$userDir;
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
The title says it all. What would be the most performance-friendly way to delete a file? Using PHP's unlink()-function, or PHP's delete()-function?
There is no delete function to delete files. As the documentation states:
This is a dummy manual entry to satisfy those people who are looking for unlink() or unset() in the wrong place.
The links on that page will lead you to the correct function for deleting a variable (unset) or deleting a file (unlink).
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I have been trying to develop a domain mapping service using Zend. So, I need to access the $_SERVER['HOST'] parameter during preDespatch , but If I var_dump($_SERVER) in a Plugin's preDispatch() function it does return NULL. Can someone tip off where to do that or how ?
If it's $_SERVER['HTTP_HOST'] that you want, you can try this:
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$request->getHttpHost();
}