File path for Laravel installed in subfolder - php

I have an old legacy project and I am trying to upgrade it to Laravel framework.
So far I have installed the laravel into the www directory of my existing project and changing the project one page at a time.
Following is my directory structure.
MyProject
├── uploaded_files
├── www
│ ├── index.php
│ ├── images
│ ├── beta (Laravel Project)
That is how everything is structured. So my new laravel project url is myproject.com/beta/public for now.
Anyway, my concern is that all the existing uploaded files exists in uploaded_files directory and some in www->images directory.
How can I access those files from beta (Laravel) directory so that I can display them and also create new files when necessary.
So far I have tried to access the images directly from the main url but it doesnt work and also tried to create a symlink directly with uploaded_files but that doesnt work either.
How can I access the files from MyProject=> Uploaded files in Laravel controller?
Thank you.

Related

What is a non-versioned file?

I've got a php program, on my debian server.
If set it up and changed the php version to 8.1.
Now the server is giving me an error message:
Some non-versioned files are outdated - WARNING: One or more files that are not included in REDCap's version directory but reside in your web server's main REDCap directory were found outdated, and thus need to be replaced. Click the download button below to download a zip file that contains the files you need to replace.
I want to know what a non-versioned file is, so I can fix that problem.
After downloading that .zip file I took a look inside and I realized it was empty...
I didnt change anything in the Servers main directory...
Thank you
In REDCap server administration, application files can be either versioned or non-versioned. Versioned files are those files that exist within a directory named for the version, i.e. redcap_v13.1.0. Non-versioned files are those that are outside this versioned file structure, in REDCap's base directory.
Below is a sample directory structure (altered so this answer does not expose the file structure of a non-open application):
.
└──redcap
├── init.php
├── index.php
├── redcap_v13.1.0
│ ├── tests.ini
│   ├── unit.php
│   └── api.bat
├── tmp
│   └── index.php
└── debug.php
Files tests.ini, unit.php and api.bat are versioned, and everything else is non-versioned.
Upgrades to the REDCap application mostly affect versioned files, but occasionally an upgrade will modify non-versioned files, which the application itself is incapable of directly modifying on the server. In these cases the application directs the administrator to download a zip file containing the modified non-versioned files and instructions on installing them.
If this zip file was empty for you, then that might indicate an incomplete upgrade. Some admins in the community have recently advocated for publishing hashes alongside releases to allow admins to ensure that the release has been correctly downloaded.
If this issue persists (though your comment suggests not), then I'd recommend taking this issue to the REDCap Admin Community, which you ought to have access to if you can access the code.

How to access to assets when the project root is different directory with PhpStorm?

I'm developing on local environment with PhpStorm. The directories is like this.
project
└── public
├── css
│   └── style.css
└── index.html
The source code of html contains relative path like /css/style.css.
When I open index.html using browser preview with PhpStorm, the path to css is to http://localhost:<port>/css/style.css although it should be to http://localhost:<port>/project/public/css/style.css.
I tried to set the resource root to public directory but the problem could not be resolved.
https://www.jetbrains.com/help/phpstorm/content-root.html

Symfony API Configuration

I want to create an API to communicate with a REST Web Service.
For this, I'm building this API as a library. I Just create the folder structure:
├── composer.json
├── LICENSE
├── README.md
└── src
└── PkgRoot
└── PkgName
├── XXXAPIFactory.php
├── XXXAPI.php
├── XXXAPIRestImpl.php
├── XXXResponse.php
└── Protocol.php
Now, I'm trying add a configuration for the API-KEY. I believe this should be added in config.yml.
Should I change all these structure the be like a Symfony Bundle? How can I add and register configurations parameters in config.ym?
It is not mandatory, but I think that you definitely should. Why aren't you using a Bundle ?
Using a Bundle would permit you, among so many other cool things, to create a friendly configuration as you want.

Laravel PSR-4 : No hint path defined for [User]

I am trying to make a view on my package, and this is my code:
View::make("User::login");
But I get this error: No hint path defined for [User].
My structure is like this:
app
├──config
├──database
├── modules
└── Core
└── User
├──Controllers
├──models
└──views
└──login.blade.php
├── lang
├── migrations
└── routes.php
The view namespaces actually have nothing to do with PSR-4. You also have to add view directories manually. You can either do that by adding it to the paths array in config/view.php or by registering it somewhere else (preferably in a service provider)
View::addLocation('/path/to/views');
To come back to your actual question, you can register view namespaces like this:
View::addNamespace('User', '/path/to/views');
i've resolved my problem.
it was my fault, it should be :
View::make("Core/User::login");
thanks.

Moving a Symfony project from a server with CPanel to Wamp

I'm having problems with Symfony. I recently got a Symfony project and I'm having problems moving a Symfony project from a server with Cpanel to a virtual server on Wamp. I haven't used Symfony before so I'm really confused on how the whole project would be opened in like a tree structure so that i can see whats going on.
Symfony's file structure is as such:
apps/
frontend/
backend/
batch/
cache/
config/
data/
sql/
doc/
lib/
model/
log/
plugins/
test/
unit/
functional/
web/
css/
images/
js/
uploads/
I presume you do not have access to the repository so you'll have to copy all the files to your WAMP installation. Generally you do not need to copy over the cache/* and log/* files. After copying the whole project to WAMP you can see if it's still working by running ./symfony.bat or ./symfony on linux/unix/osx.
Best way to copy the whole project is by creating an archive first, then extract it into your WAMP installation. In order to create tar.gz/zip/rar/tar.bz backups follow these steps:
Log in your cPanel and go to the File Manager;
In the left box, navigate to the directory / files you'd like to archive. Mark the items to be archived in the left box and choose "Compress" from the top menu

Categories