Skip to content

Commit

Permalink
changed 'coref' to 'public'
Browse files Browse the repository at this point in the history
  • Loading branch information
perminov committed Feb 14, 2022
1 parent bf845e4 commit 2fd9c2d
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions application/controllers/admin/EntitiesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class Admin_EntitiesController extends Indi_Controller_Admin_Exportable {
*/
public function phpAction() {

// PHP class files for sections of type 'system' - will be created in '/system', //$repositoryDirA = array('s' => 'system', 'o' => 'coref', 'p' => 'www');
// 'often' - in '/coref', 'project' - in '/www'
$repositoryDirA = ['y' => 'system', 'o' => 'coref', 'n' => 'www'];
// PHP class files for sections of type 'system' - will be created in '/system', //$repositoryDirA = array('s' => 'system', 'o' => 'public', 'p' => 'www');
// 'often' - in '/public', 'project' - in '/www'
$repositoryDirA = ['y' => 'system', 'o' => 'public', 'n' => 'www'];

// If current section has a type, that is (for some reason) not in the list of known types
if (!in($this->row->system, array_keys($repositoryDirA)))
Expand Down
12 changes: 6 additions & 6 deletions application/controllers/admin/SectionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class Admin_SectionsController extends Indi_Controller_Admin_Exportable {
public function jsAction() {

// JS-controller files for sections of type 'system' - will be created in '/system',
// 'often' - in '/coref', 'project' - in '/www', but beware that js-controller files
// 'often' - in '/public', 'project' - in '/www', but beware that js-controller files
// created for system sections should be moved from /system/js/admin/app/controller
// to Indi Engine system app source code into app/controller folder, and then should be
// compiled by 'sencha app build --production' command, so that admin/classic/app.js bundle to be refreshed
$repoDirA = ['s' => 'system', 'o' => 'coref', 'p' => 'www'];
$repoDirA = ['s' => 'system', 'o' => 'public', 'p' => 'www'];

// If current section has a type, that is (for some reason) not in the list of known types
if (!in($this->row->type, array_keys($repoDirA)))
Expand Down Expand Up @@ -69,9 +69,9 @@ public function jsAction() {
*/
public function phpAction() {

// JS-controller files for sections of type 'system' - will be created in '/system', //$repositoryDirA = array('s' => 'system', 'o' => 'coref', 'p' => 'www');
// 'often' - in '/coref', 'project' - in '/www'
$repoDirA = ['s' => 'system', 'o' => 'coref', 'p' => 'www'];
// JS-controller files for sections of type 'system' - will be created in '/system', //$repositoryDirA = array('s' => 'system', 'o' => 'public', 'p' => 'www');
// 'often' - in '/public', 'project' - in '/www'
$repoDirA = ['s' => 'system', 'o' => 'public', 'p' => 'www'];

// If current section has a type, that is (for some reason) not in the list of known types
if (!in($this->row->type, array_keys($repoDirA)))
Expand Down Expand Up @@ -164,7 +164,7 @@ public function adjustGridData(&$data) {
foreach (ar('extendsPhp,extendsJs') as $prop) $default[$prop] = t()->fields($prop)->defaultValue;

// Dirs dict by section type
$dir = ['s' => 'system', 'p' => 'www', 'o' => 'coref'];
$dir = ['s' => 'system', 'p' => 'www', 'o' => 'public'];

// Foreach data item
foreach ($data as &$item) {
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

// Set include path. Here we add more include paths, in case if some stuff is related to front module only,
// but required to be available in admin module.
$dirs = ['../www/', (COM || preg_match('~^' . preg_quote(STD, '~') . '/admin\b~', URI) ? '' : '../coref/'), '../system/'];
$dirs = ['../www/', (COM || preg_match('~^' . preg_quote(STD, '~') . '/admin\b~', URI) ? '' : '../public/'), '../system/'];
$subs = ['library', 'application/controllers', 'application/models']; $p = PATH_SEPARATOR;
foreach($dirs as $d) if ($d) foreach($subs as $s) $inc[] = $d . $s; $inc[] = get_include_path();
set_include_path(implode($p, $inc));
Expand Down
12 changes: 6 additions & 6 deletions library/Indi.php
Original file line number Diff line number Diff line change
Expand Up @@ -1068,12 +1068,12 @@ public static function implode($files = [], $alias = '') {
$refresh = false;

// Get filename of file, containing modification times for all files that are compiled
$mtime = DOC . STD . '/' . (uri()->module == 'front' ? 'coref' : 'system') . '/' . $rel . '/' . uri()->module . '/indi.all' . ($alias ? '.' . $alias : '') . '.mtime';
$mtime = DOC . STD . '/' . (uri()->module == 'front' ? 'public' : 'system') . '/' . $rel . '/' . uri()->module . '/indi.all' . ($alias ? '.' . $alias : '') . '.mtime';

// Append mirror files
$mirrorA = [];
for($i = 0; $i < count($files); $i++)
foreach (ar('system,coref,www') as $place)
foreach (ar('system,public,www') as $place)
if (is_file(DOC . STD . '/' . $place . preg_replace('/:[a-zA-Z\.$]+$/', '', $files[$i])))
$mirrorA[] = '/' . $place . $files[$i];

Expand Down Expand Up @@ -1162,7 +1162,7 @@ public static function implode($files = [], $alias = '') {
$txt = file_get_contents($file);

// Get dir, relative to document root
$dir = pathinfo(preg_replace('~^/(www|coref|system)~', '', $mirrorA[$i]), PATHINFO_DIRNAME);
$dir = pathinfo(preg_replace('~^/(www|public|system)~', '', $mirrorA[$i]), PATHINFO_DIRNAME);

// Convert relative paths, mentioned in css files to paths, relative to web root
$txt = preg_replace('!url\((\'|"|)/!', 'url($1' . STD . '/', $txt);
Expand Down Expand Up @@ -1203,7 +1203,7 @@ public static function implode($files = [], $alias = '') {
if ($alias != 'ie') $txt = gzencode($txt, 9);

// Build the filename
$gz = DOC . STD . '/' . (uri()->module == 'front' ? 'coref' : 'system')
$gz = DOC . STD . '/' . (uri()->module == 'front' ? 'public' : 'system')
. $rel . '/' . uri()->module . '/indi.all' . ($alias ? '.' . $alias : '') . rif($alias != 'ie', '.gz') .'.' . $ext;

// Refresh compilation file
Expand Down Expand Up @@ -2397,14 +2397,14 @@ public static function me($prop = null) {

/**
* Detect absolute filepath for a relative one, checking
* 'www', 'coref' and 'system' folders as places of possible location
* 'www', 'public' and 'system' folders as places of possible location
*
* @static
* @param $src
* @return string
*/
public static function abs($src) {
foreach (ar('www,coref,system') as $rep)
foreach (ar('www,public,system') as $rep)
if (file_exists($abs = DOC . STD . '/' . $rep . $src))
return $abs;
}
Expand Down
4 changes: 2 additions & 2 deletions library/Indi/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function __construct() {
}

// Add script paths for major system part and for front core part
$view->addScriptPath(DOC . STD . '/coref/' . $spath . $mpath);
$view->addScriptPath(DOC . STD . '/public/' . $spath . $mpath);
$view->addScriptPath(DOC . STD . '/system/' . $spath . $mpath);

// If certain project has 'library' dir
Expand All @@ -128,7 +128,7 @@ public function __construct() {
}

// Add helper paths for major system part and for front core part
$view->addHelperPath(DOC . STD . '/coref/library/Indi/View/Helper' . $mhpp, 'Indi_View_Helper_' . $mhcp);
$view->addHelperPath(DOC . STD . '/public/library/Indi/View/Helper' . $mhpp, 'Indi_View_Helper_' . $mhcp);
$view->addHelperPath(DOC . STD . '/system/library/Indi/View/Helper' . $mhpp, 'Indi_View_Helper_' . $mhcp);
}

Expand Down
2 changes: 1 addition & 1 deletion library/Indi/Uri/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Indi_Uri_Base {
public function __construct() {

// Include l10n constants
foreach (ar('www,coref,system') as $fraction)
foreach (ar('www,public,system') as $fraction)
foreach (['', '/admin'] as $_)
if (file_exists($file = DOC . STD . '/'. $fraction . '/application/lang' . $_ . '/' . ini('lang')->{trim($_, '/') ?: 'front'} . '.php'))
include_once($file);
Expand Down
10 changes: 5 additions & 5 deletions library/func.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Autoloader function. Here we provide an ability for classes to be loaded from 'coref', if they are used in admin module,
* so all classes located in coref/application/controller/admin, and coref/Indi/Controller/Admin will be loaded if need
* Autoloader function. Here we provide an ability for classes to be loaded from 'public', if they are used in admin module,
* so all classes located in public/application/controller/admin, and public/Indi/Controller/Admin will be loaded if need
*
* @param $class
*/
Expand All @@ -23,16 +23,16 @@ function autoloader($class) {
if (preg_match('/^Indi_Controller_Admin_([a-zA-Z]*)$/', $class, $l))

// Prepend an appropriate dir to filename
$cf = '../coref/library/Indi/Controller/Admin/' . str_replace('_', '/', $l[1]) . '.php';
$cf = '../public/library/Indi/Controller/Admin/' . str_replace('_', '/', $l[1]) . '.php';

// Else if $class is an admin module controller
else if (is_array($c) && count($c)) {

// Prepend an appropriate dir to filename
$cf = '../coref/application/controllers/admin/' . str_replace('_', '/', $c[1]) . '.php';
$cf = '../public/application/controllers/admin/' . str_replace('_', '/', $c[1]) . '.php';

// Else if $class is some other class, we assume it's a model class
} else $cf = '../coref/application/models/' . $cf;
} else $cf = '../public/application/models/' . $cf;

// Include class file
@include_once($cf);
Expand Down
4 changes: 2 additions & 2 deletions parentdir.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ RewriteRule .* - [E=STD:%{ENV:L3},E=URI:%{ENV:URI3}]
RewriteCond %{DOCUMENT_ROOT}%{ENV:STD}/www%{ENV:URI} -f
RewriteRule .* www%{ENV:URI} [L]

RewriteCond %{DOCUMENT_ROOT}%{ENV:STD}/coref%{ENV:URI} -f
RewriteRule .* coref%{ENV:URI} [L]
RewriteCond %{DOCUMENT_ROOT}%{ENV:STD}/public%{ENV:URI} -f
RewriteRule .* public%{ENV:URI} [L]

RewriteCond %{DOCUMENT_ROOT}%{ENV:STD}/system%{ENV:URI} -f
RewriteRule .* system%{ENV:URI} [L]
Expand Down

0 comments on commit 2fd9c2d

Please sign in to comment.