* The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * @author Ryan Johnson <*****@*****.**> * @copyright 2007 LivePipe LLC * @license MIT */ $path = dirname(__FILE__); require_once $path . '/classes/PicoraSupport.php'; require_once $path . '/classes/PicoraEvent.php'; require_once $path . '/classes/PicoraAutoLoader.php'; require_once $path . '/classes/PicoraDispatcher.php'; require_once $path . '/classes/PicoraController.php'; require_once $path . '/classes/PicoraView.php'; require_once $path . '/config.php'; require_once $path . '/functions.php'; PicoraAutoLoader::addFolder($path . '/classes/'); PicoraAutoLoader::addFolder($path . '/controllers/'); PicoraAutoLoader::addFolder($path . '/models/'); if (defined('CONNECTION_STRING')) { PicoraActiveRecord::connect(CONNECTION_STRING); } print PicoraDispatcher::dispatch($path, BASE_URL, isset($_GET['__route__']) ? '/' . $_GET['__route__'] : '/');
public function setup() { $this->assertTrue(PicoraActiveRecord::connect(MYSQL_CONNECTION_STRING)); try { @PicoraActiveRecord::executeQuery('DROP TABLE albums'); } catch (Exception $e) { } $this->assertTrue(PicoraActiveRecord::executeQuery('CREATE TABLE albums (id int(11) NOT NULL auto_increment,name varchar(255), artist varchar(255),time varchar(255),track_count int(8), PRIMARY KEY (id))')); try { @PicoraActiveRecord::executeQuery('DROP TABLE tracks'); } catch (Exception $e) { } $this->assertTrue(PicoraActiveRecord::executeQuery('CREATE TABLE tracks (id int(11) NOT NULL auto_increment,name varchar(255),time varchar(255),album_id int(4), PRIMARY KEY (id))')); try { @PicoraActiveRecord::executeQuery('DROP TABLE bios'); } catch (Exception $e) { } $this->assertTrue(PicoraActiveRecord::executeQuery('CREATE TABLE bios (id int(11) NOT NULL auto_increment,text varchar(255), PRIMARY KEY (id))')); try { @PicoraActiveRecord::executeQuery('DROP TABLE artists'); } catch (Exception $e) { } $this->assertTrue(PicoraActiveRecord::executeQuery('CREATE TABLE artists (id int(11) NOT NULL auto_increment,name varchar(255),bio_id int(4), PRIMARY KEY (id))')); try { @PicoraActiveRecord::executeQuery('DROP TABLE artist_links'); } catch (Exception $e) { } $this->assertTrue(PicoraActiveRecord::executeQuery('CREATE TABLE artist_links (id int(11) NOT NULL auto_increment,artist_id int(4), album_id int(4), PRIMARY KEY (id))')); }