Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Laravel 5.3 changes the “app” folder
Jul 22, 2016 @ 14:25:24

On the Laravel News site there's a new article posted about a big change coming to the "app" folder in Laravel-based applications (hint: it's moving towards more simple, not more complex).

As we are getting closer to the launch of Laravel 5.3 new features, seem to come out almost daily. The latest is a change to the “App” folder and in a move to simplify it, the Events, Jobs, Listeners, and Policies folders are now gone.

You can still get them back if you "artisan make" something that fits in one of these four folders but, as they're not really "required" by default they were removed to do some de-cluttering. If you want to find out more about what else is coming/changing in Laravel 5.3, check out this other article also on the Laravel News site.

tagged: laravel changes application app folder events jobs listeners policies

Link: https://laravel-news.com/2016/07/laravel-5-3-changes-app-folder

Gonzalo Ayuso's Blog:
Protect files within public folders with mod_rewrite and PHP
Nov 29, 2010 @ 15:45:43

Gonzalo Ayuso has a new post that can help you protect certain files inside of a public folder by combining mod_rewrite and PHP.

Here's the problem. We have a legacy application (or a WordPress blog for the example) and we want to protect the access to the application according to our corporate single sign on. We can create a plug-in in WordPress to ensure only our single sign-on’s session cookie is activated.

In his example, he shows the handling of an uploaded file and a plugin that can be used to protect parts of the site based on session information. Unfortunately, by itself, this doesn't prevent the direct access of the file. His trick is to route all file access back through a central "media.php" script that fetches it from a file location (could even be outside the docroot). The routing to the PHP is handled via mod_rewrite and the code checks the permissions on the current user's session for access.

tagged: modrewrite public folder tutorial protect file wordpress

Link:

NETTUTS.com:
Scanning Folders with PHP
Nov 13, 2008 @ 20:18:28

The NETTUTS.com site has posted a new PHP-related screencast that covers a simple script to scan over the contents of folders in PHP. To illustrate, they create an image gallery script that mirrors the filesystem structure.

Let's imagine that you want to build a page that will display snapshots of your latest work. [...] In such instances, the best solution is to make PHP scan your "portfolio" folder and dynamically create the code for you. If you want to update your page with a new snapshot, all that you need to do is drag the image, and its respective thumbnail, into the appropriate folders - and PHP will do the rest. Let's build it now!

The screencast comes complete with the entire source and a link to a demo to show the end result.

tagged: scan folder filesystem directory tutorial photo gallery screencast

Link:

Ed Finkler's Blog:
Zend Studio for Eclipse and SFTPDrive not on speaking terms
Mar 20, 2008 @ 12:58:09

Ed Finkler, a long-time user of SFTPDrive on his Windows machine, has noticed something a bit odd lately when using the new Zend Studio (Eclipse):

For some reason, ZSfE just doesn’t show me my “k:” drive (the SFTP mount) when browsing for a project directory. This throws a real wrench in my usual workflow — ZS 5.5 had built-in SFTP support, and I could also use the local mount if I wanted.

Finding nothing in the traditional places, he's made this blog post hoping someone might have the answer. Turns out that the fix (as provided by Josh Johnston) is to create a new project around a new Remote Folder.

tagged: eclipse zendstudio sftpdrive remote folder edit drive

Link:

Web Development Blog:
Tutorial: Create a zip file from folders on the fly
Sep 28, 2007 @ 15:24:00

On the Web Development Blog, there's a quick tutorial on creating dynamic zip files via a helpful little class:

For a future project I needed these days some easy to use zip or gzip class to create a zip file from files / folders inside a specified directory. [...] I tested two [other] scripts before and must say that this script works great for single files if you add them manually. To compress a whole directory with an unknown number of files into one zip file I created some class extension to get this job done.

In his class, the get_file_from_folder method is called with the directory and the file to load them into. This loops through the files, pulling them all (directories and all) into the new zip file. An example of the class' use is also included.

tagged: zip file folder directory automatic class example zip file folder directory automatic class example

Link:

Web Development Blog:
Tutorial: Create a zip file from folders on the fly
Sep 28, 2007 @ 15:24:00

On the Web Development Blog, there's a quick tutorial on creating dynamic zip files via a helpful little class:

For a future project I needed these days some easy to use zip or gzip class to create a zip file from files / folders inside a specified directory. [...] I tested two [other] scripts before and must say that this script works great for single files if you add them manually. To compress a whole directory with an unknown number of files into one zip file I created some class extension to get this job done.

In his class, the get_file_from_folder method is called with the directory and the file to load them into. This loops through the files, pulling them all (directories and all) into the new zip file. An example of the class' use is also included.

tagged: zip file folder directory automatic class example zip file folder directory automatic class example

Link:

Alexander Netkachev's Blog:
How to use Zend Framework Controller/Action approach?
Feb 08, 2007 @ 15:57:00

Continuing on from an earlier discussion about the Zend Framework and form submission and handling, Alexander Netkachev has come back to talk a bit more about the Controller/Action approach.

I have a few discussions here about the question I opened a couple of days ago: how the standard form processing is related to the Controller/Action idea and how developers that are creating sites with the standard Folder/Page approach can use Zend Framework's Controller/Action approach.

What came out of the discussions were three points - use the Controller/Action model to your advantage, use your own forms but use RewriteRouter to make them work, or use the Folder/Page mentality instead.

tagged: zendframework controller action folder page rewriterouter zendframework controller action folder page rewriterouter

Link:

Alexander Netkachev's Blog:
How to use Zend Framework Controller/Action approach?
Feb 08, 2007 @ 15:57:00

Continuing on from an earlier discussion about the Zend Framework and form submission and handling, Alexander Netkachev has come back to talk a bit more about the Controller/Action approach.

I have a few discussions here about the question I opened a couple of days ago: how the standard form processing is related to the Controller/Action idea and how developers that are creating sites with the standard Folder/Page approach can use Zend Framework's Controller/Action approach.

What came out of the discussions were three points - use the Controller/Action model to your advantage, use your own forms but use RewriteRouter to make them work, or use the Folder/Page mentality instead.

tagged: zendframework controller action folder page rewriterouter zendframework controller action folder page rewriterouter

Link:


Trending Topics: