codeigniter - locate file from outside a sub-directory in CI -


i have 2 codeigniter installs in ci project. in second codeigniter install having trouble calling path outside of install folder.

project layout:

application folder download folder image folder install folder "this contains own index.php , application folder" system folder index.php "main index.php" 

the area having trouble call path outside install folder. need able locate first application folder.

example having problem.

this code here finds in install application folder. view file located

<tr> <td><?php echo fcpath . 'application/config/database.php'; ?></td> <td class="align_right"><?php echo is_writable(fcpath . 'application/config/database.php') ? '<span class="text-success">writable</span>' : '<span class="text-danger">unwritable</span>'; ?></td> </tr> </tbody> </table> 

and displays c:\xampp\htdocs\codeigniter\install\application/config/database.php

but need able pick main directory applications folder. c:\xampp\htdocs\codeigniter\application/config/database.php

i not want touch in install index.php

apppath not work because install folder has own application folder need apppath outside install folder.

got working way

<tr> <td><?php echo dirname(fcpath) . '/application/config/config.php'; ?></td> <td class="align_right"><?php echo is_writable(dirname(fcpath) . '/application/config/config.php') ? '<span class="text-success">writable</span>' : '<span class="text-danger">unwritable</span>'; ?></td> </tr>` 

Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -