Jump to content

Auto install


canadabeeau

Recommended Posts

Applogies

<?php
function getMySQLResult($result, $mode = MYSQL_ASSOC) {
    $rows = array();
    while ($row = mysql_fetch_array($result, $mode)) {
        $rows[] = $row;
    }
    return $rows;
}

function getDirectoriesFrom($directory) {
    $directories = array();
    $directory = rtrim($directory, '\/');
    if ($dh =@ opendir($directory)) {
        while (false !== ($file = readdir($dh))) {
            if (!isDot($file) && is_dir($directory . DIRECTORY_SEPARATOR . $file)) {
                $directories[] = $directory . DIRECTORY_SEPARATOR . $file;
            }
        }
        closedir($dh);
    }
    return $directories;
}

function isDot($file) {
     return $file !== '.' && $file !== '..';
}

function installApplication($applicationDirectory) {
    $sqlFile = $applicationDirectory . DIRECTORY_SEPARATOR . 'install.sql';
    if (file_exists($sqlFile)) {
        $sql = readfile($sqlFile);
    }
}
echo '<pre>';
print_r(getDirectoriesFrom('apps'));
echo '</pre>';

 

does not return blank it returns

Array
(
    [0] => apps\.
    [1] => apps\..
)

 

when in the apps folder THERE IS mac folder

 

 

Link to comment
https://forums.phpfreaks.com/topic/185077-auto-install/page/2/#findComment-977059
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.