Skip to content
Permalink
Browse files

Run pagecarton from another repository

  • Loading branch information...
Ayoola FALOLA
Ayoola FALOLA committed Jul 7, 2019
1 parent b895d06 commit 50490012022623a2c2772945cc861748d9ad4a87
@@ -53,7 +53,6 @@ public function init()
$file1 = Ayoola_Application::getDomainSettings( APPLICATION_PATH ) . DS . $loc;
}
$coreZip = dirname( $file1 ) . DS . 'pagecarton.zip';
if( ! file_exists( $coreZip ) || ! file_exists( $file1 ) || ! empty( $_REQUEST['pc_recreate_installer'] ) )
{
set_time_limit( 0 );
@@ -62,8 +61,20 @@ public function init()
$version = implode( '.', $version ) . '.x';
// download main core
$link = 'https://github.com/pagecarton/pagecarton/archive/' . $version . '.zip';
$content = self::fetchLink( $link, array( 'time_out' => 28800, 'connect_time_out' => 28800, 'raw_response_header' => true, 'return_as_array' => true, ) );
$config = PageCarton::getDomainSettings( 'site_configuraton' );
// var_export( $config );
// exit();
if( empty( $config['repository'] ) )
{
$config['repository'] = 'https://github.com/pagecarton/pagecarton/archive/' . $version . '.zip';
}
if( ! $content = self::fetchLink( $config['repository'], array( 'time_out' => 28800, 'connect_time_out' => 28800, 'raw_response_header' => true, 'return_as_array' => true, ) ) )
{
die( 'NOT ABLE TO CONNECT TO REPOSITORY - ' . $config['repository'] . ' ' );
}
$filename = tempnam( CACHE_DIR, __CLASS__ ) . '';
$filename .= '.zip';
@@ -176,7 +187,7 @@ public function init()
{
// Alert! Clear the all other content and display whats below.
$this->setViewContent( $e->getMessage() );
$this->setViewContent( 'Theres an error in the code' );
$this->setViewContent( self::__( 'Theres an error in the code' ) );
return false;
}
}
@@ -1,5 +1,6 @@
{
"PC_BASE": "",
"application_dir": "",
"run_as_core": false
"run_as_core": false,
"repository": ""
}

0 comments on commit 5049001

Please sign in to comment.
You can’t perform that action at this time.