コード例 #1
0
ファイル: install.php プロジェクト: hackingman/TubeX
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
define('TUBEX_CONTROL_PANEL', true);
require_once 'includes/cp-global.php';
if (Config::Get('db_username') !== null) {
    include_once 'install-already-installed.php';
} else {
    if (isset($_REQUEST['db_username'])) {
        if (DatabaseTest()) {
            $control_panel_url = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . "/index.php";
            $password = InitializeTables();
            Config::Save($_REQUEST);
            TemplateRecompileAll();
            include_once 'install-complete.php';
        }
    } else {
        if (PreTest()) {
            $_REQUEST['db_hostname'] = 'localhost';
            include_once 'install-main.php';
        }
    }
}
function PreTest()
{
    $errors = array();
    // Test template file permissions
    foreach (glob(TEMPLATES_DIR . '/*.*') as $filename) {
        if (!is_writeable($filename)) {
コード例 #2
0
ファイル: ajax.php プロジェクト: hackingman/TubeX
function tbxTemplateRecompileAll()
{
    Privileges::Check(Privileges::TEMPLATES);
    if (($result = TemplateRecompileAll()) !== true) {
        return JSON::Failure($result);
    }
    JSON::Success('All templates have been recompiled!');
}