public function isApplicationDuplicate($name, $value) { if (is_dir(\lib\dir::trim(__DIR__, 0, 2, '\\', true, true) . $value)) { return true; } else { return false; } }
public function __construct($view, $model, $locale, $conf, $base) { if (request::isPost() && $model->validatePost()) { $base = dir::trim(__DIR__, 0, 2, '\\', true); $src = dir::trim(__DIR__, 0, 1, '\\', true); $dst = dir::trim(__DIR__, null, 2, '\\', false, true) . request::get('appTitle'); dir::copy($src, $dst); \lib\string::replaceInFile($base, array('../index.php', 'bootstrap.php', 'conf.php', 'conf\\dev.php', 'conf\\prod.php', 'controller.php', 'imodel.php', 'model.php', 'controller\\about.php', 'locale.php', 'locale\\us.php', 'locale\\us\\error.php', 'locale\\us\\label.php', 'locale\\us\\tip.php', 'locale\\us\\phrase.php', 'model\\about.php'), 'appfarm', request::get('appTitle')); } }