google-code-export / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
2 stars 1 forks source link

Global Setting to enable/disable scandir #441

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What functionality do you want to see?

When migrating sites, the CCTM's data will contain cached paths to the helper 
classes and tpls.  So even if you plan on importing a saved .cctm.json 
definition, you will have a point on the new site where the CCTM is loading the 
old definition and its paths, so you won't even be able to import the 
definition.

Original issue reported on code.google.com by ever...@fireproofsocks.com on 3 Jan 2013 at 9:36

GoogleCodeExporter commented 9 years ago
A couple variations/related-items: 
1. the contents of the tpls could be cached.  Downside is it's a lot of more 
info to load up even on page requests that do not generate forms.
2. the CCTM could look for a static file that would override the contents of 
the database, effectively putting the CCTM into "read-only mode".  See issue 
#397.  Maybe put a file in your library and then define a constant with its 
name, e.g. define('CCTM_DEF_FILE', 'my_defs.cctm.json'); where the file is one 
of those in the library.

Original comment by ever...@fireproofsocks.com on 4 Jan 2013 at 4:17

GoogleCodeExporter commented 9 years ago
scandir is used in 2 files:

* includes/CCTM.php
* includes/CCTM_Ajax.php

Easy fix would be to add a function_exists test to the CCTMtests.php file... 
otherwise, we're looking at some variant of the 
http://www.php.net/manual/en/filesystemiterator.construct.php -- and a test 
should be added regardless since it's required for normal operations.

Original comment by ever...@fireproofsocks.com on 29 Jul 2013 at 5:25

GoogleCodeExporter commented 9 years ago
Replaced scandir with FilesystemIterator and added a test.

Committed revision 747642.

Original comment by ever...@fireproofsocks.com on 29 Jul 2013 at 6:21